AvatarAppearance.cs 52 KB

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