AvatarAppearance.cs 59 KB

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