diff options
author | Don Kjer <don@lindenlab.com> | 2012-09-13 22:14:53 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2012-09-13 22:14:53 +0000 |
commit | 5bb8962c4e2e1ca12d637fcddc02a78f5ecf7225 (patch) | |
tree | ce95886fb4163fccef9df045bfe6b0088de4ffc8 | |
parent | 8ba2b388769e245ec1b49b7d6d4b0372d684ff86 (diff) | |
parent | b4866775a2acc98ebcb3986d7779eea479028ff9 (diff) |
Merge sunshine -> sunshine-experimental
-rw-r--r-- | indra/llappearance/llavatarappearance.cpp | 2 | ||||
-rwxr-xr-x | indra/llappearance/llavatarjointmesh.cpp | 5 | ||||
-rwxr-xr-x | indra/llappearance/llavatarjointmesh.h | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llappearance/llwearable.cpp | 0 | ||||
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 11 | ||||
-rwxr-xr-x | indra/newview/llviewermenu.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llviewerwearable.cpp | 9 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 75 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.h | 4 | ||||
-rwxr-xr-x | indra/newview/llvoavatarself.cpp | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/skins/default/xui/en/menu_attachment_other.xml | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/skins/default/xui/en/menu_attachment_self.xml | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/skins/default/xui/en/menu_avatar_other.xml | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/skins/default/xui/en/menu_avatar_self.xml | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml | 8 |
16 files changed, 162 insertions, 12 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 824f0a1e32..8677a1daff 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -1046,7 +1046,7 @@ BOOL LLAvatarAppearance::loadMeshNodes() // If this isn't set to white (1.0), avatars will *ALWAYS* be darker than their surroundings. // Do not touch!!! - mesh->setColor( 1.0f, 1.0f, 1.0f, 1.0f ); + mesh->setColor( LLColor4::white ); LLPolyMesh *poly_mesh = NULL; diff --git a/indra/llappearance/llavatarjointmesh.cpp b/indra/llappearance/llavatarjointmesh.cpp index d39587defe..c611ab7cec 100755 --- a/indra/llappearance/llavatarjointmesh.cpp +++ b/indra/llappearance/llavatarjointmesh.cpp @@ -208,6 +208,11 @@ void LLAvatarJointMesh::setColor( F32 red, F32 green, F32 blue, F32 alpha ) mColor[3] = alpha; } +void LLAvatarJointMesh::setColor( const LLColor4& color ) +{ + mColor = color; +} + //-------------------------------------------------------------------- // LLAvatarJointMesh::getTexture() diff --git a/indra/llappearance/llavatarjointmesh.h b/indra/llappearance/llavatarjointmesh.h index 427375e733..2aade4d62b 100755 --- a/indra/llappearance/llavatarjointmesh.h +++ b/indra/llappearance/llavatarjointmesh.h @@ -101,6 +101,7 @@ public: // Sets the shape color void setColor( F32 red, F32 green, F32 blue, F32 alpha ); + void setColor( const LLColor4& color ); // Sets the shininess void setSpecular( const LLColor4& color, F32 shiny ) { /*mSpecular = color;*/ mShiny = shiny; }; diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 9e73a6669a..9e73a6669a 100644..100755 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 69986af83b..674685f3bc 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1949,6 +1949,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>DebugAvatarCompositeBaked</key> + <map> + <key>Comment</key> + <string>Colorize avatar meshes based on baked/composite state.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>DebugBeaconLineWidth</key> <map> <key>Comment</key> diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index f660d883b3..cbd1ac692f 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1596,11 +1596,26 @@ class LLAdvancedEnableGrabBakedTexture : public view_listener_t /////////////////////// +class LLAdvancedEnableAppearanceToXML : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + return gSavedSettings.getBOOL("DebugAvatarCompositeBaked"); + } +}; + class LLAdvancedAppearanceToXML : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLVOAvatar::dumpArchetypeXML(NULL); + std::string emptyname; + LLVOAvatar* avatar = + find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); + if (!avatar) + { + avatar = gAgentAvatarp; + } + avatar->dumpArchetypeXML(emptyname); return true; } }; @@ -8452,6 +8467,7 @@ void initialize_menus() // Advanced > Character > Character Tests view_listener_t::addMenu(new LLAdvancedAppearanceToXML(), "Advanced.AppearanceToXML"); + view_listener_t::addMenu(new LLAdvancedEnableAppearanceToXML(), "Advanced.EnableAppearanceToXML"); view_listener_t::addMenu(new LLAdvancedToggleCharacterGeometry(), "Advanced.ToggleCharacterGeometry"); view_listener_t::addMenu(new LLAdvancedTestMale(), "Advanced.TestMale"); diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index 8fe3aff0b0..e9fa92e8be 100644 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -320,6 +320,15 @@ void LLViewerWearable::writeToAvatar(LLAvatarAppearance *avatarp) if (!avatarp || !viewer_avatar) return; + if (!viewer_avatar->isValid()) return; + +#if 1 + if (!viewer_avatar->isUsingLocalAppearance()) + { + return; + } +#endif + ESex old_sex = avatarp->getSex(); LLWearable::writeToAvatar(avatarp); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0d16d039da..467c77f9db 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -30,6 +30,7 @@ #include <stdio.h> #include <ctype.h> +#include <sstream> #include "llaudioengine.h" #include "noise.h" @@ -5568,7 +5569,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL LLAvatarJointMesh* mesh = (*iter); if (mesh) { - mesh->setColor( color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW] ); + mesh->setColor( color ); } } } @@ -5838,6 +5839,10 @@ void LLVOAvatar::updateMeshTextures() if (mesh) { mesh->setTexture( baked_img ); + if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) + { + mesh->setColor(LLColor4::red); + } } } } @@ -5874,6 +5879,26 @@ void LLVOAvatar::updateMeshTextures() if (mesh) { mesh->setLayerSet( layerset ); + if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) + { + mesh->setColor( LLColor4::yellow ); + } + } + } + } + else + { + if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) + { + avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin(); + avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end(); + for (; iter != end; ++iter) + { + LLAvatarJointMesh* mesh = (*iter); + if (mesh) + { + mesh->setColor( LLColor4::blue ); + } } } } @@ -5893,7 +5918,7 @@ void LLVOAvatar::updateMeshTextures() LLAvatarJointMesh* mesh = (*iter); if (mesh) { - mesh->setColor( color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW] ); + mesh->setColor( color ); mesh->setTexture( hair_img ); } } @@ -6252,6 +6277,7 @@ bool LLVOAvatar::visualParamWeightsAreDefault() //----------------------------------------------------------------------------- void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { + dumpArchetypeXML("process_start"); if (gSavedSettings.getBOOL("BlockAvatarAppearanceMessages")) { llwarns << "Blocking AvatarAppearance message" << llendl; @@ -6275,7 +6301,9 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) // llinfos << "processAvatarAppearance end " << mID << llendl; return; } + clearVisualParamWeights(); } + dumpArchetypeXML("process_post_clear"); ESex old_sex = getSex(); @@ -6395,6 +6423,8 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } } + dumpArchetypeXML("process_post_set_weights"); + const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT if (num_blocks != expected_tweakable_count) { @@ -6459,6 +6489,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) updateMeshTextures(); + dumpArchetypeXML("process_end"); // llinfos << "processAvatarAppearance end " << mID << llendl; } @@ -6660,6 +6691,10 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) if (mesh) { mesh->setTexture( image_baked ); + if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) + { + mesh->setColor( LLColor4::green ); + } } } if (mBakedTextureDatas[i].mTexLayerSet) @@ -6686,7 +6721,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) LLAvatarJointMesh* mesh = (*iter); if (mesh) { - mesh->setColor( 1.f, 1.f, 1.f, 1.f ); + mesh->setColor( LLColor4::white ); } } } @@ -6696,11 +6731,33 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) dirtyMesh(); } -// static -void LLVOAvatar::dumpArchetypeXML( void* ) +void LLVOAvatar::dumpArchetypeXML(const std::string& prefix ) { + std::string outprefix(prefix); + if (outprefix.empty()) + { + outprefix = getFullname(); + } + if (outprefix.empty()) + { + outprefix = std::string("new_archetype"); + } + typedef std::map<std::string,S32> file_num_type; + static file_num_type file_nums; + file_num_type::iterator it = file_nums.find(outprefix); + S32 num = 0; + if (it != file_nums.end()) + { + num = it->second; + } + std::ostringstream temp; + temp << std::setw(4) << std::setfill('0') << num; + file_nums[outprefix] = num+1; + std::string outfilename = outprefix + " " + temp.str() + ".xml"; + std::replace(outfilename.begin(),outfilename.end(),' ','_'); + LLAPRFile outfile; - outfile.open(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"new archetype.xml"), LL_APR_WB ); + outfile.open(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,outfilename), LL_APR_WB ); apr_file_t* file = outfile.getFileHandle(); if (!file) { @@ -6716,12 +6773,12 @@ void LLVOAvatar::dumpArchetypeXML( void* ) apr_file_printf( file, "\n\t<archetype name=\"???\">\n" ); // only body parts, not clothing. - for (S32 type = LLWearableType::WT_SHAPE; type <= LLWearableType::WT_EYES; type++) + for (S32 type = LLWearableType::WT_SHAPE; type <= LLWearableType::WT_COUNT; type++) { const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type); apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() ); - for (LLVisualParam* param = gAgentAvatarp->getFirstVisualParam(); param; param = gAgentAvatarp->getNextVisualParam()) + for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) { LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; if( (viewer_param->getWearableType() == type) && @@ -6737,7 +6794,7 @@ void LLVOAvatar::dumpArchetypeXML( void* ) if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type) { // MULTIPLE_WEARABLES: extend to multiple wearables? - LLViewerTexture* te_image = ((LLVOAvatar *)(gAgentAvatarp))->getImage((ETextureIndex)te, 0); + LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); if( te_image ) { std::string uuid_str; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 5335d6fda1..2f81f03cc7 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -636,6 +636,8 @@ public: //-------------------------------------------------------------------- public: BOOL getIsAppearanceAnimating() const { return mAppearanceAnimating; } + BOOL isUsingLocalAppearance() const { return mUseLocalAppearance; } + private: BOOL mAppearanceAnimating; LLFrameTimer mAppearanceMorphTimer; @@ -907,7 +909,7 @@ private: // General //-------------------------------------------------------------------- public: - static void dumpArchetypeXML(void*); + void dumpArchetypeXML(const std::string& prefix); static void dumpBakedStatus(); const std::string getBakedStatusForPrintout() const; void dumpAvatarTEs(const std::string& context) const; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index d0ccde09e8..a29b3ff92b 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2653,6 +2653,7 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch) gAgentCamera.changeCameraToCustomizeAvatar(); } + gAgentAvatarp->clearVisualParamWeights(); gAgentAvatarp->invalidateAll(); gAgentAvatarp->updateMeshTextures(); } diff --git a/indra/newview/skins/default/xui/en/menu_attachment_other.xml b/indra/newview/skins/default/xui/en/menu_attachment_other.xml index b46b62ec4d..46ba4bd29d 100644..100755 --- a/indra/newview/skins/default/xui/en/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_other.xml @@ -79,6 +79,14 @@ <menu_item_call.on_visible function="IsGodCustomerService"/> </menu_item_call> + <menu_item_call + label="Dump XML" + name="Dump XML"> + <menu_item_call.on_click + function="Advanced.AppearanceToXML" /> + <menu_item_call.on_visible + function="Advanced.EnableAppearanceToXML"/> + </menu_item_call> <menu_item_call label="Zoom In" name="Zoom In"> diff --git a/indra/newview/skins/default/xui/en/menu_attachment_self.xml b/indra/newview/skins/default/xui/en/menu_attachment_self.xml index b8128da358..28e032ce5f 100644..100755 --- a/indra/newview/skins/default/xui/en/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_self.xml @@ -123,6 +123,14 @@ name="Edit Outfit"> <menu_item_call.on_visible function="IsGodCustomerService"/> </menu_item_call> + <menu_item_call + label="Dump XML" + name="Dump XML"> + <menu_item_call.on_click + function="Advanced.AppearanceToXML" /> + <menu_item_call.on_visible + function="Advanced.EnableAppearanceToXML"/> + </menu_item_call> <menu_item_separator layout="topleft" /> <menu_item_call diff --git a/indra/newview/skins/default/xui/en/menu_avatar_other.xml b/indra/newview/skins/default/xui/en/menu_avatar_other.xml index 276b5f106f..e7c2b80da2 100644..100755 --- a/indra/newview/skins/default/xui/en/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_other.xml @@ -79,6 +79,14 @@ <menu_item_call.on_visible function="IsGodCustomerService"/> </menu_item_call> + <menu_item_call + label="Dump XML" + name="Dump XML"> + <menu_item_call.on_click + function="Advanced.AppearanceToXML" /> + <menu_item_call.on_visible + function="Advanced.EnableAppearanceToXML"/> + </menu_item_call> <menu_item_call label="Zoom In" name="Zoom In"> diff --git a/indra/newview/skins/default/xui/en/menu_avatar_self.xml b/indra/newview/skins/default/xui/en/menu_avatar_self.xml index d9bdfece38..c1ff026a74 100644..100755 --- a/indra/newview/skins/default/xui/en/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_self.xml @@ -261,4 +261,12 @@ <menu_item_call.on_visible function="IsGodCustomerService"/> </menu_item_call> + <menu_item_call + label="Dump XML" + name="Dump XML"> + <menu_item_call.on_click + function="Advanced.AppearanceToXML" /> + <menu_item_call.on_visible + function="Advanced.EnableAppearanceToXML"/> + </menu_item_call> </context_menu> diff --git a/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml index 76b188220d..354ddc3109 100644..100755 --- a/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml @@ -112,6 +112,14 @@ <menu_item_call.on_visible function="IsGodCustomerService"/> </menu_item_call> + <menu_item_call + label="Dump XML" + name="Dump XML"> + <menu_item_call.on_click + function="Advanced.AppearanceToXML" /> + <menu_item_call.on_visible + function="Advanced.EnableAppearanceToXML"/> + </menu_item_call> <menu_item_call label="Find On Map" name="find_on_map"> diff --git a/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml index 5e7b16ed4a..84815caca9 100644..100755 --- a/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml @@ -249,4 +249,12 @@ <menu_item_call.on_visible function="IsGodCustomerService"/> </menu_item_call> + <menu_item_call + label="Dump XML" + name="Dump XML"> + <menu_item_call.on_click + function="Advanced.AppearanceToXML" /> + <menu_item_call.on_visible + function="Advanced.EnableAppearanceToXML"/> + </menu_item_call> </toggleable_menu> |