Bugfix #5037
authorTon Roosendaal <ton@blender.org>
Tue, 31 Oct 2006 20:48:10 +0000 (20:48 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 31 Oct 2006 20:48:10 +0000 (20:48 +0000)
Clear transform (ALT+G/R/S) in Pose sometimes didnt work, for example when
armature is being controlled by other armature. Caused by double depsgraph
flushing.

source/blender/blenkernel/intern/action.c
source/blender/src/editobject.c

index dadaaa650557812783c0682db352879120fd50dd..fca4fcb24662c3d7f8ea33eada78c1d948a54afd 100644 (file)
@@ -928,7 +928,7 @@ static float stridechannel_frame(Object *ob, float sizecorr, bActionStrip *strip
 
 static void cyclic_offs_bone(Object *ob, bPose *pose, bActionStrip *strip, float time)
 {
 
 static void cyclic_offs_bone(Object *ob, bPose *pose, bActionStrip *strip, float time)
 {
-       
+       /* only called when strip has cyclic, so >= 1.0f works... */
        if(time >= 1.0f) {
                bActionChannel *achan= get_action_channel(strip->act, strip->offs_bone);
 
        if(time >= 1.0f) {
                bActionChannel *achan= get_action_channel(strip->act, strip->offs_bone);
 
index 436082401c4cfaef447ba843328933b6fbfaa7bc..5e970a161ef8edd3efd6b3bb136710abbb374c58 100644 (file)
@@ -974,6 +974,7 @@ void clear_object(char mode)
        Base *base;
        Object *ob;
        float *v1, *v3, mat[3][3];
        Base *base;
        Object *ob;
        float *v1, *v3, mat[3][3];
+       int armature_clear= 0;
        char *str=NULL;
        
        if(G.obedit) return;
        char *str=NULL;
        
        if(G.obedit) return;
@@ -991,8 +992,8 @@ void clear_object(char mode)
                        ob= base->object;
                        
                        if(ob->flag & OB_POSEMODE) {
                        ob= base->object;
                        
                        if(ob->flag & OB_POSEMODE) {
-                               /* no test if we got armature; could be in future... */
                                clear_armature(ob, mode);
                                clear_armature(ob, mode);
+                               armature_clear= 1;      /* silly system to prevent another dag update, so no action applied */
                        }
                        else if((G.f & G_WEIGHTPAINT)==0) {
                                
                        }
                        else if((G.f & G_WEIGHTPAINT)==0) {
                                
@@ -1057,7 +1058,8 @@ void clear_object(char mode)
        }
        
        allqueue(REDRAWVIEW3D, 0);
        }
        
        allqueue(REDRAWVIEW3D, 0);
-       DAG_scene_flush_update(G.scene, screen_view3d_layers());
+       if(armature_clear==0) /* in this case flush was done */
+               DAG_scene_flush_update(G.scene, screen_view3d_layers());
        BIF_undo_push(str);
 }
 
        BIF_undo_push(str);
 }