AvatarAppearance.cs 60 KB

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