diff options
-rw-r--r-- | indra/newview/llvoavatar.cpp | 47 | ||||
-rw-r--r-- | indra/newview/llvoavatar.h | 1 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 7 |
3 files changed, 51 insertions, 4 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a56862718f..12ab8e9964 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2012,6 +2012,42 @@ void LLVOAvatar::resetVisualParams() } } +void LLVOAvatar::applyDefaultParams() +{ + // force params to intermediate vals + S32 num_blocks = 253; + LLVisualParam* param = getFirstVisualParam(); + llassert(param); // if this ever fires, we should do the same as when num_blocks<=1 + if (!param) + { + LL_WARNS() << "No visual params!" << LL_ENDL; + } + else + { + for( S32 i = 0; i < num_blocks; i++ ) + { + while( param && ((param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) && + (param->getGroup() != VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE)) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT + { + param = getNextVisualParam(); + } + + if( !param ) + { + // more visual params supplied than expected - just process what we know about + break; + } + + U8 value = 127; + F32 newWeight = U8_to_F32(value, param->getMinWeight(), param->getMaxWeight()); + param->setWeight(newWeight); + + param = getNextVisualParam(); + } + } + +} + //----------------------------------------------------------------------------- // resetSkeleton() //----------------------------------------------------------------------------- @@ -2082,6 +2118,10 @@ void LLVOAvatar::resetSkeleton(bool reset_animations) applyParsedAppearanceMessage(*mLastProcessedAppearance, slam_params); } } + else + { + applyDefaultParams(); + } updateVisualParams(); // Restore attachment pos overrides @@ -8998,7 +9038,11 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) mLastProcessedAppearance = contents; bool slam_params = false; - applyParsedAppearanceMessage(*contents, slam_params); + applyParsedAppearanceMessage(*contents, slam_params); + if (getOverallAppearance() != AOA_NORMAL) + { + resetSkeleton(false); + } } void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& contents, bool slam_params) @@ -10574,6 +10618,7 @@ void LLVOAvatar::setOverallAppearanceNormal() void LLVOAvatar::setOverallAppearanceJellyDoll() { resetSkeleton(false); + // stop current animations { for ( LLVOAvatar::AnimIterator anim_it= mPlayingAnimations.begin(); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index ee7f3d6dca..28db007d56 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -407,6 +407,7 @@ public: void initAttachmentPoints(bool ignore_hud_joints = false); /*virtual*/ void buildCharacter(); void resetVisualParams(); + void applyDefaultParams(); void resetSkeleton(bool reset_animations); LLVector3 mCurRootToHeadOffset; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 30c2cbeb95..eb8da6e3ce 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3084,9 +3084,10 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) if (vobj) // this test may not be needed, see above { LLVOAvatar* av = vobj->asAvatar(); - if (av && (av->isImpostor() - || av->isInMuteList() - || (LLVOAvatar::AOA_NORMAL != av->getOverallAppearance() && !av->needsImpostorUpdate()) )) + if (av && + (av->isImpostor() + || av->isInMuteList() + || (LLVOAvatar::AOA_JELLYDOLL == av->getOverallAppearance() && !av->needsImpostorUpdate()) )) { return; } |