diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-09-19 13:16:59 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-09-19 13:16:59 -0400 |
commit | 47403abc3e1787c81707df0fe8852e46d156953c (patch) | |
tree | 61c97dcb2a15894e37b91e0c055cc7fe7f785cfa /indra/newview/llvoavatar.cpp | |
parent | 7b75bd089834a84ab5062c96870edeee6fa22861 (diff) |
work in progress, more debugging/logging of avatar visual param info
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 1b185ed508..5ccd2d206d 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -48,6 +48,7 @@ #include "llcallingcard.h" // IDEVO for LLAvatarTracker #include "lldrawpoolavatar.h" #include "lldriverparam.h" +#include "llpolyskeletaldistortion.h" #include "lleditingmotion.h" #include "llemote.h" //#include "llfirstuse.h" @@ -191,8 +192,7 @@ enum ERenderName // Utility func - FIXME move out of avatar. std::string get_sequential_numbered_file_name(const std::string& prefix, - const std::string& suffix, - const S32 width = 4); + const std::string& suffix); //----------------------------------------------------------------------------- // Callback data @@ -6277,6 +6277,24 @@ bool LLVOAvatar::visualParamWeightsAreDefault() return rtn; } +void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value) +{ + std::string type_string = "unknown"; + if (dynamic_cast<LLTexLayerParamAlpha*>(viewer_param)) + type_string = "param_alpha"; + if (dynamic_cast<LLTexLayerParamColor*>(viewer_param)) + type_string = "param_color"; + if (dynamic_cast<LLDriverParam*>(viewer_param)) + type_string = "param_driver"; + if (dynamic_cast<LLPolyMorphTarget*>(viewer_param)) + type_string = "param_morph"; + if (dynamic_cast<LLPolySkeletalDistortion*>(viewer_param)) + type_string = "param_skeleton"; + apr_file_printf(file, "\t\t<param id=\"%d\" name=\"%s\" value=\"%.3f\"/ type=\"%s\">\n", + viewer_param->getID(), viewer_param->getName().c_str(), value, type_string.c_str()); +} + + void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, const std::vector<F32>& params_for_dump, const LLTEContents& tec) @@ -6306,8 +6324,7 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, } LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; F32 value = params_for_dump[i]; - apr_file_printf(file, "\t\t<param id=\"%d\" name=\"%s\" value=\"%.3f\"/>\n", - viewer_param->getID(), viewer_param->getName().c_str(), value); + dump_visual_param(file, viewer_param, value); param = getNextVisualParam(); } for (U32 i = 0; i < tec.face_count; i++) @@ -6323,14 +6340,14 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, //----------------------------------------------------------------------------- void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { - //std::string dump_prefix = getFullname() + " "; - //dumpArchetypeXML(dump_prefix + "process_start"); + bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); + std::string dump_prefix = getFullname() + "_" + (isSelf()?"s":"o") + "_"; + if (enable_verbose_dumps) { dumpArchetypeXML(dump_prefix + "process_start"); } if (gSavedSettings.getBOOL("BlockAvatarAppearanceMessages")) { llwarns << "Blocking AvatarAppearance message" << llendl; return; } - LLMemType mt(LLMemType::MTYPE_AVATAR); BOOL is_first_appearance_message = !mFirstAppearanceMessageReceived; @@ -6349,8 +6366,6 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) return; } } - clearVisualParamWeights(); - //dumpArchetypeXML(dump_prefix + "process_post_clear"); ESex old_sex = getSex(); @@ -6470,12 +6485,11 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } param = getNextVisualParam(); } - //dumpAppearanceMsgParams(dump_prefix + "appearance_msg", - // params_for_dump, - // tec); + if (enable_verbose_dumps) + dumpAppearanceMsgParams(dump_prefix + "appearance_msg", params_for_dump, tec); } - //dumpArchetypeXML(dump_prefix + "process_post_set_weights"); + if (enable_verbose_dumps) { dumpArchetypeXML(dump_prefix + "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) @@ -6541,7 +6555,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) updateMeshTextures(); - //dumpArchetypeXML(dump_prefix + "process_end"); + if (enable_verbose_dumps) dumpArchetypeXML(dump_prefix + "process_end"); // llinfos << "processAvatarAppearance end " << mID << llendl; } @@ -6784,8 +6798,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) } std::string get_sequential_numbered_file_name(const std::string& prefix, - const std::string& suffix, - const S32 width) + const std::string& suffix) { typedef std::map<std::string,S32> file_num_type; static file_num_type file_nums; @@ -6795,10 +6808,8 @@ std::string get_sequential_numbered_file_name(const std::string& prefix, { num = it->second; } - std::ostringstream temp; - temp << std::setw(width) << std::setfill('0') << num; file_nums[prefix] = num+1; - std::string outfilename = prefix + " " + temp.str() + ".xml"; + std::string outfilename = prefix + " " + llformat("%04d",num) + ".xml"; std::replace(outfilename.begin(),outfilename.end(),' ','_'); return outfilename; } @@ -6808,7 +6819,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara std::string outprefix(prefix); if (outprefix.empty()) { - outprefix = getFullname(); + outprefix = getFullname() + (isSelf()?"_s":"_o"); } if (outprefix.empty()) { @@ -6846,8 +6857,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara if( (viewer_param->getWearableType() == type) && (viewer_param->isTweakable() ) ) { - apr_file_printf(file, "\t\t<param id=\"%d\" name=\"%s\" value=\"%.3f\"/>\n", - viewer_param->getID(), viewer_param->getName().c_str(), viewer_param->getWeight()); + dump_visual_param(file, viewer_param, viewer_param->getWeight()); } } @@ -6873,10 +6883,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) { LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; - { - apr_file_printf(file, "\t\t<param id=\"%d\" name=\"%s\" value=\"%.3f\"/>\n", - viewer_param->getID(), viewer_param->getName().c_str(), viewer_param->getWeight()); - } + dump_visual_param(file, viewer_param, viewer_param->getWeight()); } for (U8 te = 0; te < TEX_NUM_INDICES; te++) |