1
0

AvatarAppearance.cs 53 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. protected float m_hipOffset = 0;
  52. public virtual int Serial
  53. {
  54. get { return m_serial; }
  55. set { m_serial = value; }
  56. }
  57. public virtual byte[] VisualParams
  58. {
  59. get { return m_visualparams; }
  60. set { m_visualparams = value; }
  61. }
  62. public virtual Primitive.TextureEntry Texture
  63. {
  64. get { return m_texture; }
  65. set
  66. {
  67. // m_log.DebugFormat("[AVATAR APPEARANCE]: Set TextureEntry to {0}", value);
  68. m_texture = value;
  69. }
  70. }
  71. public virtual AvatarWearable[] Wearables
  72. {
  73. get { return m_wearables; }
  74. set { m_wearables = value; }
  75. }
  76. public virtual float AvatarHeight
  77. {
  78. get { return m_avatarHeight; }
  79. set { m_avatarHeight = value; }
  80. }
  81. public virtual float HipOffset
  82. {
  83. get { return m_hipOffset; }
  84. }
  85. public AvatarAppearance()
  86. {
  87. // m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance");
  88. m_serial = 0;
  89. SetDefaultWearables();
  90. SetDefaultTexture();
  91. SetDefaultParams();
  92. SetHeight();
  93. m_attachments = new Dictionary<int, List<AvatarAttachment>>();
  94. }
  95. public AvatarAppearance(OSDMap map)
  96. {
  97. // m_log.WarnFormat("[AVATAR APPEARANCE]: create appearance from OSDMap");
  98. Unpack(map);
  99. SetHeight();
  100. }
  101. public AvatarAppearance(AvatarWearable[] wearables, Primitive.TextureEntry textureEntry, byte[] visualParams)
  102. {
  103. // m_log.WarnFormat("[AVATAR APPEARANCE] create initialized appearance");
  104. m_serial = 0;
  105. if (wearables != null)
  106. m_wearables = wearables;
  107. else
  108. SetDefaultWearables();
  109. if (textureEntry != null)
  110. m_texture = textureEntry;
  111. else
  112. SetDefaultTexture();
  113. if (visualParams != null)
  114. m_visualparams = visualParams;
  115. else
  116. SetDefaultParams();
  117. SetHeight();
  118. m_attachments = new Dictionary<int, List<AvatarAttachment>>();
  119. }
  120. public AvatarAppearance(AvatarAppearance appearance) : this(appearance, true)
  121. {
  122. }
  123. public AvatarAppearance(AvatarAppearance appearance, bool copyWearables)
  124. {
  125. // m_log.WarnFormat("[AVATAR APPEARANCE] create from an existing appearance");
  126. if (appearance == null)
  127. {
  128. m_serial = 0;
  129. SetDefaultWearables();
  130. SetDefaultTexture();
  131. SetDefaultParams();
  132. SetHeight();
  133. m_attachments = new Dictionary<int, List<AvatarAttachment>>();
  134. return;
  135. }
  136. m_serial = appearance.Serial;
  137. m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES];
  138. for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
  139. m_wearables[i] = new AvatarWearable();
  140. if (copyWearables && (appearance.Wearables != null))
  141. {
  142. for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
  143. SetWearable(i,appearance.Wearables[i]);
  144. }
  145. m_texture = null;
  146. if (appearance.Texture != null)
  147. {
  148. byte[] tbytes = appearance.Texture.GetBytes();
  149. m_texture = new Primitive.TextureEntry(tbytes,0,tbytes.Length);
  150. }
  151. m_visualparams = null;
  152. if (appearance.VisualParams != null)
  153. m_visualparams = (byte[])appearance.VisualParams.Clone();
  154. m_avatarHeight = appearance.m_avatarHeight;
  155. m_hipOffset = appearance.m_hipOffset;
  156. // Copy the attachment, force append mode since that ensures consistency
  157. m_attachments = new Dictionary<int, List<AvatarAttachment>>();
  158. foreach (AvatarAttachment attachment in appearance.GetAttachments())
  159. AppendAttachment(new AvatarAttachment(attachment));
  160. }
  161. public void GetAssetsFrom(AvatarAppearance app)
  162. {
  163. for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
  164. {
  165. for (int j = 0; j < m_wearables[i].Count; j++)
  166. {
  167. UUID itemID = m_wearables[i][j].ItemID;
  168. UUID assetID = app.Wearables[i].GetAsset(itemID);
  169. if (assetID != UUID.Zero)
  170. m_wearables[i].Add(itemID, assetID);
  171. }
  172. }
  173. }
  174. public void ClearWearables()
  175. {
  176. m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES];
  177. for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
  178. m_wearables[i] = new AvatarWearable();
  179. }
  180. protected virtual void SetDefaultWearables()
  181. {
  182. m_wearables = AvatarWearable.DefaultWearables;
  183. }
  184. /// <summary>
  185. /// Invalidate all of the baked textures in the appearance, useful
  186. /// if you know that none are valid
  187. /// </summary>
  188. public virtual void ResetAppearance()
  189. {
  190. m_serial = 0;
  191. SetDefaultTexture();
  192. //for (int i = 0; i < BAKE_INDICES.Length; i++)
  193. // {
  194. // int idx = BAKE_INDICES[i];
  195. // m_texture.FaceTextures[idx].TextureID = UUID.Zero;
  196. // }
  197. }
  198. protected virtual void SetDefaultParams()
  199. {
  200. 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 };
  201. // for (int i = 0; i < VISUALPARAM_COUNT; i++)
  202. // {
  203. // m_visualparams[i] = 150;
  204. // }
  205. }
  206. protected virtual void SetDefaultTexture()
  207. {
  208. m_texture = new Primitive.TextureEntry(new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE));
  209. // for (uint i = 0; i < TEXTURE_COUNT; i++)
  210. // m_texture.CreateFace(i).TextureID = new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE);
  211. }
  212. /// <summary>
  213. /// Set up appearance textures.
  214. /// Returns boolean that indicates whether the new entries actually change the
  215. /// existing values.
  216. /// </summary>
  217. public virtual bool SetTextureEntries(Primitive.TextureEntry textureEntry)
  218. {
  219. if (textureEntry == null)
  220. return false;
  221. // There are much simpler versions of this copy that could be
  222. // made. We determine if any of the textures actually
  223. // changed to know if the appearance should be saved later
  224. bool changed = false;
  225. for (uint i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++)
  226. {
  227. Primitive.TextureEntryFace newface = textureEntry.FaceTextures[i];
  228. Primitive.TextureEntryFace oldface = m_texture.FaceTextures[i];
  229. if (newface == null)
  230. {
  231. if (oldface == null) continue;
  232. }
  233. else
  234. {
  235. if (oldface != null && oldface.TextureID == newface.TextureID) continue;
  236. }
  237. changed = true;
  238. }
  239. m_texture = textureEntry;
  240. return changed;
  241. }
  242. /// <summary>
  243. /// Set up visual parameters for the avatar and refresh the avatar height
  244. /// Returns boolean that indicates whether the new entries actually change the
  245. /// existing values.
  246. /// </summary>
  247. public virtual bool SetVisualParams(byte[] visualParams)
  248. {
  249. if (visualParams == null)
  250. return false;
  251. // There are much simpler versions of this copy that could be
  252. // made. We determine if any of the visual parameters actually
  253. // changed to know if the appearance should be saved later
  254. bool changed = false;
  255. for (int i = 0; i < AvatarAppearance.VISUALPARAM_COUNT; i++)
  256. {
  257. if (visualParams[i] != m_visualparams[i])
  258. {
  259. // DEBUG ON
  260. // m_log.WarnFormat("[AVATARAPPEARANCE] vparams changed [{0}] {1} ==> {2}",
  261. // i,m_visualparams[i],visualParams[i]);
  262. // DEBUG OFF
  263. m_visualparams[i] = visualParams[i];
  264. changed = true;
  265. }
  266. }
  267. // Reset the height if the visual parameters actually changed
  268. if (changed)
  269. SetHeight();
  270. return changed;
  271. }
  272. public virtual void SetAppearance(Primitive.TextureEntry textureEntry, byte[] visualParams)
  273. {
  274. SetTextureEntries(textureEntry);
  275. SetVisualParams(visualParams);
  276. }
  277. public virtual void SetHeight()
  278. {
  279. m_avatarHeight = 1.23077f // Shortest possible avatar height
  280. + 0.516945f * (float)m_visualparams[(int)VPElement.SHAPE_HEIGHT] / 255.0f // Body height
  281. + 0.072514f * (float)m_visualparams[(int)VPElement.SHAPE_HEAD_SIZE] / 255.0f // Head size
  282. + 0.3836f * (float)m_visualparams[(int)VPElement.SHAPE_LEG_LENGTH] / 255.0f // Leg length
  283. + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f // Shoe platform height
  284. + 0.07f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f // Shoe heel height
  285. + 0.076f * (float)m_visualparams[(int)VPElement.SHAPE_NECK_LENGTH] / 255.0f; // Neck length
  286. m_hipOffset = (((1.23077f // Half of avatar
  287. + 0.516945f * (float)m_visualparams[(int)VPElement.SHAPE_HEIGHT] / 255.0f // Body height
  288. + 0.3836f * (float)m_visualparams[(int)VPElement.SHAPE_LEG_LENGTH] / 255.0f // Leg length
  289. + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f // Shoe platform height
  290. + 0.07f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f // Shoe heel height
  291. ) / 2) - m_avatarHeight / 2) * 0.31f - 0.0425f;
  292. }
  293. public virtual void SetWearable(int wearableId, AvatarWearable wearable)
  294. {
  295. // DEBUG ON
  296. // m_log.WarnFormat("[AVATARAPPEARANCE] set wearable {0} --> {1}:{2}",wearableId,wearable.ItemID,wearable.AssetID);
  297. // DEBUG OFF
  298. m_wearables[wearableId].Clear();
  299. for (int i = 0; i < wearable.Count; i++)
  300. m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID);
  301. }
  302. // DEBUG ON
  303. public override String ToString()
  304. {
  305. String s = "";
  306. s += String.Format("Serial: {0}\n",m_serial);
  307. for (uint i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++)
  308. if (m_texture.FaceTextures[i] != null)
  309. s += String.Format("Texture: {0} --> {1}\n",i,m_texture.FaceTextures[i].TextureID);
  310. foreach (AvatarWearable awear in m_wearables)
  311. {
  312. for (int i = 0; i < awear.Count; i++)
  313. s += String.Format("Wearable: item={0}, asset={1}\n",awear[i].ItemID,awear[i].AssetID);
  314. }
  315. s += "Visual Params: ";
  316. for (uint j = 0; j < AvatarAppearance.VISUALPARAM_COUNT; j++)
  317. s += String.Format("{0},",m_visualparams[j]);
  318. s += "\n";
  319. return s;
  320. }
  321. // DEBUG OFF
  322. /// <summary>
  323. /// Get a list of the attachments.
  324. /// </summary>
  325. /// <remarks>
  326. /// There may be duplicate attachpoints
  327. /// </remarks>
  328. public List<AvatarAttachment> GetAttachments()
  329. {
  330. List<AvatarAttachment> alist = new List<AvatarAttachment>();
  331. lock (m_attachments)
  332. {
  333. foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments)
  334. {
  335. foreach (AvatarAttachment attach in kvp.Value)
  336. alist.Add(new AvatarAttachment(attach));
  337. }
  338. }
  339. return alist;
  340. }
  341. internal void AppendAttachment(AvatarAttachment attach)
  342. {
  343. // m_log.DebugFormat(
  344. // "[AVATAR APPEARNCE]: Appending itemID={0}, assetID={1} at {2}",
  345. // attach.ItemID, attach.AssetID, attach.AttachPoint);
  346. lock (m_attachments)
  347. {
  348. if (!m_attachments.ContainsKey(attach.AttachPoint))
  349. m_attachments[attach.AttachPoint] = new List<AvatarAttachment>();
  350. m_attachments[attach.AttachPoint].Add(attach);
  351. }
  352. }
  353. internal void ReplaceAttachment(AvatarAttachment attach)
  354. {
  355. // m_log.DebugFormat(
  356. // "[AVATAR APPEARANCE]: Replacing itemID={0}, assetID={1} at {2}",
  357. // attach.ItemID, attach.AssetID, attach.AttachPoint);
  358. lock (m_attachments)
  359. {
  360. m_attachments[attach.AttachPoint] = new List<AvatarAttachment>();
  361. m_attachments[attach.AttachPoint].Add(attach);
  362. }
  363. }
  364. /// <summary>
  365. /// Set an attachment
  366. /// </summary>
  367. /// <remarks>
  368. /// If the attachpoint has the
  369. /// 0x80 bit set then we assume this is an append
  370. /// operation otherwise we replace whatever is
  371. /// currently attached at the attachpoint
  372. /// </remarks>
  373. /// <param name="attachpoint"></param>
  374. /// <param name="item">If UUID.Zero, then an any attachment at the attachpoint is removed.</param>
  375. /// <param name="asset"></param>
  376. /// <returns>
  377. /// return true if something actually changed
  378. /// </returns>
  379. public bool SetAttachment(int attachpoint, UUID item, UUID asset)
  380. {
  381. // m_log.DebugFormat(
  382. // "[AVATAR APPEARANCE]: Setting attachment at {0} with item ID {1}, asset ID {2}",
  383. // attachpoint, item, asset);
  384. if (attachpoint == 0)
  385. return false;
  386. if (item == UUID.Zero)
  387. {
  388. lock (m_attachments)
  389. {
  390. if (m_attachments.ContainsKey(attachpoint))
  391. {
  392. m_attachments.Remove(attachpoint);
  393. return true;
  394. }
  395. }
  396. return false;
  397. }
  398. // When a user logs in, the attachment item ids are pulled from persistence in the Avatars table. However,
  399. // the asset ids are not saved. When the avatar enters a simulator the attachments are set again. If
  400. // we simply perform an item check here then the asset ids (which are now present) are never set, and NPC attachments
  401. // later fail unless the attachment is detached and reattached.
  402. //
  403. // Therefore, we will carry on with the set if the existing attachment has no asset id.
  404. AvatarAttachment existingAttachment = GetAttachmentForItem(item);
  405. if (existingAttachment != null
  406. && existingAttachment.AssetID != UUID.Zero
  407. && existingAttachment.AttachPoint == (attachpoint & 0x7F))
  408. {
  409. // m_log.DebugFormat("[AVATAR APPEARANCE] attempt to attach an already attached item {0}",item);
  410. return false;
  411. }
  412. // check if this is an append or a replace, 0x80 marks it as an append
  413. if ((attachpoint & 0x80) > 0)
  414. {
  415. // strip the append bit
  416. int point = attachpoint & 0x7F;
  417. AppendAttachment(new AvatarAttachment(point, item, asset));
  418. }
  419. else
  420. {
  421. ReplaceAttachment(new AvatarAttachment(attachpoint,item, asset));
  422. }
  423. return true;
  424. }
  425. /// <summary>
  426. /// If the item is already attached, return it.
  427. /// </summary>
  428. /// <param name="itemID"></param>
  429. /// <returns>Returns null if this item is not attached.</returns>
  430. public AvatarAttachment GetAttachmentForItem(UUID itemID)
  431. {
  432. lock (m_attachments)
  433. {
  434. foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments)
  435. {
  436. int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; });
  437. if (index >= 0)
  438. return kvp.Value[index];
  439. }
  440. }
  441. return null;
  442. }
  443. public int GetAttachpoint(UUID itemID)
  444. {
  445. lock (m_attachments)
  446. {
  447. foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments)
  448. {
  449. int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; });
  450. if (index >= 0)
  451. return kvp.Key;
  452. }
  453. }
  454. return 0;
  455. }
  456. public bool DetachAttachment(UUID itemID)
  457. {
  458. lock (m_attachments)
  459. {
  460. foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments)
  461. {
  462. int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; });
  463. if (index >= 0)
  464. {
  465. // Remove it from the list of attachments at that attach point
  466. m_attachments[kvp.Key].RemoveAt(index);
  467. // And remove the list if there are no more attachments here
  468. if (m_attachments[kvp.Key].Count == 0)
  469. m_attachments.Remove(kvp.Key);
  470. return true;
  471. }
  472. }
  473. }
  474. return false;
  475. }
  476. public void ClearAttachments()
  477. {
  478. lock (m_attachments)
  479. m_attachments.Clear();
  480. }
  481. #region Packing Functions
  482. /// <summary>
  483. /// Create an OSDMap from the appearance data
  484. /// </summary>
  485. public OSDMap Pack()
  486. {
  487. OSDMap data = new OSDMap();
  488. data["serial"] = OSD.FromInteger(m_serial);
  489. data["height"] = OSD.FromReal(m_avatarHeight);
  490. data["hipoffset"] = OSD.FromReal(m_hipOffset);
  491. // Wearables
  492. OSDArray wears = new OSDArray(AvatarWearable.MAX_WEARABLES);
  493. for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
  494. wears.Add(m_wearables[i].Pack());
  495. data["wearables"] = wears;
  496. // Avatar Textures
  497. OSDArray textures = new OSDArray(AvatarAppearance.TEXTURE_COUNT);
  498. for (uint i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++)
  499. {
  500. if (m_texture.FaceTextures[i] != null)
  501. textures.Add(OSD.FromUUID(m_texture.FaceTextures[i].TextureID));
  502. else
  503. textures.Add(OSD.FromUUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE));
  504. }
  505. data["textures"] = textures;
  506. // Visual Parameters
  507. OSDBinary visualparams = new OSDBinary(m_visualparams);
  508. data["visualparams"] = visualparams;
  509. // Attachments
  510. List<AvatarAttachment> attachments = GetAttachments();
  511. OSDArray attachs = new OSDArray(attachments.Count);
  512. foreach (AvatarAttachment attach in GetAttachments())
  513. attachs.Add(attach.Pack());
  514. data["attachments"] = attachs;
  515. return data;
  516. }
  517. /// <summary>
  518. /// Unpack and OSDMap and initialize the appearance
  519. /// from it
  520. /// </summary>
  521. public void Unpack(OSDMap data)
  522. {
  523. if ((data != null) && (data["serial"] != null))
  524. m_serial = data["serial"].AsInteger();
  525. if ((data != null) && (data["height"] != null))
  526. m_avatarHeight = (float)data["height"].AsReal();
  527. if ((data != null) && (data["hipoffset"] != null))
  528. m_hipOffset = (float)data["hipoffset"].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. }