diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-06 15:19:46 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-06 15:19:46 +0300 |
commit | e292b5badc7d7cc44c8c836857771d310e44fa5a (patch) | |
tree | 8db0dff0e84125138c6db223965772c44d18cacd /release/scripts/op | |
parent | 83f677d9cfce4fe30d63d4b04ac07e2dea3accbe (diff) |
fix for crash when setting a shapekeys name in rna, (probably other properties too).
When the shapekey was returned from the object it didnt use the data's ID which is expected elsewhere in RNA.
Transfer shape now also sets the name.
Diffstat (limited to 'release/scripts/op')
-rw-r--r-- | release/scripts/op/object.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/release/scripts/op/object.py b/release/scripts/op/object.py index f1762787740..d68c30f0f23 100644 --- a/release/scripts/op/object.py +++ b/release/scripts/op/object.py @@ -176,11 +176,12 @@ class ShapeTransfer(bpy.types.Operator): def me_cos(verts): return [v.co.copy() for v in verts] - def ob_add_shape(ob): + def ob_add_shape(ob, name): me = ob.data - ob.add_shape_key(from_mix=False) + key = ob.add_shape_key(from_mix=False) if len(me.shape_keys.keys) == 1: - ob.add_shape_key(from_mix=False) # we need a rest + key = ob.add_shape_key(from_mix=False) # we need a rest + key.name = name ob.active_shape_key_index = len(me.shape_keys.keys) - 1 ob.shape_key_lock = True @@ -191,6 +192,7 @@ class ShapeTransfer(bpy.types.Operator): use_clamp = False me = ob_act.data + orig_key_name = ob_act.active_shape_key.name orig_shape_coords = me_cos(ob_act.active_shape_key.data) @@ -206,7 +208,7 @@ class ShapeTransfer(bpy.types.Operator): target_normals = me_nos(me_other.verts) target_coords = me_cos(me_other.verts) - ob_add_shape(ob_other) + ob_add_shape(ob_other, orig_key_name) # editing the final coords, only list that stores wrapped coords target_shape_coords = [v.co for v in ob_other.active_shape_key.data] |