1
0

AvatarAppearance.cs 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSimulator Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using System.Reflection;
  29. using System.Collections;
  30. using System.Collections.Generic;
  31. using OpenMetaverse;
  32. using OpenMetaverse.StructuredData;
  33. using log4net;
  34. namespace OpenSim.Framework
  35. {
  36. /// <summary>
  37. /// Contains the Avatar's Appearance and methods to manipulate the appearance.
  38. /// </summary>
  39. public class AvatarAppearance
  40. {
  41. private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
  42. public readonly static int VISUALPARAM_COUNT = 218;
  43. public readonly static int TEXTURE_COUNT = 21;
  44. public readonly static byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 };
  45. protected int m_serial = 0;
  46. protected byte[] m_visualparams;
  47. protected Primitive.TextureEntry m_texture;
  48. protected AvatarWearable[] m_wearables;
  49. protected Dictionary<int, List<AvatarAttachment>> m_attachments;
  50. protected float m_avatarHeight = 0;
  51. public virtual int Serial
  52. {
  53. get { return m_serial; }
  54. set { m_serial = value; }
  55. }
  56. public virtual byte[] VisualParams
  57. {
  58. get { return m_visualparams; }
  59. set { m_visualparams = value; }
  60. }
  61. public virtual Primitive.TextureEntry Texture
  62. {
  63. get { return m_texture; }
  64. set
  65. {
  66. // m_log.DebugFormat("[AVATAR APPEARANCE]: Set TextureEntry to {0}", value);
  67. m_texture = value;
  68. }
  69. }
  70. public virtual AvatarWearable[] Wearables
  71. {
  72. get { return m_wearables; }
  73. set { m_wearables = value; }
  74. }
  75. public virtual float AvatarHeight
  76. {
  77. get { return m_avatarHeight; }
  78. set { m_avatarHeight = value; }
  79. }
  80. public AvatarAppearance()
  81. {
  82. // m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance");
  83. m_serial = 0;
  84. SetDefaultWearables();
  85. SetDefaultTexture();
  86. SetDefaultParams();
  87. SetHeight();
  88. m_attachments = new Dictionary<int, List<AvatarAttachment>>();
  89. }
  90. public AvatarAppearance(OSDMap map)
  91. {
  92. // m_log.WarnFormat("[AVATAR APPEARANCE]: create appearance from OSDMap");
  93. Unpack(map);
  94. SetHeight();
  95. }
  96. public AvatarAppearance(AvatarWearable[] wearables, Primitive.TextureEntry textureEntry, byte[] visualParams)
  97. {
  98. // m_log.WarnFormat("[AVATAR APPEARANCE] create initialized appearance");
  99. m_serial = 0;
  100. if (wearables != null)
  101. m_wearables = wearables;
  102. else
  103. SetDefaultWearables();
  104. if (textureEntry != null)
  105. m_texture = textureEntry;
  106. else
  107. SetDefaultTexture();
  108. if (visualParams != null)
  109. m_visualparams = visualParams;
  110. else
  111. SetDefaultParams();
  112. SetHeight();
  113. m_attachments = new Dictionary<int, List<AvatarAttachment>>();
  114. }
  115. public AvatarAppearance(AvatarAppearance appearance) : this(appearance, true)
  116. {
  117. }
  118. public AvatarAppearance(AvatarAppearance appearance, bool copyWearables)
  119. {
  120. // m_log.WarnFormat("[AVATAR APPEARANCE] create from an existing appearance");
  121. if (appearance == null)
  122. {
  123. m_serial = 0;
  124. SetDefaultWearables();
  125. SetDefaultTexture();
  126. SetDefaultParams();
  127. SetHeight();
  128. m_attachments = new Dictionary<int, List<AvatarAttachment>>();
  129. return;
  130. }
  131. m_serial = appearance.Serial;
  132. m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES];
  133. for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
  134. m_wearables[i] = new AvatarWearable();
  135. if (copyWearables && (appearance.Wearables != null))
  136. {
  137. for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
  138. SetWearable(i,appearance.Wearables[i]);
  139. }
  140. m_texture = null;
  141. if (appearance.Texture != null)
  142. {
  143. byte[] tbytes = appearance.Texture.GetBytes();
  144. m_texture = new Primitive.TextureEntry(tbytes,0,tbytes.Length);
  145. }
  146. m_visualparams = null;
  147. if (appearance.VisualParams != null)
  148. m_visualparams = (byte[])appearance.VisualParams.Clone();
  149. m_avatarHeight = appearance.m_avatarHeight;
  150. // Copy the attachment, force append mode since that ensures consistency
  151. m_attachments = new Dictionary<int, List<AvatarAttachment>>();
  152. foreach (AvatarAttachment attachment in appearance.GetAttachments())
  153. AppendAttachment(new AvatarAttachment(attachment));
  154. }
  155. public void GetAssetsFrom(AvatarAppearance app)
  156. {
  157. for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
  158. {
  159. for (int j = 0; j < m_wearables[i].Count; j++)
  160. {
  161. UUID itemID = m_wearables[i][j].ItemID;
  162. UUID assetID = app.Wearables[i].GetAsset(itemID);
  163. if (assetID != UUID.Zero)
  164. m_wearables[i].Add(itemID, assetID);
  165. }
  166. }
  167. }
  168. public void ClearWearables()
  169. {
  170. m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES];
  171. for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
  172. m_wearables[i] = new AvatarWearable();
  173. }
  174. protected virtual void SetDefaultWearables()
  175. {
  176. m_wearables = AvatarWearable.DefaultWearables;
  177. }
  178. /// <summary>
  179. /// Invalidate all of the baked textures in the appearance, useful
  180. /// if you know that none are valid
  181. /// </summary>
  182. public virtual void ResetAppearance()
  183. {
  184. // m_log.WarnFormat("[AVATAR APPEARANCE]: Reset appearance");
  185. m_serial = 0;
  186. SetDefaultTexture();
  187. //for (int i = 0; i < BAKE_INDICES.Length; i++)
  188. // {
  189. // int idx = BAKE_INDICES[i];
  190. // m_texture.FaceTextures[idx].TextureID = UUID.Zero;
  191. // }
  192. }
  193. protected virtual void SetDefaultParams()
  194. {
  195. m_visualparams = new byte[] { 33,61,85,23,58,127,63,85,63,42,0,85,63,36,85,95,153,63,34,0,63,109,88,132,63,136,81,85,103,136,127,0,150,150,150,127,0,0,0,0,0,127,0,0,255,127,114,127,99,63,127,140,127,127,0,0,0,191,0,104,0,0,0,0,0,0,0,0,0,145,216,133,0,127,0,127,170,0,0,127,127,109,85,127,127,63,85,42,150,150,150,150,150,150,150,25,150,150,150,0,127,0,0,144,85,127,132,127,85,0,127,127,127,127,127,127,59,127,85,127,127,106,47,79,127,127,204,2,141,66,0,0,127,127,0,0,0,0,127,0,159,0,0,178,127,36,85,131,127,127,127,153,95,0,140,75,27,127,127,0,150,150,198,0,0,63,30,127,165,209,198,127,127,153,204,51,51,255,255,255,204,0,255,150,150,150,150,150,150,150,150,150,150,0,150,150,150,150,150,0,127,127,150,150,150,150,150,150,150,150,0,0,150,51,132,150,150,150 };
  196. // for (int i = 0; i < VISUALPARAM_COUNT; i++)
  197. // {
  198. // m_visualparams[i] = 150;
  199. // }
  200. }
  201. protected virtual void SetDefaultTexture()
  202. {
  203. m_texture = new Primitive.TextureEntry(new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE));
  204. // for (uint i = 0; i < TEXTURE_COUNT; i++)
  205. // m_texture.CreateFace(i).TextureID = new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE);
  206. }
  207. /// <summary>
  208. /// Set up appearance texture ids.
  209. /// </summary>
  210. /// <returns>
  211. /// True if any existing texture id was changed by the new data.
  212. /// False if there were no changes or no existing texture ids.
  213. /// </returns>
  214. public virtual bool SetTextureEntries(Primitive.TextureEntry textureEntry)
  215. {
  216. if (textureEntry == null)
  217. return false;
  218. // There are much simpler versions of this copy that could be
  219. // made. We determine if any of the textures actually
  220. // changed to know if the appearance should be saved later
  221. bool changed = false;
  222. for (uint i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++)
  223. {
  224. Primitive.TextureEntryFace newface = textureEntry.FaceTextures[i];
  225. Primitive.TextureEntryFace oldface = m_texture.FaceTextures[i];
  226. if (newface == null)
  227. {
  228. if (oldface == null)
  229. continue;
  230. }
  231. else
  232. {
  233. if (oldface != null && oldface.TextureID == newface.TextureID)
  234. continue;
  235. }
  236. changed = true;
  237. }
  238. m_texture = textureEntry;
  239. return changed;
  240. }
  241. /// <summary>
  242. /// Set up visual parameters for the avatar and refresh the avatar height
  243. /// </summary>
  244. /// <returns>
  245. /// True if any existing visual parameter was changed by the new data.
  246. /// False if there were no changes or no existing visual parameters.
  247. /// </returns>
  248. public virtual bool SetVisualParams(byte[] visualParams)
  249. {
  250. if (visualParams == null)
  251. return false;
  252. // There are much simpler versions of this copy that could be
  253. // made. We determine if any of the visual parameters actually
  254. // changed to know if the appearance should be saved later
  255. bool changed = false;
  256. for (int i = 0; i < AvatarAppearance.VISUALPARAM_COUNT; i++)
  257. {
  258. if (visualParams[i] != m_visualparams[i])
  259. {
  260. // DEBUG ON
  261. // m_log.WarnFormat("[AVATARAPPEARANCE] vparams changed [{0}] {1} ==> {2}",
  262. // i,m_visualparams[i],visualParams[i]);
  263. // DEBUG OFF
  264. m_visualparams[i] = visualParams[i];
  265. changed = true;
  266. }
  267. }
  268. // Reset the height if the visual parameters actually changed
  269. if (changed)
  270. SetHeight();
  271. return changed;
  272. }
  273. public virtual void SetAppearance(Primitive.TextureEntry textureEntry, byte[] visualParams)
  274. {
  275. SetTextureEntries(textureEntry);
  276. SetVisualParams(visualParams);
  277. }
  278. public virtual void SetHeight()
  279. {
  280. // Start with shortest possible female avatar height
  281. m_avatarHeight = 1.14597f;
  282. // Add offset for male avatars
  283. if (m_visualparams[(int)VPElement.SHAPE_MALE] != 0)
  284. m_avatarHeight += 0.0848f;
  285. // Add offsets for visual params
  286. m_avatarHeight += 0.516945f * (float)m_visualparams[(int)VPElement.SHAPE_HEIGHT] / 255.0f
  287. + 0.08117f * (float)m_visualparams[(int)VPElement.SHAPE_HEAD_SIZE] / 255.0f
  288. + 0.3836f * (float)m_visualparams[(int)VPElement.SHAPE_LEG_LENGTH] / 255.0f
  289. + 0.07f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f
  290. + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f
  291. + 0.076f * (float)m_visualparams[(int)VPElement.SHAPE_NECK_LENGTH] / 255.0f;
  292. }
  293. public virtual void SetWearable(int wearableId, AvatarWearable wearable)
  294. {
  295. // DEBUG ON
  296. // m_log.WarnFormat("[AVATARAPPEARANCE] set wearable {0} --> {1}:{2}",wearableId,wearable.ItemID,wearable.AssetID);
  297. // DEBUG OFF
  298. m_wearables[wearableId].Clear();
  299. for (int i = 0; i < wearable.Count; i++)
  300. m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID);
  301. }
  302. // DEBUG ON
  303. public override String ToString()
  304. {
  305. String s = "";
  306. s += String.Format("Serial: {0}\n",m_serial);
  307. for (uint i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++)
  308. if (m_texture.FaceTextures[i] != null)
  309. s += String.Format("Texture: {0} --> {1}\n",i,m_texture.FaceTextures[i].TextureID);
  310. foreach (AvatarWearable awear in m_wearables)
  311. {
  312. for (int i = 0; i < awear.Count; i++)
  313. s += String.Format("Wearable: item={0}, asset={1}\n",awear[i].ItemID,awear[i].AssetID);
  314. }
  315. s += "Visual Params: ";
  316. for (uint j = 0; j < AvatarAppearance.VISUALPARAM_COUNT; j++)
  317. s += String.Format("{0},",m_visualparams[j]);
  318. s += "\n";
  319. return s;
  320. }
  321. // DEBUG OFF
  322. /// <summary>
  323. /// Get a list of the attachments.
  324. /// </summary>
  325. /// <remarks>
  326. /// There may be duplicate attachpoints
  327. /// </remarks>
  328. public List<AvatarAttachment> GetAttachments()
  329. {
  330. List<AvatarAttachment> alist = new List<AvatarAttachment>();
  331. lock (m_attachments)
  332. {
  333. foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments)
  334. {
  335. foreach (AvatarAttachment attach in kvp.Value)
  336. alist.Add(new AvatarAttachment(attach));
  337. }
  338. }
  339. return alist;
  340. }
  341. internal void AppendAttachment(AvatarAttachment attach)
  342. {
  343. // m_log.DebugFormat(
  344. // "[AVATAR APPEARNCE]: Appending itemID={0}, assetID={1} at {2}",
  345. // attach.ItemID, attach.AssetID, attach.AttachPoint);
  346. lock (m_attachments)
  347. {
  348. if (!m_attachments.ContainsKey(attach.AttachPoint))
  349. m_attachments[attach.AttachPoint] = new List<AvatarAttachment>();
  350. m_attachments[attach.AttachPoint].Add(attach);
  351. }
  352. }
  353. internal void ReplaceAttachment(AvatarAttachment attach)
  354. {
  355. // m_log.DebugFormat(
  356. // "[AVATAR APPEARANCE]: Replacing itemID={0}, assetID={1} at {2}",
  357. // attach.ItemID, attach.AssetID, attach.AttachPoint);
  358. lock (m_attachments)
  359. {
  360. m_attachments[attach.AttachPoint] = new List<AvatarAttachment>();
  361. m_attachments[attach.AttachPoint].Add(attach);
  362. }
  363. }
  364. /// <summary>
  365. /// Set an attachment
  366. /// </summary>
  367. /// <remarks>
  368. /// If the attachpoint has the
  369. /// 0x80 bit set then we assume this is an append
  370. /// operation otherwise we replace whatever is
  371. /// currently attached at the attachpoint
  372. /// </remarks>
  373. /// <param name="attachpoint"></param>
  374. /// <param name="item">If UUID.Zero, then an any attachment at the attachpoint is removed.</param>
  375. /// <param name="asset"></param>
  376. /// <returns>
  377. /// return true if something actually changed
  378. /// </returns>
  379. public bool SetAttachment(int attachpoint, UUID item, UUID asset)
  380. {
  381. // m_log.DebugFormat(
  382. // "[AVATAR APPEARANCE]: Setting attachment at {0} with item ID {1}, asset ID {2}",
  383. // attachpoint, item, asset);
  384. if (attachpoint == 0)
  385. return false;
  386. if (item == UUID.Zero)
  387. {
  388. lock (m_attachments)
  389. {
  390. if (m_attachments.ContainsKey(attachpoint))
  391. {
  392. m_attachments.Remove(attachpoint);
  393. return true;
  394. }
  395. }
  396. return false;
  397. }
  398. // When a user logs in, the attachment item ids are pulled from persistence in the Avatars table. However,
  399. // the asset ids are not saved. When the avatar enters a simulator the attachments are set again. If
  400. // we simply perform an item check here then the asset ids (which are now present) are never set, and NPC attachments
  401. // later fail unless the attachment is detached and reattached.
  402. //
  403. // Therefore, we will carry on with the set if the existing attachment has no asset id.
  404. AvatarAttachment existingAttachment = GetAttachmentForItem(item);
  405. if (existingAttachment != null
  406. && existingAttachment.AssetID != UUID.Zero
  407. && existingAttachment.AttachPoint == (attachpoint & 0x7F))
  408. {
  409. // m_log.DebugFormat("[AVATAR APPEARANCE] attempt to attach an already attached item {0}",item);
  410. return false;
  411. }
  412. // check if this is an append or a replace, 0x80 marks it as an append
  413. if ((attachpoint & 0x80) > 0)
  414. {
  415. // strip the append bit
  416. int point = attachpoint & 0x7F;
  417. AppendAttachment(new AvatarAttachment(point, item, asset));
  418. }
  419. else
  420. {
  421. ReplaceAttachment(new AvatarAttachment(attachpoint,item, asset));
  422. }
  423. return true;
  424. }
  425. /// <summary>
  426. /// If the item is already attached, return it.
  427. /// </summary>
  428. /// <param name="itemID"></param>
  429. /// <returns>Returns null if this item is not attached.</returns>
  430. public AvatarAttachment GetAttachmentForItem(UUID itemID)
  431. {
  432. lock (m_attachments)
  433. {
  434. foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments)
  435. {
  436. int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; });
  437. if (index >= 0)
  438. return kvp.Value[index];
  439. }
  440. }
  441. return null;
  442. }
  443. public int GetAttachpoint(UUID itemID)
  444. {
  445. lock (m_attachments)
  446. {
  447. foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments)
  448. {
  449. int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; });
  450. if (index >= 0)
  451. return kvp.Key;
  452. }
  453. }
  454. return 0;
  455. }
  456. public bool DetachAttachment(UUID itemID)
  457. {
  458. lock (m_attachments)
  459. {
  460. foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments)
  461. {
  462. int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; });
  463. if (index >= 0)
  464. {
  465. // Remove it from the list of attachments at that attach point
  466. m_attachments[kvp.Key].RemoveAt(index);
  467. // And remove the list if there are no more attachments here
  468. if (m_attachments[kvp.Key].Count == 0)
  469. m_attachments.Remove(kvp.Key);
  470. return true;
  471. }
  472. }
  473. }
  474. return false;
  475. }
  476. public void ClearAttachments()
  477. {
  478. lock (m_attachments)
  479. m_attachments.Clear();
  480. }
  481. #region Packing Functions
  482. /// <summary>
  483. /// Create an OSDMap from the appearance data
  484. /// </summary>
  485. public OSDMap Pack()
  486. {
  487. OSDMap data = new OSDMap();
  488. data["serial"] = OSD.FromInteger(m_serial);
  489. data["height"] = OSD.FromReal(m_avatarHeight);
  490. // Wearables
  491. OSDArray wears = new OSDArray(AvatarWearable.MAX_WEARABLES);
  492. for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
  493. wears.Add(m_wearables[i].Pack());
  494. data["wearables"] = wears;
  495. // Avatar Textures
  496. OSDArray textures = new OSDArray(AvatarAppearance.TEXTURE_COUNT);
  497. for (uint i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++)
  498. {
  499. if (m_texture.FaceTextures[i] != null)
  500. textures.Add(OSD.FromUUID(m_texture.FaceTextures[i].TextureID));
  501. else
  502. textures.Add(OSD.FromUUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE));
  503. }
  504. data["textures"] = textures;
  505. // Visual Parameters
  506. OSDBinary visualparams = new OSDBinary(m_visualparams);
  507. data["visualparams"] = visualparams;
  508. // Attachments
  509. List<AvatarAttachment> attachments = GetAttachments();
  510. OSDArray attachs = new OSDArray(attachments.Count);
  511. foreach (AvatarAttachment attach in GetAttachments())
  512. attachs.Add(attach.Pack());
  513. data["attachments"] = attachs;
  514. return data;
  515. }
  516. /// <summary>
  517. /// Unpack and OSDMap and initialize the appearance
  518. /// from it
  519. /// </summary>
  520. public void Unpack(OSDMap data)
  521. {
  522. if ((data != null) && (data["serial"] != null))
  523. m_serial = data["serial"].AsInteger();
  524. if ((data != null) && (data["height"] != null))
  525. m_avatarHeight = (float)data["height"].AsReal();
  526. try
  527. {
  528. // Wearables
  529. SetDefaultWearables();
  530. if ((data != null) && (data["wearables"] != null) && (data["wearables"]).Type == OSDType.Array)
  531. {
  532. OSDArray wears = (OSDArray)(data["wearables"]);
  533. for (int i = 0; i < wears.Count; i++)
  534. m_wearables[i] = new AvatarWearable((OSDArray)wears[i]);
  535. }
  536. else
  537. {
  538. m_log.Warn("[AVATAR APPEARANCE]: failed to unpack wearables");
  539. }
  540. // Avatar Textures
  541. SetDefaultTexture();
  542. if ((data != null) && (data["textures"] != null) && (data["textures"]).Type == OSDType.Array)
  543. {
  544. OSDArray textures = (OSDArray)(data["textures"]);
  545. for (int i = 0; i < AvatarAppearance.TEXTURE_COUNT && i < textures.Count; i++)
  546. {
  547. UUID textureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE;
  548. if (textures[i] != null)
  549. textureID = textures[i].AsUUID();
  550. m_texture.CreateFace((uint)i).TextureID = new UUID(textureID);
  551. }
  552. }
  553. else
  554. {
  555. m_log.Warn("[AVATAR APPEARANCE]: failed to unpack textures");
  556. }
  557. // Visual Parameters
  558. SetDefaultParams();
  559. if ((data != null) && (data["visualparams"] != null))
  560. {
  561. if ((data["visualparams"].Type == OSDType.Binary) || (data["visualparams"].Type == OSDType.Array))
  562. m_visualparams = data["visualparams"].AsBinary();
  563. }
  564. else
  565. {
  566. m_log.Warn("[AVATAR APPEARANCE]: failed to unpack visual parameters");
  567. }
  568. // Attachments
  569. m_attachments = new Dictionary<int, List<AvatarAttachment>>();
  570. if ((data != null) && (data["attachments"] != null) && (data["attachments"]).Type == OSDType.Array)
  571. {
  572. OSDArray attachs = (OSDArray)(data["attachments"]);
  573. for (int i = 0; i < attachs.Count; i++)
  574. {
  575. AvatarAttachment att = new AvatarAttachment((OSDMap)attachs[i]);
  576. AppendAttachment(att);
  577. // m_log.DebugFormat(
  578. // "[AVATAR APPEARANCE]: Unpacked attachment itemID {0}, assetID {1}, point {2}",
  579. // att.ItemID, att.AssetID, att.AttachPoint);
  580. }
  581. }
  582. }
  583. catch (Exception e)
  584. {
  585. m_log.ErrorFormat("[AVATAR APPEARANCE]: unpack failed badly: {0}{1}", e.Message, e.StackTrace);
  586. }
  587. }
  588. #endregion
  589. #region VPElement
  590. /// <summary>
  591. /// Viewer Params Array Element for AgentSetAppearance
  592. /// Generated from LibOMV's Visual Params list
  593. /// </summary>
  594. public enum VPElement : int
  595. {
  596. /// <summary>
  597. /// Brow Size - Small 0--+255 Large
  598. /// </summary>
  599. SHAPE_BIG_BROW = 0,
  600. /// <summary>
  601. /// Nose Size - Small 0--+255 Large
  602. /// </summary>
  603. SHAPE_NOSE_BIG_OUT = 1,
  604. /// <summary>
  605. /// Nostril Width - Narrow 0--+255 Broad
  606. /// </summary>
  607. SHAPE_BROAD_NOSTRILS = 2,
  608. /// <summary>
  609. /// Chin Cleft - Round 0--+255 Cleft
  610. /// </summary>
  611. SHAPE_CLEFT_CHIN = 3,
  612. /// <summary>
  613. /// Nose Tip Shape - Pointy 0--+255 Bulbous
  614. /// </summary>
  615. SHAPE_BULBOUS_NOSE_TIP = 4,
  616. /// <summary>
  617. /// Chin Angle - Chin Out 0--+255 Chin In
  618. /// </summary>
  619. SHAPE_WEAK_CHIN = 5,
  620. /// <summary>
  621. /// Chin-Neck - Tight Chin 0--+255 Double Chin
  622. /// </summary>
  623. SHAPE_DOUBLE_CHIN = 6,
  624. /// <summary>
  625. /// Lower Cheeks - Well-Fed 0--+255 Sunken
  626. /// </summary>
  627. SHAPE_SUNKEN_CHEEKS = 7,
  628. /// <summary>
  629. /// Upper Bridge - Low 0--+255 High
  630. /// </summary>
  631. SHAPE_NOBLE_NOSE_BRIDGE = 8,
  632. /// <summary>
  633. /// - Less 0--+255 More
  634. /// </summary>
  635. SHAPE_JOWLS = 9,
  636. /// <summary>
  637. /// Upper Chin Cleft - Round 0--+255 Cleft
  638. /// </summary>
  639. SHAPE_CLEFT_CHIN_UPPER = 10,
  640. /// <summary>
  641. /// Cheek Bones - Low 0--+255 High
  642. /// </summary>
  643. SHAPE_HIGH_CHEEK_BONES = 11,
  644. /// <summary>
  645. /// Ear Angle - In 0--+255 Out
  646. /// </summary>
  647. SHAPE_EARS_OUT = 12,
  648. /// <summary>
  649. /// Eyebrow Points - Smooth 0--+255 Pointy
  650. /// </summary>
  651. HAIR_POINTY_EYEBROWS = 13,
  652. /// <summary>
  653. /// Jaw Shape - Pointy 0--+255 Square
  654. /// </summary>
  655. SHAPE_SQUARE_JAW = 14,
  656. /// <summary>
  657. /// Upper Cheeks - Thin 0--+255 Puffy
  658. /// </summary>
  659. SHAPE_PUFFY_UPPER_CHEEKS = 15,
  660. /// <summary>
  661. /// Nose Tip Angle - Downturned 0--+255 Upturned
  662. /// </summary>
  663. SHAPE_UPTURNED_NOSE_TIP = 16,
  664. /// <summary>
  665. /// Nose Thickness - Thin Nose 0--+255 Bulbous Nose
  666. /// </summary>
  667. SHAPE_BULBOUS_NOSE = 17,
  668. /// <summary>
  669. /// Upper Eyelid Fold - Uncreased 0--+255 Creased
  670. /// </summary>
  671. SHAPE_UPPER_EYELID_FOLD = 18,
  672. /// <summary>
  673. /// Attached Earlobes - Unattached 0--+255 Attached
  674. /// </summary>
  675. SHAPE_ATTACHED_EARLOBES = 19,
  676. /// <summary>
  677. /// Eye Bags - Smooth 0--+255 Baggy
  678. /// </summary>
  679. SHAPE_BAGGY_EYES = 20,
  680. /// <summary>
  681. /// Eye Opening - Narrow 0--+255 Wide
  682. /// </summary>
  683. SHAPE_WIDE_EYES = 21,
  684. /// <summary>
  685. /// Lip Cleft - Narrow 0--+255 Wide
  686. /// </summary>
  687. SHAPE_WIDE_LIP_CLEFT = 22,
  688. /// <summary>
  689. /// Bridge Width - Narrow 0--+255 Wide
  690. /// </summary>
  691. SHAPE_WIDE_NOSE_BRIDGE = 23,
  692. /// <summary>
  693. /// Eyebrow Arc - Flat 0--+255 Arced
  694. /// </summary>
  695. HAIR_ARCED_EYEBROWS = 24,
  696. /// <summary>
  697. /// Height - Short 0--+255 Tall
  698. /// </summary>
  699. SHAPE_HEIGHT = 25,
  700. /// <summary>
  701. /// Body Thickness - Body Thin 0--+255 Body Thick
  702. /// </summary>
  703. SHAPE_THICKNESS = 26,
  704. /// <summary>
  705. /// Ear Size - Small 0--+255 Large
  706. /// </summary>
  707. SHAPE_BIG_EARS = 27,
  708. /// <summary>
  709. /// Shoulders - Narrow 0--+255 Broad
  710. /// </summary>
  711. SHAPE_SHOULDERS = 28,
  712. /// <summary>
  713. /// Hip Width - Narrow 0--+255 Wide
  714. /// </summary>
  715. SHAPE_HIP_WIDTH = 29,
  716. /// <summary>
  717. /// - Short Torso 0--+255 Long Torso
  718. /// </summary>
  719. SHAPE_TORSO_LENGTH = 30,
  720. SHAPE_MALE = 31,
  721. /// <summary>
  722. /// - Short 0--+255 Long
  723. /// </summary>
  724. GLOVES_GLOVE_LENGTH = 32,
  725. /// <summary>
  726. /// - Darker 0--+255 Lighter
  727. /// </summary>
  728. EYES_EYE_LIGHTNESS = 33,
  729. /// <summary>
  730. /// - Natural 0--+255 Unnatural
  731. /// </summary>
  732. EYES_EYE_COLOR = 34,
  733. /// <summary>
  734. /// - Small 0--+255 Large
  735. /// </summary>
  736. SHAPE_BREAST_SIZE = 35,
  737. /// <summary>
  738. /// - None 0--+255 Wild
  739. /// </summary>
  740. SKIN_RAINBOW_COLOR = 36,
  741. /// <summary>
  742. /// Ruddiness - Pale 0--+255 Ruddy
  743. /// </summary>
  744. SKIN_RED_SKIN = 37,
  745. /// <summary>
  746. /// - Light 0--+255 Dark
  747. /// </summary>
  748. SKIN_PIGMENT = 38,
  749. HAIR_RAINBOW_COLOR_39 = 39,
  750. /// <summary>
  751. /// - No Red 0--+255 Very Red
  752. /// </summary>
  753. HAIR_RED_HAIR = 40,
  754. /// <summary>
  755. /// - Black 0--+255 Blonde
  756. /// </summary>
  757. HAIR_BLONDE_HAIR = 41,
  758. /// <summary>
  759. /// - No White 0--+255 All White
  760. /// </summary>
  761. HAIR_WHITE_HAIR = 42,
  762. /// <summary>
  763. /// - Less Rosy 0--+255 More Rosy
  764. /// </summary>
  765. SKIN_ROSY_COMPLEXION = 43,
  766. /// <summary>
  767. /// - Darker 0--+255 Pinker
  768. /// </summary>
  769. SKIN_LIP_PINKNESS = 44,
  770. /// <summary>
  771. /// - Thin Eyebrows 0--+255 Bushy Eyebrows
  772. /// </summary>
  773. HAIR_EYEBROW_SIZE = 45,
  774. /// <summary>
  775. /// - Short 0--+255 Long
  776. /// </summary>
  777. HAIR_FRONT_FRINGE = 46,
  778. /// <summary>
  779. /// - Short 0--+255 Long
  780. /// </summary>
  781. HAIR_SIDE_FRINGE = 47,
  782. /// <summary>
  783. /// - Short 0--+255 Long
  784. /// </summary>
  785. HAIR_BACK_FRINGE = 48,
  786. /// <summary>
  787. /// - Short 0--+255 Long
  788. /// </summary>
  789. HAIR_HAIR_FRONT = 49,
  790. /// <summary>
  791. /// - Short 0--+255 Long
  792. /// </summary>
  793. HAIR_HAIR_SIDES = 50,
  794. /// <summary>
  795. /// - Short 0--+255 Long
  796. /// </summary>
  797. HAIR_HAIR_BACK = 51,
  798. /// <summary>
  799. /// - Sweep Forward 0--+255 Sweep Back
  800. /// </summary>
  801. HAIR_HAIR_SWEEP = 52,
  802. /// <summary>
  803. /// - Left 0--+255 Right
  804. /// </summary>
  805. HAIR_HAIR_TILT = 53,
  806. /// <summary>
  807. /// Middle Part - No Part 0--+255 Part
  808. /// </summary>
  809. HAIR_HAIR_PART_MIDDLE = 54,
  810. /// <summary>
  811. /// Right Part - No Part 0--+255 Part
  812. /// </summary>
  813. HAIR_HAIR_PART_RIGHT = 55,
  814. /// <summary>
  815. /// Left Part - No Part 0--+255 Part
  816. /// </summary>
  817. HAIR_HAIR_PART_LEFT = 56,
  818. /// <summary>
  819. /// Full Hair Sides - Mowhawk 0--+255 Full Sides
  820. /// </summary>
  821. HAIR_HAIR_SIDES_FULL = 57,
  822. /// <summary>
  823. /// - Less 0--+255 More
  824. /// </summary>
  825. SKIN_BODY_DEFINITION = 58,
  826. /// <summary>
  827. /// Lip Width - Narrow Lips 0--+255 Wide Lips
  828. /// </summary>
  829. SHAPE_LIP_WIDTH = 59,
  830. /// <summary>
  831. /// - Small 0--+255 Big
  832. /// </summary>
  833. SHAPE_BELLY_SIZE = 60,
  834. /// <summary>
  835. /// - Less 0--+255 More
  836. /// </summary>
  837. SKIN_FACIAL_DEFINITION = 61,
  838. /// <summary>
  839. /// - Less 0--+255 More
  840. /// </summary>
  841. SKIN_WRINKLES = 62,
  842. /// <summary>
  843. /// - Less 0--+255 More
  844. /// </summary>
  845. SKIN_FRECKLES = 63,
  846. /// <summary>
  847. /// - Short Sideburns 0--+255 Mutton Chops
  848. /// </summary>
  849. HAIR_SIDEBURNS = 64,
  850. /// <summary>
  851. /// - Chaplin 0--+255 Handlebars
  852. /// </summary>
  853. HAIR_MOUSTACHE = 65,
  854. /// <summary>
  855. /// - Less soul 0--+255 More soul
  856. /// </summary>
  857. HAIR_SOULPATCH = 66,
  858. /// <summary>
  859. /// - Less Curtains 0--+255 More Curtains
  860. /// </summary>
  861. HAIR_CHIN_CURTAINS = 67,
  862. /// <summary>
  863. /// Rumpled Hair - Smooth Hair 0--+255 Rumpled Hair
  864. /// </summary>
  865. HAIR_HAIR_RUMPLED = 68,
  866. /// <summary>
  867. /// Big Hair Front - Less 0--+255 More
  868. /// </summary>
  869. HAIR_HAIR_BIG_FRONT = 69,
  870. /// <summary>
  871. /// Big Hair Top - Less 0--+255 More
  872. /// </summary>
  873. HAIR_HAIR_BIG_TOP = 70,
  874. /// <summary>
  875. /// Big Hair Back - Less 0--+255 More
  876. /// </summary>
  877. HAIR_HAIR_BIG_BACK = 71,
  878. /// <summary>
  879. /// Spiked Hair - No Spikes 0--+255 Big Spikes
  880. /// </summary>
  881. HAIR_HAIR_SPIKED = 72,
  882. /// <summary>
  883. /// Chin Depth - Shallow 0--+255 Deep
  884. /// </summary>
  885. SHAPE_DEEP_CHIN = 73,
  886. /// <summary>
  887. /// Part Bangs - No Part 0--+255 Part Bangs
  888. /// </summary>
  889. HAIR_BANGS_PART_MIDDLE = 74,
  890. /// <summary>
  891. /// Head Shape - More Square 0--+255 More Round
  892. /// </summary>
  893. SHAPE_HEAD_SHAPE = 75,
  894. /// <summary>
  895. /// Eye Spacing - Close Set Eyes 0--+255 Far Set Eyes
  896. /// </summary>
  897. SHAPE_EYE_SPACING = 76,
  898. /// <summary>
  899. /// - Low Heels 0--+255 High Heels
  900. /// </summary>
  901. SHOES_HEEL_HEIGHT = 77,
  902. /// <summary>
  903. /// - Low Platforms 0--+255 High Platforms
  904. /// </summary>
  905. SHOES_PLATFORM_HEIGHT = 78,
  906. /// <summary>
  907. /// - Thin Lips 0--+255 Fat Lips
  908. /// </summary>
  909. SHAPE_LIP_THICKNESS = 79,
  910. /// <summary>
  911. /// Mouth Position - High 0--+255 Low
  912. /// </summary>
  913. SHAPE_MOUTH_HEIGHT = 80,
  914. /// <summary>
  915. /// Breast Buoyancy - Less Gravity 0--+255 More Gravity
  916. /// </summary>
  917. SHAPE_BREAST_GRAVITY = 81,
  918. /// <summary>
  919. /// Platform Width - Narrow 0--+255 Wide
  920. /// </summary>
  921. SHOES_SHOE_PLATFORM_WIDTH = 82,
  922. /// <summary>
  923. /// - Pointy Heels 0--+255 Thick Heels
  924. /// </summary>
  925. SHOES_HEEL_SHAPE = 83,
  926. /// <summary>
  927. /// - Pointy 0--+255 Square
  928. /// </summary>
  929. SHOES_TOE_SHAPE = 84,
  930. /// <summary>
  931. /// Foot Size - Small 0--+255 Big
  932. /// </summary>
  933. SHAPE_FOOT_SIZE = 85,
  934. /// <summary>
  935. /// Nose Width - Narrow 0--+255 Wide
  936. /// </summary>
  937. SHAPE_WIDE_NOSE = 86,
  938. /// <summary>
  939. /// Eyelash Length - Short 0--+255 Long
  940. /// </summary>
  941. SHAPE_EYELASHES_LONG = 87,
  942. /// <summary>
  943. /// - Short 0--+255 Long
  944. /// </summary>
  945. UNDERSHIRT_SLEEVE_LENGTH = 88,
  946. /// <summary>
  947. /// - Short 0--+255 Long
  948. /// </summary>
  949. UNDERSHIRT_BOTTOM = 89,
  950. /// <summary>
  951. /// - Low 0--+255 High
  952. /// </summary>
  953. UNDERSHIRT_COLLAR_FRONT = 90,
  954. JACKET_SLEEVE_LENGTH_91 = 91,
  955. JACKET_COLLAR_FRONT_92 = 92,
  956. /// <summary>
  957. /// Jacket Length - Short 0--+255 Long
  958. /// </summary>
  959. JACKET_BOTTOM_LENGTH_LOWER = 93,
  960. /// <summary>
  961. /// Open Front - Open 0--+255 Closed
  962. /// </summary>
  963. JACKET_OPEN_JACKET = 94,
  964. /// <summary>
  965. /// - Short 0--+255 Tall
  966. /// </summary>
  967. SHOES_SHOE_HEIGHT = 95,
  968. /// <summary>
  969. /// - Short 0--+255 Long
  970. /// </summary>
  971. SOCKS_SOCKS_LENGTH = 96,
  972. /// <summary>
  973. /// - Short 0--+255 Long
  974. /// </summary>
  975. UNDERPANTS_PANTS_LENGTH = 97,
  976. /// <summary>
  977. /// - Low 0--+255 High
  978. /// </summary>
  979. UNDERPANTS_PANTS_WAIST = 98,
  980. /// <summary>
  981. /// Cuff Flare - Tight Cuffs 0--+255 Flared Cuffs
  982. /// </summary>
  983. PANTS_LEG_PANTFLAIR = 99,
  984. /// <summary>
  985. /// - More Vertical 0--+255 More Sloped
  986. /// </summary>
  987. SHAPE_FOREHEAD_ANGLE = 100,
  988. /// <summary>
  989. /// - Less Body Fat 0--+255 More Body Fat
  990. /// </summary>
  991. SHAPE_BODY_FAT = 101,
  992. /// <summary>
  993. /// Pants Crotch - High and Tight 0--+255 Low and Loose
  994. /// </summary>
  995. PANTS_LOW_CROTCH = 102,
  996. /// <summary>
  997. /// Egg Head - Chin Heavy 0--+255 Forehead Heavy
  998. /// </summary>
  999. SHAPE_EGG_HEAD = 103,
  1000. /// <summary>
  1001. /// Head Stretch - Squash Head 0--+255 Stretch Head
  1002. /// </summary>
  1003. SHAPE_SQUASH_STRETCH_HEAD = 104,
  1004. /// <summary>
  1005. /// Torso Muscles - Less Muscular 0--+255 More Muscular
  1006. /// </summary>
  1007. SHAPE_TORSO_MUSCLES = 105,
  1008. /// <summary>
  1009. /// Outer Eye Corner - Corner Down 0--+255 Corner Up
  1010. /// </summary>
  1011. SHAPE_EYELID_CORNER_UP = 106,
  1012. /// <summary>
  1013. /// - Less Muscular 0--+255 More Muscular
  1014. /// </summary>
  1015. SHAPE_LEG_MUSCLES = 107,
  1016. /// <summary>
  1017. /// Lip Fullness - Less Full 0--+255 More Full
  1018. /// </summary>
  1019. SHAPE_TALL_LIPS = 108,
  1020. /// <summary>
  1021. /// Toe Thickness - Flat Toe 0--+255 Thick Toe
  1022. /// </summary>
  1023. SHOES_SHOE_TOE_THICK = 109,
  1024. /// <summary>
  1025. /// Crooked Nose - Nose Left 0--+255 Nose Right
  1026. /// </summary>
  1027. SHAPE_CROOKED_NOSE = 110,
  1028. /// <summary>
  1029. /// - Corner Down 0--+255 Corner Up
  1030. /// </summary>
  1031. SHAPE_MOUTH_CORNER = 111,
  1032. /// <summary>
  1033. /// - Shear Right Up 0--+255 Shear Left Up
  1034. /// </summary>
  1035. SHAPE_FACE_SHEAR = 112,
  1036. /// <summary>
  1037. /// Shift Mouth - Shift Left 0--+255 Shift Right
  1038. /// </summary>
  1039. SHAPE_SHIFT_MOUTH = 113,
  1040. /// <summary>
  1041. /// Eye Pop - Pop Right Eye 0--+255 Pop Left Eye
  1042. /// </summary>
  1043. SHAPE_POP_EYE = 114,
  1044. /// <summary>
  1045. /// Jaw Jut - Overbite 0--+255 Underbite
  1046. /// </summary>
  1047. SHAPE_JAW_JUT = 115,
  1048. /// <summary>
  1049. /// Shear Back - Full Back 0--+255 Sheared Back
  1050. /// </summary>
  1051. HAIR_HAIR_SHEAR_BACK = 116,
  1052. /// <summary>
  1053. /// - Small Hands 0--+255 Large Hands
  1054. /// </summary>
  1055. SHAPE_HAND_SIZE = 117,
  1056. /// <summary>
  1057. /// Love Handles - Less Love 0--+255 More Love
  1058. /// </summary>
  1059. SHAPE_LOVE_HANDLES = 118,
  1060. SHAPE_TORSO_MUSCLES_119 = 119,
  1061. /// <summary>
  1062. /// Head Size - Small Head 0--+255 Big Head
  1063. /// </summary>
  1064. SHAPE_HEAD_SIZE = 120,
  1065. /// <summary>
  1066. /// - Skinny Neck 0--+255 Thick Neck
  1067. /// </summary>
  1068. SHAPE_NECK_THICKNESS = 121,
  1069. /// <summary>
  1070. /// Breast Cleavage - Separate 0--+255 Join
  1071. /// </summary>
  1072. SHAPE_BREAST_FEMALE_CLEAVAGE = 122,
  1073. /// <summary>
  1074. /// Pectorals - Big Pectorals 0--+255 Sunken Chest
  1075. /// </summary>
  1076. SHAPE_CHEST_MALE_NO_PECS = 123,
  1077. /// <summary>
  1078. /// Eye Size - Beady Eyes 0--+255 Anime Eyes
  1079. /// </summary>
  1080. SHAPE_EYE_SIZE = 124,
  1081. /// <summary>
  1082. /// - Short Legs 0--+255 Long Legs
  1083. /// </summary>
  1084. SHAPE_LEG_LENGTH = 125,
  1085. /// <summary>
  1086. /// - Short Arms 0--+255 Long arms
  1087. /// </summary>
  1088. SHAPE_ARM_LENGTH = 126,
  1089. /// <summary>
  1090. /// - Pink 0--+255 Black
  1091. /// </summary>
  1092. SKIN_LIPSTICK_COLOR = 127,
  1093. /// <summary>
  1094. /// - No Lipstick 0--+255 More Lipstick
  1095. /// </summary>
  1096. SKIN_LIPSTICK = 128,
  1097. /// <summary>
  1098. /// - No Lipgloss 0--+255 Glossy
  1099. /// </summary>
  1100. SKIN_LIPGLOSS = 129,
  1101. /// <summary>
  1102. /// - No Eyeliner 0--+255 Full Eyeliner
  1103. /// </summary>
  1104. SKIN_EYELINER = 130,
  1105. /// <summary>
  1106. /// - No Blush 0--+255 More Blush
  1107. /// </summary>
  1108. SKIN_BLUSH = 131,
  1109. /// <summary>
  1110. /// - Pink 0--+255 Orange
  1111. /// </summary>
  1112. SKIN_BLUSH_COLOR = 132,
  1113. /// <summary>
  1114. /// - Clear 0--+255 Opaque
  1115. /// </summary>
  1116. SKIN_OUT_SHDW_OPACITY = 133,
  1117. /// <summary>
  1118. /// - No Eyeshadow 0--+255 More Eyeshadow
  1119. /// </summary>
  1120. SKIN_OUTER_SHADOW = 134,
  1121. /// <summary>
  1122. /// - Light 0--+255 Dark
  1123. /// </summary>
  1124. SKIN_OUT_SHDW_COLOR = 135,
  1125. /// <summary>
  1126. /// - No Eyeshadow 0--+255 More Eyeshadow
  1127. /// </summary>
  1128. SKIN_INNER_SHADOW = 136,
  1129. /// <summary>
  1130. /// - No Polish 0--+255 Painted Nails
  1131. /// </summary>
  1132. SKIN_NAIL_POLISH = 137,
  1133. /// <summary>
  1134. /// - Clear 0--+255 Opaque
  1135. /// </summary>
  1136. SKIN_BLUSH_OPACITY = 138,
  1137. /// <summary>
  1138. /// - Light 0--+255 Dark
  1139. /// </summary>
  1140. SKIN_IN_SHDW_COLOR = 139,
  1141. /// <summary>
  1142. /// - Clear 0--+255 Opaque
  1143. /// </summary>
  1144. SKIN_IN_SHDW_OPACITY = 140,
  1145. /// <summary>
  1146. /// - Dark Green 0--+255 Black
  1147. /// </summary>
  1148. SKIN_EYELINER_COLOR = 141,
  1149. /// <summary>
  1150. /// - Pink 0--+255 Black
  1151. /// </summary>
  1152. SKIN_NAIL_POLISH_COLOR = 142,
  1153. /// <summary>
  1154. /// - Sparse 0--+255 Dense
  1155. /// </summary>
  1156. HAIR_EYEBROW_DENSITY = 143,
  1157. /// <summary>
  1158. /// - 5 O'Clock Shadow 0--+255 Bushy Hair
  1159. /// </summary>
  1160. HAIR_HAIR_THICKNESS = 144,
  1161. /// <summary>
  1162. /// Saddle Bags - Less Saddle 0--+255 More Saddle
  1163. /// </summary>
  1164. SHAPE_SADDLEBAGS = 145,
  1165. /// <summary>
  1166. /// Taper Back - Wide Back 0--+255 Narrow Back
  1167. /// </summary>
  1168. HAIR_HAIR_TAPER_BACK = 146,
  1169. /// <summary>
  1170. /// Taper Front - Wide Front 0--+255 Narrow Front
  1171. /// </summary>
  1172. HAIR_HAIR_TAPER_FRONT = 147,
  1173. /// <summary>
  1174. /// - Short Neck 0--+255 Long Neck
  1175. /// </summary>
  1176. SHAPE_NECK_LENGTH = 148,
  1177. /// <summary>
  1178. /// Eyebrow Height - Higher 0--+255 Lower
  1179. /// </summary>
  1180. HAIR_LOWER_EYEBROWS = 149,
  1181. /// <summary>
  1182. /// Lower Bridge - Low 0--+255 High
  1183. /// </summary>
  1184. SHAPE_LOWER_BRIDGE_NOSE = 150,
  1185. /// <summary>
  1186. /// Nostril Division - High 0--+255 Low
  1187. /// </summary>
  1188. SHAPE_LOW_SEPTUM_NOSE = 151,
  1189. /// <summary>
  1190. /// Jaw Angle - Low Jaw 0--+255 High Jaw
  1191. /// </summary>
  1192. SHAPE_JAW_ANGLE = 152,
  1193. /// <summary>
  1194. /// Shear Front - Full Front 0--+255 Sheared Front
  1195. /// </summary>
  1196. HAIR_HAIR_SHEAR_FRONT = 153,
  1197. /// <summary>
  1198. /// - Less Volume 0--+255 More Volume
  1199. /// </summary>
  1200. HAIR_HAIR_VOLUME = 154,
  1201. /// <summary>
  1202. /// Lip Cleft Depth - Shallow 0--+255 Deep
  1203. /// </summary>
  1204. SHAPE_LIP_CLEFT_DEEP = 155,
  1205. /// <summary>
  1206. /// Puffy Eyelids - Flat 0--+255 Puffy
  1207. /// </summary>
  1208. SHAPE_PUFFY_LOWER_LIDS = 156,
  1209. /// <summary>
  1210. /// - Sunken Eyes 0--+255 Bugged Eyes
  1211. /// </summary>
  1212. SHAPE_EYE_DEPTH = 157,
  1213. /// <summary>
  1214. /// - Flat Head 0--+255 Long Head
  1215. /// </summary>
  1216. SHAPE_HEAD_LENGTH = 158,
  1217. /// <summary>
  1218. /// - Less Freckles 0--+255 More Freckles
  1219. /// </summary>
  1220. SKIN_BODY_FRECKLES = 159,
  1221. /// <summary>
  1222. /// - Low 0--+255 High
  1223. /// </summary>
  1224. UNDERSHIRT_COLLAR_BACK = 160,
  1225. JACKET_COLLAR_BACK_161 = 161,
  1226. SHIRT_COLLAR_BACK_162 = 162,
  1227. /// <summary>
  1228. /// - Short Pigtails 0--+255 Long Pigtails
  1229. /// </summary>
  1230. HAIR_PIGTAILS = 163,
  1231. /// <summary>
  1232. /// - Short Ponytail 0--+255 Long Ponytail
  1233. /// </summary>
  1234. HAIR_PONYTAIL = 164,
  1235. /// <summary>
  1236. /// Butt Size - Flat Butt 0--+255 Big Butt
  1237. /// </summary>
  1238. SHAPE_BUTT_SIZE = 165,
  1239. /// <summary>
  1240. /// Ear Tips - Flat 0--+255 Pointy
  1241. /// </summary>
  1242. SHAPE_POINTY_EARS = 166,
  1243. /// <summary>
  1244. /// Lip Ratio - More Upper Lip 0--+255 More Lower Lip
  1245. /// </summary>
  1246. SHAPE_LIP_RATIO = 167,
  1247. SHIRT_SLEEVE_LENGTH_168 = 168,
  1248. /// <summary>
  1249. /// - Short 0--+255 Long
  1250. /// </summary>
  1251. SHIRT_SHIRT_BOTTOM = 169,
  1252. SHIRT_COLLAR_FRONT_170 = 170,
  1253. SHIRT_SHIRT_RED = 171,
  1254. SHIRT_SHIRT_GREEN = 172,
  1255. SHIRT_SHIRT_BLUE = 173,
  1256. PANTS_PANTS_RED = 174,
  1257. PANTS_PANTS_GREEN = 175,
  1258. PANTS_PANTS_BLUE = 176,
  1259. SHOES_SHOES_RED = 177,
  1260. SHOES_SHOES_GREEN = 178,
  1261. /// <summary>
  1262. /// - Low 0--+255 High
  1263. /// </summary>
  1264. PANTS_WAIST_HEIGHT = 179,
  1265. PANTS_PANTS_LENGTH_180 = 180,
  1266. /// <summary>
  1267. /// Pants Fit - Tight Pants 0--+255 Loose Pants
  1268. /// </summary>
  1269. PANTS_LOOSE_LOWER_CLOTHING = 181,
  1270. SHOES_SHOES_BLUE = 182,
  1271. SOCKS_SOCKS_RED = 183,
  1272. SOCKS_SOCKS_GREEN = 184,
  1273. SOCKS_SOCKS_BLUE = 185,
  1274. UNDERSHIRT_UNDERSHIRT_RED = 186,
  1275. UNDERSHIRT_UNDERSHIRT_GREEN = 187,
  1276. UNDERSHIRT_UNDERSHIRT_BLUE = 188,
  1277. UNDERPANTS_UNDERPANTS_RED = 189,
  1278. UNDERPANTS_UNDERPANTS_GREEN = 190,
  1279. UNDERPANTS_UNDERPANTS_BLUE = 191,
  1280. GLOVES_GLOVES_RED = 192,
  1281. /// <summary>
  1282. /// Shirt Fit - Tight Shirt 0--+255 Loose Shirt
  1283. /// </summary>
  1284. SHIRT_LOOSE_UPPER_CLOTHING = 193,
  1285. GLOVES_GLOVES_GREEN = 194,
  1286. GLOVES_GLOVES_BLUE = 195,
  1287. JACKET_JACKET_RED = 196,
  1288. JACKET_JACKET_GREEN = 197,
  1289. JACKET_JACKET_BLUE = 198,
  1290. /// <summary>
  1291. /// Sleeve Looseness - Tight Sleeves 0--+255 Loose Sleeves
  1292. /// </summary>
  1293. SHIRT_SHIRTSLEEVE_FLAIR = 199,
  1294. /// <summary>
  1295. /// Knee Angle - Knock Kneed 0--+255 Bow Legged
  1296. /// </summary>
  1297. SHAPE_BOWED_LEGS = 200,
  1298. /// <summary>
  1299. /// - Short hips 0--+255 Long Hips
  1300. /// </summary>
  1301. SHAPE_HIP_LENGTH = 201,
  1302. /// <summary>
  1303. /// - Fingerless 0--+255 Fingers
  1304. /// </summary>
  1305. GLOVES_GLOVE_FINGERS = 202,
  1306. /// <summary>
  1307. /// bustle skirt - no bustle 0--+255 more bustle
  1308. /// </summary>
  1309. SKIRT_SKIRT_BUSTLE = 203,
  1310. /// <summary>
  1311. /// - Short 0--+255 Long
  1312. /// </summary>
  1313. SKIRT_SKIRT_LENGTH = 204,
  1314. /// <summary>
  1315. /// - Open Front 0--+255 Closed Front
  1316. /// </summary>
  1317. SKIRT_SLIT_FRONT = 205,
  1318. /// <summary>
  1319. /// - Open Back 0--+255 Closed Back
  1320. /// </summary>
  1321. SKIRT_SLIT_BACK = 206,
  1322. /// <summary>
  1323. /// - Open Left 0--+255 Closed Left
  1324. /// </summary>
  1325. SKIRT_SLIT_LEFT = 207,
  1326. /// <summary>
  1327. /// - Open Right 0--+255 Closed Right
  1328. /// </summary>
  1329. SKIRT_SLIT_RIGHT = 208,
  1330. /// <summary>
  1331. /// Skirt Fit - Tight Skirt 0--+255 Poofy Skirt
  1332. /// </summary>
  1333. SKIRT_SKIRT_LOOSENESS = 209,
  1334. SHIRT_SHIRT_WRINKLES = 210,
  1335. PANTS_PANTS_WRINKLES = 211,
  1336. /// <summary>
  1337. /// Jacket Wrinkles - No Wrinkles 0--+255 Wrinkles
  1338. /// </summary>
  1339. JACKET_JACKET_WRINKLES = 212,
  1340. /// <summary>
  1341. /// Package - Coin Purse 0--+255 Duffle Bag
  1342. /// </summary>
  1343. SHAPE_MALE_PACKAGE = 213,
  1344. /// <summary>
  1345. /// Inner Eye Corner - Corner Down 0--+255 Corner Up
  1346. /// </summary>
  1347. SHAPE_EYELID_INNER_CORNER_UP = 214,
  1348. SKIRT_SKIRT_RED = 215,
  1349. SKIRT_SKIRT_GREEN = 216,
  1350. SKIRT_SKIRT_BLUE = 217
  1351. }
  1352. #endregion
  1353. }
  1354. }