From 201d9853f9d57efab9b819ff07745141a5265e98 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 5 Sep 2012 18:25:51 -0400 Subject: Debug display for baked vs. composite status, via setting DebugAvatarCompositeBaked --- indra/newview/llvoavatar.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 4894f21e67..d92caf1edb 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5763,7 +5763,7 @@ BOOL LLVOAvatar::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; @@ -6503,7 +6503,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL LLColor4 color = mTexHairColor->getColor(); for (U32 i = 0; i < mBakedTextureDatas[BAKED_HAIR].mMeshes.size(); i++) { - mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setColor( color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW] ); + mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setColor( color ); } } } @@ -6764,6 +6764,10 @@ void LLVOAvatar::updateMeshTextures() for (U32 k=0; k < mBakedTextureDatas[i].mMeshes.size(); k++) { mBakedTextureDatas[i].mMeshes[k]->setTexture( baked_img ); + if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) + { + mBakedTextureDatas[i].mMeshes[k]->setColor(LLColor4::red); + } } } else if (!mUseLocalAppearance && is_layer_baked[i]) @@ -6794,6 +6798,10 @@ void LLVOAvatar::updateMeshTextures() for (U32 k=0; k < mBakedTextureDatas[i].mMeshes.size(); k++) { mBakedTextureDatas[i].mMeshes[k]->setLayerSet( mBakedTextureDatas[i].mTexLayerSet ); + if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) + { + mBakedTextureDatas[i].mMeshes[k]->setColor( LLColor4::yellow ); + } } } } @@ -6807,7 +6815,7 @@ void LLVOAvatar::updateMeshTextures() LLViewerTexture* hair_img = getImage( TEX_HAIR, 0 ); for (U32 i = 0; i < mBakedTextureDatas[BAKED_HAIR].mMeshes.size(); i++) { - mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setColor( color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW] ); + mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setColor( color ); mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setTexture( hair_img ); } } @@ -7721,6 +7729,10 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) for (U32 k = 0; k < mBakedTextureDatas[i].mMeshes.size(); k++) { mBakedTextureDatas[i].mMeshes[k]->setTexture( image_baked ); + if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) + { + mBakedTextureDatas[i].mMeshes[k]->setColor( LLColor4::green ); + } } if (mBakedTextureDatas[i].mTexLayerSet) { @@ -7741,7 +7753,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) { for (U32 i = 0; i < mBakedTextureDatas[BAKED_HAIR].mMeshes.size(); i++) { - mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setColor( 1.f, 1.f, 1.f, 1.f ); + mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setColor( LLColor4::white ); } } } -- cgit v1.2.3 From 2b2fd9e97526d10b0b4d34154cc0a46f957acba7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 7 Sep 2012 17:48:09 -0400 Subject: enhanced XML archetype dumping, added to per-avatar menus --- indra/newview/llvoavatar.cpp | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d92caf1edb..39ad8fc8d6 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -36,6 +36,7 @@ #include #include +#include #include "llaudioengine.h" #include "noise.h" @@ -7762,11 +7763,35 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) dirtyMesh(); } -// static -void LLVOAvatar::dumpArchetypeXML( void* ) +void LLVOAvatar::dumpArchetypeXML(const std::string& filename ) { + std::string outfilename(filename); + if (outfilename.empty()) + { + std::string fullname = getFullname(); + if (!fullname.empty()) + { + typedef std::map file_num_type; + static file_num_type file_nums; + file_num_type::iterator it = file_nums.find(fullname); + S32 num = 0; + if (it != file_nums.end()) + { + num = it->second; + } + std::ostringstream temp; + temp << std::setw(4) << std::setfill('0') << num; + file_nums[fullname] = num+1; + outfilename = fullname + " " + temp.str() + ".xml"; + } + } + if (outfilename.empty()) + { + outfilename = std::string("new archetype.xml"); + } + 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) { @@ -7782,12 +7807,12 @@ void LLVOAvatar::dumpArchetypeXML( void* ) apr_file_printf( file, "\n\t\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\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) && @@ -7803,7 +7828,7 @@ void LLVOAvatar::dumpArchetypeXML( void* ) if (LLVOAvatarDictionary::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; -- cgit v1.2.3 From 6504894be60134a66c938ffba64b57ea198c7264 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 10 Sep 2012 11:17:27 -0400 Subject: more baked texture debugging under DebugAvatarCompositeBaked --- indra/newview/llvoavatar.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d92caf1edb..3b98a55360 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6804,6 +6804,16 @@ void LLVOAvatar::updateMeshTextures() } } } + else + { + for (U32 k=0; k < mBakedTextureDatas[i].mMeshes.size(); k++) + { + if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) + { + mBakedTextureDatas[i].mMeshes[k]->setColor( LLColor4::blue ); + } + } + } } // set texture and color of hair manually if we are not using a baked image. -- cgit v1.2.3 From fc84d684500c2216aa270bffef865ee265927535 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 10 Sep 2012 18:46:52 -0400 Subject: dumpArchetypeXML tweaks, appearance debugging --- indra/newview/llvoavatar.cpp | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e03c0c3dad..61816c1771 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7337,6 +7337,7 @@ bool LLVOAvatar::visualParamWeightsAreDefault() //----------------------------------------------------------------------------- void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { + dumpArchetypeXML("process_start"); if (gSavedSettings.getBOOL("BlockAvatarAppearanceMessages")) { llwarns << "Blocking AvatarAppearance message" << llendl; @@ -7773,32 +7774,30 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) dirtyMesh(); } -void LLVOAvatar::dumpArchetypeXML(const std::string& filename ) +void LLVOAvatar::dumpArchetypeXML(const std::string& prefix ) { - std::string outfilename(filename); - if (outfilename.empty()) + std::string outprefix(prefix); + if (outprefix.empty()) { - std::string fullname = getFullname(); - if (!fullname.empty()) - { - typedef std::map file_num_type; - static file_num_type file_nums; - file_num_type::iterator it = file_nums.find(fullname); - S32 num = 0; - if (it != file_nums.end()) - { - num = it->second; - } - std::ostringstream temp; - temp << std::setw(4) << std::setfill('0') << num; - file_nums[fullname] = num+1; - outfilename = fullname + " " + temp.str() + ".xml"; - } + outprefix = getFullname(); + } + if (outprefix.empty()) + { + outprefix = std::string("new_archetype"); } - if (outfilename.empty()) + typedef std::map 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()) { - outfilename = std::string("new archetype.xml"); + 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,outfilename), LL_APR_WB ); -- cgit v1.2.3 From b4866775a2acc98ebcb3986d7779eea479028ff9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 11 Sep 2012 20:57:04 -0400 Subject: Dump XML tweaks, suppress wearable updates when bakes should dominate --- indra/newview/llvoavatar.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 61816c1771..96e59dd9eb 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7361,7 +7361,9 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) // llinfos << "processAvatarAppearance end " << mID << llendl; return; } + clearVisualParamWeights(); } + dumpArchetypeXML("process_post_clear"); ESex old_sex = getSex(); @@ -7481,6 +7483,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) { @@ -7545,6 +7549,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) updateMeshTextures(); + dumpArchetypeXML("process_end"); // llinfos << "processAvatarAppearance end " << mID << llendl; } -- cgit v1.2.3