AvatarAppearance.cs 52 KB

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