summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatarself.cpp
diff options
context:
space:
mode:
authornyx@NyxTop <nyx@NyxTop>2009-10-29 15:13:27 -0400
committernyx@NyxTop <nyx@NyxTop>2009-10-29 15:13:27 -0400
commit65f534899740018b8efb662f8154030edb07fc0f (patch)
tree5a9697d4fb5a6004a80545804db11c51e1bdfc4c /indra/newview/llvoavatarself.cpp
parentbc9808a01710ab21d60df3b6652b500f31f1c40e (diff)
EXT-1945 visual parameter animations broken
First round of fixes for trying to fix the visual param animations Code reviewed by Seraph
Diffstat (limited to 'indra/newview/llvoavatarself.cpp')
-rw-r--r--indra/newview/llvoavatarself.cpp40
1 files changed, 33 insertions, 7 deletions
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 4760d5a472..758db538a2 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -193,6 +193,25 @@ void LLVOAvatarSelf::markDead()
LLVOAvatar::markDead();
}
+/*virtual*/ BOOL LLVOAvatarSelf::loadAvatar()
+{
+ BOOL success = LLVOAvatar::loadAvatar();
+
+ // set all parameters sotred directly in the avatar to have
+ // the isSelfParam to be TRUE - this is used to prevent
+ // them from being animated or trigger accidental rebakes
+ // when we copy params from the wearable to the base avatar.
+ for (LLViewerVisualParam* param = (LLViewerVisualParam*) getFirstVisualParam();
+ param;
+ param = (LLViewerVisualParam*) getNextVisualParam())
+ {
+ param->setIsDummy(TRUE);
+ }
+
+ return success;
+}
+
+
BOOL LLVOAvatarSelf::loadAvatarSelf()
{
BOOL success = TRUE;
@@ -704,16 +723,23 @@ void LLVOAvatarSelf::updateVisualParams()
}
}
- LLWearable *shape = gAgentWearables.getWearable(WT_SHAPE,0);
- if (shape)
- {
- F32 gender = shape->getVisualParamWeight(80); // param 80 == gender
- setVisualParamWeight("male",gender ,TRUE);
- }
-
LLVOAvatar::updateVisualParams();
}
+/*virtual*/
+void LLVOAvatarSelf::idleUpdateAppearanceAnimation()
+{
+ // Animate all top-level wearable visual parameters
+ gAgentWearables.animateAllWearableParams(calcMorphAmount(), mAppearanceAnimSetByUser);
+
+ // apply wearable visual params to avatar
+ updateVisualParams();
+
+ //allow avatar to process updates
+ LLVOAvatar::idleUpdateAppearanceAnimation();
+
+}
+
// virtual
void LLVOAvatarSelf::requestStopMotion(LLMotion* motion)
{