svn merge -r 12208:12294 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / source / blender / src / transform_generics.c
index 744933088c82461312191252d761895fd6b820d5..9031ce48707b7a7144db6dd075aa73261f9f0c4c 100644 (file)
@@ -72,6 +72,7 @@
 #include "BKE_action.h"
 #include "BKE_anim.h"
 #include "BKE_armature.h"
+#include "BKE_cloth.h"
 #include "BKE_curve.h"
 #include "BKE_depsgraph.h"
 #include "BKE_displist.h"
@@ -419,8 +420,16 @@ void recalcData(TransInfo *t)
                        /* bah, softbody exception... recalcdata doesnt reset */
                        for(base= FIRSTBASE; base; base= base->next) {
                                if(base->object->recalc & OB_RECALC_DATA)
+                               {                                       
+                                       ClothModifierData *clmd = NULL;
+                                       
                                        if(modifiers_isSoftbodyEnabled(base->object)) {
                                                base->object->softflag |= OB_SB_REDO;
+                                       }
+                                       else if(modifiers_isClothEnabled(ob)) {
+                                               cloth_free_modifier(modifiers_isClothEnabled(ob));
+                                       }
+                                       
                                }
                        }
                }
@@ -453,10 +462,17 @@ void recalcData(TransInfo *t)
                                }                               
                        }
                        
-                       /* softbody exception */
-                       if(modifiers_isSoftbodyEnabled(ob)) {
-                               if(ob->recalc & OB_RECALC_DATA)
-                                       ob->softflag |= OB_SB_REDO;
+                       /* softbody & cloth exception */
+                       if(ob->recalc & OB_RECALC_DATA)
+                       {
+                               ClothModifierData *clmd = NULL;
+                               
+                               if(modifiers_isSoftbodyEnabled(ob)) {
+                                               ob->softflag |= OB_SB_REDO;
+                               }
+                               else if(modifiers_isClothEnabled(ob)) {
+                                       cloth_free_modifier(modifiers_isClothEnabled(ob));
+                               }
                        }
                        
                        /* proxy exception */