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.
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user