bugfix [#24574] setting location gained from a matrix_world.copy().translation_part...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 7 Nov 2010 05:59:35 +0000 (05:59 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 7 Nov 2010 05:59:35 +0000 (05:59 +0000)
shrinkwrap constraint was dividing by zero. also the shrinkwrap UI was incorrectly trying to draw a subtarget.

release/scripts/ui/properties_object_constraint.py
source/blender/blenkernel/intern/constraint.c
source/blender/makesrna/intern/rna_cloth.c

index 3908b00cde68fc8073b639be86c8a3a3a1c11548..a2e886adc110ed4004b38123dad434b384740936 100644 (file)
@@ -624,7 +624,7 @@ class ConstraintButtonsPanel():
         self.space_template(layout, con)
 
     def SHRINKWRAP(self, context, layout, con):
-        self.target_template(layout, con)
+        self.target_template(layout, con, False)
 
         layout.prop(con, "distance")
         layout.prop(con, "shrinkwrap_type")
index a561df49e94ffdafa6da7faa1c937c9b7cb843aa..5dff21d8af4f6967f2d3c91621fd5100ae818252 100644 (file)
@@ -3462,7 +3462,9 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
                                        BLI_bvhtree_find_nearest(treeData.tree, co, &nearest, treeData.nearest_callback, &treeData);
                                        
                                        dist = len_v3v3(co, nearest.co);
-                                       interp_v3_v3v3(co, co, nearest.co, (dist - scon->dist)/dist);   /* linear interpolation */
+                                       if(dist != 0.0f) {
+                                               interp_v3_v3v3(co, co, nearest.co, (dist - scon->dist)/dist);   /* linear interpolation */
+                                       }
                                        space_transform_invert(&transform, co);
                                break;
                                
index 3a47124a47e0796e83fc06c67a1ad071470daa71..759a4acc860461ed13d3888c181f97dca58c6a44 100644 (file)
@@ -55,7 +55,7 @@ static void rna_cloth_update(Main *bmain, Scene *scene, PointerRNA *ptr)
 static void rna_cloth_pinning_changed(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
        Object *ob= (Object*)ptr->id.data;
-       ClothSimSettings *settings = (ClothSimSettings*)ptr->data;
+//     ClothSimSettings *settings = (ClothSimSettings*)ptr->data;
        ClothModifierData *clmd = (ClothModifierData*)modifiers_findByType(ob, eModifierType_Cloth);
 
        cloth_free_modifier(clmd);