AvatarAppearance.cs 59 KB

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