diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-07-03 19:20:44 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-07-04 12:22:32 +0300 |
commit | 75b5ff6698f5c1d50152cfb68530ac6a4ead999e (patch) | |
tree | afc7ff29b262c9d92c6ba4a1a9635ba508861c57 /source/blender/editors/object/object_edit.c | |
parent | 13ec4be594e11d39bc28c986446eade86b148129 (diff) |
Softbody: unified copy functions
This unifies two almost-identical functions at the expense of having to
add one single 'flag' value at one call.
This makes copy_softbody() aware of the source/dest objects, allowing it
to make a distinction between doing depsgraph evaluation copies and real
object copies. This will be used in an upcoming commit to ensure that
the pointcache is shared between CoW copies, similar to the current
approach for rigidbody simulation.
Diffstat (limited to 'source/blender/editors/object/object_edit.c')
-rw-r--r-- | source/blender/editors/object/object_edit.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index ef9d32f7148..7dc4aa1d1b3 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1050,10 +1050,8 @@ static void copy_attr(Main *bmain, Scene *scene, ViewLayer *view_layer, short ev DEG_relations_tag_update(bmain); } else if (event == 23) { - base->object->softflag = ob->softflag; if (base->object->soft) sbFree(base->object->soft); - - base->object->soft = copy_softbody(ob->soft, 0); + BKE_object_copy_softbody(base->object, ob, 0); if (!modifiers_findByType(base->object, eModifierType_Softbody)) { BLI_addhead(&base->object->modifiers, modifier_new(eModifierType_Softbody)); |