svn merge -r 15392:15551 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / source / blender / src / transform_conversions.c
index dcebf6b75578351cd5231cecd1fa2f44b05a3fa2..10e49cdd2183eb6ad80565a9ee7de8d09cc28b82 100644 (file)
@@ -3610,6 +3610,7 @@ void special_aftertrans_update(TransInfo *t)
        Base *base;
        short redrawipo=0, resetslowpar=1;
        int cancelled= (t->state == TRANS_CANCEL);
+       short duplicate= (t->undostr && strstr(t->undostr, "Duplicate")) ? 1 : 0;
        
        if (t->spacetype==SPACE_VIEW3D) {
                if (G.obedit) {
@@ -3622,7 +3623,7 @@ void special_aftertrans_update(TransInfo *t)
                        }
                }
        }
-       if (t->spacetype == SPACE_ACTION) {
+       else if (t->spacetype == SPACE_ACTION) {
                void *data;
                short datatype;
                
@@ -3644,7 +3645,7 @@ void special_aftertrans_update(TransInfo *t)
                        
                        /* Do curve cleanups? */
                        if ( (G.saction->flag & SACTION_NOTRANSKEYCULL)==0 && 
-                            (cancelled == 0) )
+                            ((cancelled == 0) || (duplicate)) )
                        {
                                posttrans_action_clean((bAction *)data);
                        }
@@ -3659,7 +3660,7 @@ void special_aftertrans_update(TransInfo *t)
                                IpoCurve *icu;
                                
                                if ( (G.saction->flag & SACTION_NOTRANSKEYCULL)==0 && 
-                                    (cancelled == 0) )
+                                    ((cancelled == 0) || (duplicate)) )
                                {
                                        posttrans_ipo_clean(key->ipo);
                                }
@@ -3685,7 +3686,7 @@ void special_aftertrans_update(TransInfo *t)
                
                /* after transform, remove duplicate keyframes on a frame that resulted from transform */
                if ( (G.snla->flag & SNLA_NOTRANSKEYCULL)==0 && 
-                        (cancelled == 0) )
+                        ((cancelled == 0) || (duplicate)) )
                {
                        posttrans_nla_clean(t);
                }