AvatarAppearance.cs 53 KB

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