Browse Source

Mark animation dirty when per-bone weights are changed.

Lasse Öörni 12 years ago
parent
commit
391c3fef75
1 changed files with 8 additions and 1 deletions
  1. 8 1
      Engine/Graphics/AnimationState.cpp

+ 8 - 1
Engine/Graphics/AnimationState.cpp

@@ -198,7 +198,14 @@ void AnimationState::SetBoneWeight(unsigned index, float weight)
     if (index >= stateTracks_.Size())
         return;
     
-    stateTracks_[index].weight_ = Clamp(weight, 0.0f, 1.0f);
+    weight = Clamp(weight, 0.0f, 1.0f);
+    
+    if (weight != stateTracks_[index].weight_)
+    {
+        stateTracks_[index].weight_ = weight;
+        if (model_)
+            model_->MarkAnimationDirty();
+    }
 }
 
 void AnimationState::SetBoneWeight(const String& name, float weight)