llavatarappearancedefines.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. /**
  2. * @file llavatarappearancedefines.cpp
  3. * @brief Implementation of LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewergpl$
  6. *
  7. * Copyright (c) 2001-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #include "linden_common.h"
  33. #include "llavatarappearancedefines.h"
  34. #include "indra_constants.h"
  35. // Initialized in LLAgent::init(), before we need it !
  36. LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* gAvatarAppDictp = NULL;
  37. using namespace LLAvatarAppearanceDefines;
  38. /******************************************************************************
  39. * Edit this function to add/remove/change textures and mesh definitions for
  40. * avatars.
  41. */
  42. LLAvatarAppearanceDictionary::Textures::Textures()
  43. {
  44. addEntry(TEX_HEAD_BODYPAINT, new TextureEntry("head_bodypaint", true, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN));
  45. addEntry(TEX_UPPER_SHIRT, new TextureEntry("upper_shirt", true, BAKED_NUM_INDICES, "UIImgDefaultShirtUUID", LLWearableType::WT_SHIRT));
  46. addEntry(TEX_LOWER_PANTS, new TextureEntry("lower_pants", true, BAKED_NUM_INDICES, "UIImgDefaultPantsUUID", LLWearableType::WT_PANTS));
  47. addEntry(TEX_EYES_IRIS, new TextureEntry("eyes_iris", true, BAKED_NUM_INDICES, "UIImgDefaultEyesUUID", LLWearableType::WT_EYES));
  48. addEntry(TEX_HAIR, new TextureEntry("hair_grain", true, BAKED_NUM_INDICES, "UIImgDefaultHairUUID", LLWearableType::WT_HAIR));
  49. addEntry(TEX_UPPER_BODYPAINT, new TextureEntry("upper_bodypaint", true, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN));
  50. addEntry(TEX_LOWER_BODYPAINT, new TextureEntry("lower_bodypaint", true, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN));
  51. addEntry(TEX_LOWER_SHOES, new TextureEntry("lower_shoes", true, BAKED_NUM_INDICES, "UIImgDefaultShoesUUID", LLWearableType::WT_SHOES));
  52. addEntry(TEX_LOWER_SOCKS, new TextureEntry("lower_socks", true, BAKED_NUM_INDICES, "UIImgDefaultSocksUUID", LLWearableType::WT_SOCKS));
  53. addEntry(TEX_UPPER_JACKET, new TextureEntry("upper_jacket", true, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", LLWearableType::WT_JACKET));
  54. addEntry(TEX_LOWER_JACKET, new TextureEntry("lower_jacket", true, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", LLWearableType::WT_JACKET));
  55. addEntry(TEX_UPPER_GLOVES, new TextureEntry("upper_gloves", true, BAKED_NUM_INDICES, "UIImgDefaultGlovesUUID", LLWearableType::WT_GLOVES));
  56. addEntry(TEX_UPPER_UNDERSHIRT, new TextureEntry("upper_undershirt", true, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERSHIRT));
  57. addEntry(TEX_LOWER_UNDERPANTS, new TextureEntry("lower_underpants", true, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERPANTS));
  58. addEntry(TEX_SKIRT, new TextureEntry("skirt", true, BAKED_NUM_INDICES, "UIImgDefaultSkirtUUID", LLWearableType::WT_SKIRT));
  59. addEntry(TEX_LOWER_ALPHA, new TextureEntry("lower_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
  60. addEntry(TEX_UPPER_ALPHA, new TextureEntry("upper_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
  61. addEntry(TEX_HEAD_ALPHA, new TextureEntry("head_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
  62. addEntry(TEX_EYES_ALPHA, new TextureEntry("eyes_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
  63. addEntry(TEX_HAIR_ALPHA, new TextureEntry("hair_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
  64. addEntry(TEX_HEAD_TATTOO, new TextureEntry("head_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
  65. addEntry(TEX_UPPER_TATTOO, new TextureEntry("upper_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
  66. addEntry(TEX_LOWER_TATTOO, new TextureEntry("lower_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
  67. addEntry(TEX_HEAD_UNIVERSAL_TATTOO, new TextureEntry("head_universal_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
  68. addEntry(TEX_UPPER_UNIVERSAL_TATTOO, new TextureEntry("upper_universal_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
  69. addEntry(TEX_LOWER_UNIVERSAL_TATTOO, new TextureEntry("lower_universal_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
  70. addEntry(TEX_SKIRT_TATTOO, new TextureEntry("skirt_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
  71. addEntry(TEX_HAIR_TATTOO, new TextureEntry("hair_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
  72. addEntry(TEX_EYES_TATTOO, new TextureEntry("eyes_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
  73. addEntry(TEX_LEFT_ARM_TATTOO, new TextureEntry("leftarm_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
  74. addEntry(TEX_LEFT_LEG_TATTOO, new TextureEntry("leftleg_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
  75. addEntry(TEX_AUX1_TATTOO, new TextureEntry("aux1_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
  76. addEntry(TEX_AUX2_TATTOO, new TextureEntry("aux2_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
  77. addEntry(TEX_AUX3_TATTOO, new TextureEntry("aux3_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
  78. addEntry(TEX_HEAD_BAKED, new TextureEntry("head-baked", false, BAKED_HEAD, "head"));
  79. addEntry(TEX_UPPER_BAKED, new TextureEntry("upper-baked", false, BAKED_UPPER, "upper"));
  80. addEntry(TEX_LOWER_BAKED, new TextureEntry("lower-baked", false, BAKED_LOWER, "lower"));
  81. addEntry(TEX_EYES_BAKED, new TextureEntry("eyes-baked", false, BAKED_EYES, "eyes"));
  82. addEntry(TEX_HAIR_BAKED, new TextureEntry("hair-baked", false, BAKED_HAIR, "hair"));
  83. addEntry(TEX_SKIRT_BAKED, new TextureEntry("skirt-baked", false, BAKED_SKIRT, "skirt"));
  84. addEntry(TEX_LEFT_ARM_BAKED, new TextureEntry("leftarm-baked", false, BAKED_LEFT_ARM, "leftarm"));
  85. addEntry(TEX_LEFT_LEG_BAKED, new TextureEntry("leftleg-baked", false, BAKED_LEFT_LEG, "leftleg"));
  86. addEntry(TEX_AUX1_BAKED, new TextureEntry("aux1-baked", false, BAKED_AUX1, "aux1"));
  87. addEntry(TEX_AUX2_BAKED, new TextureEntry("aux2-baked", false, BAKED_AUX2, "aux2"));
  88. addEntry(TEX_AUX3_BAKED, new TextureEntry("aux3-baked", false, BAKED_AUX3, "aux3"));
  89. }
  90. LLAvatarAppearanceDictionary::BakedTextures::BakedTextures()
  91. {
  92. // Baked textures
  93. addEntry(BAKED_HEAD,
  94. new BakedEntry(TEX_HEAD_BAKED, "head",
  95. "a4b9dc38-e13b-4df9-b284-751efb0566ff",
  96. 4, TEX_HEAD_BODYPAINT,
  97. TEX_HEAD_TATTOO,
  98. TEX_HEAD_ALPHA,
  99. TEX_HEAD_UNIVERSAL_TATTOO,
  100. 6, LLWearableType::WT_SHAPE,
  101. LLWearableType::WT_SKIN,
  102. LLWearableType::WT_HAIR,
  103. LLWearableType::WT_TATTOO,
  104. LLWearableType::WT_ALPHA,
  105. LLWearableType::WT_UNIVERSAL));
  106. addEntry(BAKED_UPPER,
  107. new BakedEntry(TEX_UPPER_BAKED, "upper_body",
  108. "5943ff64-d26c-4a90-a8c0-d61f56bd98d4",
  109. 8, TEX_UPPER_SHIRT,
  110. TEX_UPPER_BODYPAINT,
  111. TEX_UPPER_JACKET,
  112. TEX_UPPER_GLOVES,
  113. TEX_UPPER_UNDERSHIRT,
  114. TEX_UPPER_TATTOO,
  115. TEX_UPPER_ALPHA,
  116. TEX_UPPER_UNIVERSAL_TATTOO,
  117. 9, LLWearableType::WT_SHAPE,
  118. LLWearableType::WT_SKIN,
  119. LLWearableType::WT_SHIRT,
  120. LLWearableType::WT_JACKET,
  121. LLWearableType::WT_GLOVES,
  122. LLWearableType::WT_UNDERSHIRT,
  123. LLWearableType::WT_TATTOO,
  124. LLWearableType::WT_ALPHA,
  125. LLWearableType::WT_UNIVERSAL));
  126. addEntry(BAKED_LOWER,
  127. new BakedEntry(TEX_LOWER_BAKED, "lower_body",
  128. "2944ee70-90a7-425d-a5fb-d749c782ed7d",
  129. 9, TEX_LOWER_PANTS,
  130. TEX_LOWER_BODYPAINT,
  131. TEX_LOWER_SHOES,
  132. TEX_LOWER_SOCKS,
  133. TEX_LOWER_JACKET,
  134. TEX_LOWER_UNDERPANTS,
  135. TEX_LOWER_TATTOO,
  136. TEX_LOWER_ALPHA,
  137. TEX_LOWER_UNIVERSAL_TATTOO,
  138. 10, LLWearableType::WT_SHAPE,
  139. LLWearableType::WT_SKIN,
  140. LLWearableType::WT_PANTS,
  141. LLWearableType::WT_SHOES,
  142. LLWearableType::WT_SOCKS,
  143. LLWearableType::WT_JACKET,
  144. LLWearableType::WT_UNDERPANTS,
  145. LLWearableType::WT_TATTOO,
  146. LLWearableType::WT_ALPHA,
  147. LLWearableType::WT_UNIVERSAL));
  148. addEntry(BAKED_EYES,
  149. new BakedEntry(TEX_EYES_BAKED, "eyes",
  150. "27b1bc0f-979f-4b13-95fe-b981c2ba9788",
  151. 3, TEX_EYES_IRIS,
  152. TEX_EYES_TATTOO,
  153. TEX_EYES_ALPHA,
  154. 3, LLWearableType::WT_EYES,
  155. LLWearableType::WT_UNIVERSAL,
  156. LLWearableType::WT_ALPHA));
  157. addEntry(BAKED_SKIRT,
  158. new BakedEntry(TEX_SKIRT_BAKED, "skirt",
  159. "03e7e8cb-1368-483b-b6f3-74850838ba63",
  160. 2, TEX_SKIRT,
  161. TEX_SKIRT_TATTOO,
  162. 2, LLWearableType::WT_SKIRT,
  163. LLWearableType::WT_UNIVERSAL));
  164. addEntry(BAKED_HAIR,
  165. new BakedEntry(TEX_HAIR_BAKED, "hair",
  166. "a60e85a9-74e8-48d8-8a2d-8129f28d9b61",
  167. 3, TEX_HAIR,
  168. TEX_HAIR_TATTOO,
  169. TEX_HAIR_ALPHA,
  170. 3, LLWearableType::WT_HAIR,
  171. LLWearableType::WT_UNIVERSAL,
  172. LLWearableType::WT_ALPHA));
  173. addEntry(BAKED_LEFT_ARM,
  174. new BakedEntry(TEX_LEFT_ARM_BAKED, "leftarm",
  175. "9f39febf-22d7-0087-79d1-e9e8c6c9ed19",
  176. 1, TEX_LEFT_ARM_TATTOO,
  177. 1, LLWearableType::WT_UNIVERSAL));
  178. addEntry(BAKED_LEFT_LEG,
  179. new BakedEntry(TEX_LEFT_LEG_BAKED, "leftleg",
  180. "054a7a58-8ed5-6386-0add-3b636fb28b78",
  181. 1, TEX_LEFT_LEG_TATTOO,
  182. 1, LLWearableType::WT_UNIVERSAL));
  183. addEntry(BAKED_AUX1,
  184. new BakedEntry(TEX_AUX1_BAKED, "aux1",
  185. "790c11be-b25c-c17e-b4d2-6a4ad786b752",
  186. 1, TEX_AUX1_TATTOO,
  187. 1, LLWearableType::WT_UNIVERSAL));
  188. addEntry(BAKED_AUX2,
  189. new BakedEntry(TEX_AUX2_BAKED, "aux2",
  190. "d78c478f-48c7-5928-5864-8d99fb1f521e",
  191. 1, TEX_AUX2_TATTOO,
  192. 1, LLWearableType::WT_UNIVERSAL));
  193. addEntry(BAKED_AUX3,
  194. new BakedEntry(TEX_AUX3_BAKED, "aux3",
  195. "6a95dd53-edd9-aac8-f6d3-27ed99f3c3eb",
  196. 1, TEX_AUX3_TATTOO,
  197. 1, LLWearableType::WT_UNIVERSAL));
  198. }
  199. LLAvatarAppearanceDictionary::MeshEntries::MeshEntries()
  200. {
  201. // MeshEntries
  202. addEntry(MESH_ID_HAIR, new MeshEntry(BAKED_HAIR, "hairMesh", 6, PN_4));
  203. addEntry(MESH_ID_HEAD, new MeshEntry(BAKED_HEAD, "headMesh", 5, PN_5));
  204. addEntry(MESH_ID_EYELASH, new MeshEntry(BAKED_HEAD, "eyelashMesh", 1, PN_0)); // no baked mesh associated currently
  205. addEntry(MESH_ID_UPPER_BODY, new MeshEntry(BAKED_UPPER, "upperBodyMesh", 5, PN_1));
  206. addEntry(MESH_ID_LOWER_BODY, new MeshEntry(BAKED_LOWER, "lowerBodyMesh", 5, PN_2));
  207. addEntry(MESH_ID_EYEBALL_LEFT, new MeshEntry(BAKED_EYES, "eyeBallLeftMesh", 2, PN_3));
  208. addEntry(MESH_ID_EYEBALL_RIGHT, new MeshEntry(BAKED_EYES, "eyeBallRightMesh", 2, PN_3));
  209. addEntry(MESH_ID_SKIRT, new MeshEntry(BAKED_SKIRT, "skirtMesh", 5, PN_5));
  210. }
  211. /*
  212. *
  213. *****************************************************************************/
  214. LLAvatarAppearanceDictionary::LLAvatarAppearanceDictionary()
  215. {
  216. createAssociations();
  217. }
  218. LLAvatarAppearanceDictionary::~LLAvatarAppearanceDictionary()
  219. {
  220. gAvatarAppDictp = NULL;
  221. }
  222. // Baked textures are composites of textures; for each such composited texture,
  223. // map it to the baked texture.
  224. void LLAvatarAppearanceDictionary::createAssociations()
  225. {
  226. for (BakedTextures::const_iterator iter = mBakedTextures.begin(),
  227. end = mBakedTextures.end();
  228. iter != end; ++iter)
  229. {
  230. const EBakedTextureIndex baked_index = iter->first;
  231. const BakedEntry* dict = iter->second;
  232. // For each texture that this baked texture index affects, associate
  233. // those textures with this baked texture index.
  234. for (texture_vec_t::const_iterator
  235. local_texture_iter = dict->mLocalTextures.begin(),
  236. local_texture_end = dict->mLocalTextures.end();
  237. local_texture_iter != local_texture_end; ++local_texture_iter)
  238. {
  239. const ETextureIndex local_texture_index = (ETextureIndex)*local_texture_iter;
  240. mTextures[local_texture_index]->mIsUsedByBakedTexture = true;
  241. mTextures[local_texture_index]->mBakedTextureIndex = baked_index;
  242. }
  243. }
  244. }
  245. LLAvatarAppearanceDictionary::TextureEntry::TextureEntry(const std::string &name,
  246. bool is_local_texture,
  247. EBakedTextureIndex baked_texture_index,
  248. const std::string& default_image_name,
  249. LLWearableType::EType wearable_type)
  250. : LLDictionaryEntry(name),
  251. mIsLocalTexture(is_local_texture),
  252. mIsBakedTexture(!is_local_texture),
  253. mIsUsedByBakedTexture(baked_texture_index != BAKED_NUM_INDICES),
  254. mBakedTextureIndex(baked_texture_index),
  255. mDefaultImageName(default_image_name),
  256. mWearableType(wearable_type)
  257. {
  258. }
  259. LLAvatarAppearanceDictionary::MeshEntry::MeshEntry(EBakedTextureIndex baked_index,
  260. const std::string& name,
  261. U8 level,
  262. LLJointPickName pick)
  263. : LLDictionaryEntry(name),
  264. mBakedID(baked_index),
  265. mLOD(level),
  266. mPickName(pick)
  267. {
  268. }
  269. LLAvatarAppearanceDictionary::BakedEntry::BakedEntry(ETextureIndex tex_index,
  270. const std::string& name,
  271. const std::string& hash_name,
  272. U32 num_local_textures,
  273. ... )
  274. : LLDictionaryEntry(name),
  275. mWearablesHashID(LLUUID(hash_name)),
  276. mTextureIndex(tex_index)
  277. {
  278. va_list argp;
  279. va_start(argp, num_local_textures);
  280. // Read in local textures
  281. for (U8 i = 0; i < num_local_textures; ++i)
  282. {
  283. ETextureIndex t = (ETextureIndex)va_arg(argp, int);
  284. mLocalTextures.push_back(t);
  285. }
  286. // Read in number of wearables
  287. const U32 num_wearables = (U32)va_arg(argp, int);
  288. // Read in wearables
  289. for (U8 i = 0; i < num_wearables; ++i)
  290. {
  291. LLWearableType::EType t = (LLWearableType::EType)va_arg(argp, int);
  292. mWearables.push_back(t);
  293. }
  294. va_end(argp);
  295. }
  296. //static
  297. ETextureIndex LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(EBakedTextureIndex index)
  298. {
  299. return gAvatarAppDictp->getBakedTexture(index)->mTextureIndex;
  300. }
  301. //static
  302. EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(const std::string& name)
  303. {
  304. for (U8 index = 0; index < BAKED_NUM_INDICES; ++index)
  305. {
  306. const BakedEntry* be =
  307. gAvatarAppDictp->getBakedTexture((EBakedTextureIndex)index);
  308. if (be && be->mName.compare(name) == 0)
  309. {
  310. // baked texture found
  311. return (EBakedTextureIndex)index;
  312. }
  313. }
  314. // baked texture could not be found
  315. return BAKED_NUM_INDICES;
  316. }
  317. //static
  318. EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(const std::string& name)
  319. {
  320. for (U8 index = 0; index < BAKED_NUM_INDICES; ++index)
  321. {
  322. const BakedEntry* be =
  323. gAvatarAppDictp->getBakedTexture((EBakedTextureIndex)index);
  324. if (be)
  325. {
  326. const TextureEntry* te =
  327. gAvatarAppDictp->getTexture(be->mTextureIndex);
  328. if (te && te->mDefaultImageName.compare(name) == 0)
  329. {
  330. // baked texture found
  331. return (EBakedTextureIndex)index;
  332. }
  333. }
  334. }
  335. // Baked texture could not be found
  336. return BAKED_NUM_INDICES;
  337. }
  338. //static
  339. LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIndex index)
  340. {
  341. const TextureEntry* te = gAvatarAppDictp->getTexture(index);
  342. return te ? te->mWearableType : LLWearableType::WT_NONE;
  343. }
  344. //static
  345. bool LLAvatarAppearanceDictionary::isBakedImageId(const LLUUID& id)
  346. {
  347. return id == IMG_USE_BAKED_HAIR || id == IMG_USE_BAKED_EYES ||
  348. id == IMG_USE_BAKED_HEAD || id == IMG_USE_BAKED_UPPER ||
  349. id == IMG_USE_BAKED_LOWER ||
  350. id == IMG_USE_BAKED_LEFTARM || id == IMG_USE_BAKED_LEFTLEG ||
  351. id == IMG_USE_BAKED_AUX1 || id == IMG_USE_BAKED_AUX2 ||
  352. id == IMG_USE_BAKED_AUX3 ||
  353. id == IMG_USE_BAKED_SKIRT;
  354. }
  355. //static
  356. EBakedTextureIndex LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(const LLUUID& id)
  357. {
  358. if (id == IMG_USE_BAKED_HEAD)
  359. {
  360. return BAKED_HEAD;
  361. }
  362. if (id == IMG_USE_BAKED_UPPER)
  363. {
  364. return BAKED_UPPER;
  365. }
  366. if (id == IMG_USE_BAKED_LOWER)
  367. {
  368. return BAKED_LOWER;
  369. }
  370. if (id == IMG_USE_BAKED_HAIR)
  371. {
  372. return BAKED_HAIR;
  373. }
  374. if (id == IMG_USE_BAKED_EYES)
  375. {
  376. return BAKED_EYES;
  377. }
  378. if (id == IMG_USE_BAKED_SKIRT)
  379. {
  380. return BAKED_SKIRT;
  381. }
  382. if (id == IMG_USE_BAKED_LEFTARM)
  383. {
  384. return BAKED_LEFT_ARM;
  385. }
  386. if (id == IMG_USE_BAKED_LEFTLEG)
  387. {
  388. return BAKED_LEFT_LEG;
  389. }
  390. if (id == IMG_USE_BAKED_AUX1)
  391. {
  392. return BAKED_AUX1;
  393. }
  394. if (id == IMG_USE_BAKED_AUX2)
  395. {
  396. return BAKED_AUX2;
  397. }
  398. if (id == IMG_USE_BAKED_AUX3)
  399. {
  400. return BAKED_AUX3;
  401. }
  402. return BAKED_NUM_INDICES;
  403. }
  404. #if 0 // Not used
  405. //static
  406. const LLUUID& LLAvatarAppearanceDictionary::localTextureIndexToMagicId(ETextureIndex t)
  407. {
  408. if (t == LLAvatarAppearanceDefines::TEX_HEAD_BAKED)
  409. {
  410. return IMG_USE_BAKED_HEAD;
  411. }
  412. if (t == LLAvatarAppearanceDefines::TEX_UPPER_BAKED)
  413. {
  414. return IMG_USE_BAKED_UPPER;
  415. }
  416. if (t == LLAvatarAppearanceDefines::TEX_LOWER_BAKED)
  417. {
  418. return IMG_USE_BAKED_LOWER;
  419. }
  420. if (t == LLAvatarAppearanceDefines::TEX_HAIR_BAKED)
  421. {
  422. return IMG_USE_BAKED_HAIR;
  423. }
  424. if (t == LLAvatarAppearanceDefines::TEX_EYES_BAKED)
  425. {
  426. return IMG_USE_BAKED_EYES;
  427. }
  428. if (t == LLAvatarAppearanceDefines::TEX_SKIRT_BAKED)
  429. {
  430. return IMG_USE_BAKED_SKIRT;
  431. }
  432. if (t == LLAvatarAppearanceDefines::TEX_LEFT_ARM_BAKED)
  433. {
  434. return IMG_USE_BAKED_LEFTARM;
  435. }
  436. if (t == LLAvatarAppearanceDefines::TEX_LEFT_LEG_BAKED)
  437. {
  438. return IMG_USE_BAKED_LEFTLEG;
  439. }
  440. if (t == LLAvatarAppearanceDefines::TEX_AUX1_BAKED)
  441. {
  442. return IMG_USE_BAKED_AUX1;
  443. }
  444. if (t == LLAvatarAppearanceDefines::TEX_AUX2_BAKED)
  445. {
  446. return IMG_USE_BAKED_AUX2;
  447. }
  448. if (t == LLAvatarAppearanceDefines::TEX_AUX3_BAKED)
  449. {
  450. return IMG_USE_BAKED_AUX3;
  451. }
  452. return LLUUID::null;
  453. }
  454. #endif