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:
authorSybren A. Stüvel <sybren@stuvel.eu>2018-07-04 12:21:31 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2018-07-04 12:22:57 +0300
commit9e4d667c2cfd4a81f9a69628b69facd8fd4e0a01 (patch)
tree212ca3a6f0c3db50d83bd0fc799026ebcdfd582e /source/blender/editors/object/object_modifier.c
parent75b5ff6698f5c1d50152cfb68530ac6a4ead999e (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_modifier.c')
-rw-r--r--source/blender/editors/object/object_modifier.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 2889f798dd8..31a53bed201 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -293,9 +293,8 @@ static bool object_modifier_remove(Main *bmain, Object *ob, ModifierData *md,
}
else if (md->type == eModifierType_Softbody) {
if (ob->soft) {
- sbFree(ob->soft);
- ob->soft = NULL;
- ob->softflag = 0;
+ sbFree(ob);
+ ob->softflag = 0; /* TODO(Sybren): this should probably be moved into sbFree() */
}
}
else if (md->type == eModifierType_Collision) {