diff options
author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2010-06-24 17:21:18 -0400 |
---|---|---|
committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2010-06-24 17:21:18 -0400 |
commit | f89bbd3baa6dd87b0477a240e7cde09c6aed3293 (patch) | |
tree | 9a7a3dea0d4e55f2fa3ec70321a1fcfdeb9e4045 | |
parent | 8f892d0f36fda170a5cecf0aea89887d6d0e45ef (diff) |
EXT-7838 FIX - viewer 2.1 avatars look ruth-shaped to viewer-2 users
Added a third visual param group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT
to specify visual params that are user-tweakable, but should not be sent
over the network.
We should have this group *only* for new user-tweakable visual parameters
that should not be sent over the network. These should only be used for
*new* parameters that only contribute to the generation of baked textures.
Code reviewed by Richard
-rw-r--r-- | indra/llcharacter/llcharacter.cpp | 2 | ||||
-rw-r--r-- | indra/llcharacter/llvisualparam.cpp | 4 | ||||
-rw-r--r-- | indra/llcharacter/llvisualparam.h | 2 | ||||
-rw-r--r-- | indra/newview/character/avatar_lad.xml | 6 | ||||
-rw-r--r-- | indra/newview/llagent.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llpaneleditwearable.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llwearable.cpp | 8 |
8 files changed, 21 insertions, 19 deletions
diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp index 27c0c0b640..11665aff76 100644 --- a/indra/llcharacter/llcharacter.cpp +++ b/indra/llcharacter/llcharacter.cpp @@ -381,7 +381,7 @@ void LLCharacter::clearVisualParamWeights() param; param = getNextVisualParam()) { - if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) + if (param->isTweakable()) { param->setWeight( param->getDefaultWeight(), FALSE ); } diff --git a/indra/llcharacter/llvisualparam.cpp b/indra/llcharacter/llvisualparam.cpp index 703fe2f9cc..122406e20b 100644 --- a/indra/llcharacter/llvisualparam.cpp +++ b/indra/llcharacter/llvisualparam.cpp @@ -261,7 +261,7 @@ void LLVisualParam::setAnimationTarget(F32 target_value, BOOL upload_bake) if (mInfo) { - if (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) + if (isTweakable()) { mTargetWeight = llclamp(target_value, mInfo->mMinWeight, mInfo->mMaxWeight); } @@ -305,7 +305,7 @@ void LLVisualParam::animate( F32 delta, BOOL upload_bake ) //----------------------------------------------------------------------------- void LLVisualParam::stopAnimating(BOOL upload_bake) { - if (mIsAnimating && getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) + if (mIsAnimating && isTweakable()) { mIsAnimating = FALSE; setWeight(mTargetWeight, upload_bake); diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h index 12b45e6ebe..20ee5fd7ec 100644 --- a/indra/llcharacter/llvisualparam.h +++ b/indra/llcharacter/llvisualparam.h @@ -52,6 +52,7 @@ enum EVisualParamGroup { VISUAL_PARAM_GROUP_TWEAKABLE, VISUAL_PARAM_GROUP_ANIMATABLE, + VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT, NUM_VISUAL_PARAM_GROUPS }; @@ -144,6 +145,7 @@ public: F32 getCurrentWeight() const { return mCurWeight; } F32 getLastWeight() const { return mLastWeight; } BOOL isAnimating() const { return mIsAnimating; } + BOOL isTweakable() const { return (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) || (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT); } LLVisualParam* getNextParam() { return mNext; } void setNextParam( LLVisualParam *next ); diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 9564236ad2..a9b4ff02c5 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -11533,7 +11533,7 @@ render_pass="bump"> <param id="1071" - group="0" + group="2" wearable="tattoo" edit_group="colorpicker" name="tattoo_red" @@ -11566,7 +11566,7 @@ render_pass="bump"> <param id="1072" - group="0" + group="2" wearable="tattoo" edit_group="colorpicker" name="tattoo_green" @@ -11599,7 +11599,7 @@ render_pass="bump"> <param id="1073" - group="0" + group="2" wearable="tattoo" edit_group="colorpicker" name="tattoo_blue" diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 217fb0f988..345953f2e9 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3627,7 +3627,7 @@ void LLAgent::sendAgentSetAppearance() param; param = (LLViewerVisualParam*)gAgentAvatarp->getNextVisualParam()) { - if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) + if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) // do not transmit params of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT { msg->nextBlockFast(_PREHASH_VisualParam ); diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index ae54909945..642cb07bb4 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1302,8 +1302,8 @@ void LLPanelEditWearable::getSortedParams(value_map_t &sorted_params, const std: { LLViewerVisualParam *param = (LLViewerVisualParam*) *iter; - if (param->getID() == -1 - || param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE + if (param->getID() == -1 + || !param->isTweakable() || param->getEditGroup() != edit_group || !(param->getSex() & avatar_sex)) { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3dce4ce0bc..6e220cac39 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2528,7 +2528,7 @@ void LLVOAvatar::idleUpdateAppearanceAnimation() param; param = getNextVisualParam()) { - if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) + if (param->isTweakable()) { param->stopAnimating(FALSE); } @@ -2551,7 +2551,7 @@ void LLVOAvatar::idleUpdateAppearanceAnimation() param; param = getNextVisualParam()) { - if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) + if (param->isTweakable()) { param->animate(morph_amt, FALSE); } @@ -6703,7 +6703,7 @@ bool LLVOAvatar::visualParamWeightsAreDefault() param; param = getNextVisualParam()) { - if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) + if (param->isTweakable()) { LLViewerVisualParam* vparam = dynamic_cast<LLViewerVisualParam*>(param); llassert(vparam); @@ -6813,7 +6813,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { for( S32 i = 0; i < num_blocks; i++ ) { - while( param && (param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) ) + while( param && (param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT { param = getNextVisualParam(); } @@ -6846,7 +6846,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } } - const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE); + 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) { llinfos << "Number of params in AvatarAppearance msg (" << num_blocks << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << llendl; @@ -7133,7 +7133,7 @@ void LLVOAvatar::dumpArchetypeXML( void* ) { LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; if( (viewer_param->getWearableType() == type) && - (viewer_param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) ) + (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()); diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index 46c736c853..2eb233ddd9 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -483,7 +483,7 @@ BOOL LLWearable::isOldVersion() const param; param = (LLViewerVisualParam*) gAgentAvatarp->getNextVisualParam() ) { - if( (param->getWearableType() == mType) && (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE ) ) + if( (param->getWearableType() == mType) && (param->isTweakable() ) ) { param_count++; if( !is_in_map(mVisualParamIndexMap, param->getID() ) ) @@ -534,7 +534,7 @@ BOOL LLWearable::isDirty() const param = (LLViewerVisualParam*) gAgentAvatarp->getNextVisualParam() ) { if( (param->getWearableType() == mType) - && (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE ) + && (param->isTweakable() ) && !param->getCrossWearable()) { F32 current_weight = getVisualParamWeight(param->getID()); @@ -588,7 +588,7 @@ void LLWearable::setParamsToDefaults() for( LLVisualParam* param = gAgentAvatarp->getFirstVisualParam(); param; param = gAgentAvatarp->getNextVisualParam() ) { - if( (((LLViewerVisualParam*)param)->getWearableType() == mType ) && (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE ) ) + if( (((LLViewerVisualParam*)param)->getWearableType() == mType ) && (param->isTweakable() ) ) { setVisualParamWeight(param->getID(),param->getDefaultWeight(), FALSE); } @@ -692,7 +692,7 @@ void LLWearable::removeFromAvatar( LLWearableType::EType type, BOOL upload_bake // Pull params for( LLVisualParam* param = gAgentAvatarp->getFirstVisualParam(); param; param = gAgentAvatarp->getNextVisualParam() ) { - if( (((LLViewerVisualParam*)param)->getWearableType() == type) && (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE ) ) + if( (((LLViewerVisualParam*)param)->getWearableType() == type) && (param->isTweakable() ) ) { S32 param_id = param->getID(); gAgentAvatarp->setVisualParamWeight( param_id, param->getDefaultWeight(), upload_bake ); |