AvatarAppearance.cs 50 KB

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