diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-07-04 12:21:31 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-07-04 12:22:57 +0300 |
commit | 9e4d667c2cfd4a81f9a69628b69facd8fd4e0a01 (patch) | |
tree | 212ca3a6f0c3db50d83bd0fc799026ebcdfd582e /source/blender/editors/object/object_edit.c | |
parent | 75b5ff6698f5c1d50152cfb68530ac6a4ead999e (diff) |
SoftBody: refactored sbFree()
This prevents having to wrap each call to sbFree() in an if(ob->soft)
condition and assign ob->soft = NULL after calling.
Furthermore, passing `Object *` allows us to change freeing behaviour
depending on whether the object is an evaluated copy or an original (not
done in this commit yet).
Diffstat (limited to 'source/blender/editors/object/object_edit.c')
-rw-r--r-- | source/blender/editors/object/object_edit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 7dc4aa1d1b3..a6c3c86922d 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1050,7 +1050,7 @@ static void copy_attr(Main *bmain, Scene *scene, ViewLayer *view_layer, short ev DEG_relations_tag_update(bmain); } else if (event == 23) { - if (base->object->soft) sbFree(base->object->soft); + sbFree(base->object); BKE_object_copy_softbody(base->object, ob, 0); if (!modifiers_findByType(base->object, eModifierType_Softbody)) { |