Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-11-07 08:59:35 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-07 08:59:35 +0300
commitfbcaa502ca8e71390e3f43ee9cc18b1ccfe840a2 (patch)
tree802bf2187994440d4cd4b8422bbf6ff7ba40fd2b
parent05e598959e530060c02e81d3e4c39c29858d9405 (diff)
bugfix [#24574] setting location gained from a matrix_world.copy().translation_part() (visual loc) after constraints causes NAN in object location after python script ends
shrinkwrap constraint was dividing by zero. also the shrinkwrap UI was incorrectly trying to draw a subtarget.
-rw-r--r--release/scripts/ui/properties_object_constraint.py2
-rw-r--r--source/blender/blenkernel/intern/constraint.c4
-rw-r--r--source/blender/makesrna/intern/rna_cloth.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/release/scripts/ui/properties_object_constraint.py b/release/scripts/ui/properties_object_constraint.py
index 3908b00cde6..a2e886adc11 100644
--- a/release/scripts/ui/properties_object_constraint.py
+++ b/release/scripts/ui/properties_object_constraint.py
@@ -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")
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index a561df49e94..5dff21d8af4 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -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;
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index 3a47124a47e..759a4acc860 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -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);