diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-03-02 17:03:47 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-03-02 19:09:24 +0300 |
commit | 083bc48816d0962d593c0a2d28b068dd24a706f8 (patch) | |
tree | 60772c9c393267271fb544697dd4289f23a0ae73 /source/blender/editors | |
parent | aa845eed1e18fae45be8828bb08459c009dba6d5 (diff) |
Remove OBACT from rigidbody_constraint.c and remove uneeded sanity check
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/physics/rigidbody_constraint.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/editors/physics/rigidbody_constraint.c b/source/blender/editors/physics/rigidbody_constraint.c index b7be31602d9..fb75e27131b 100644 --- a/source/blender/editors/physics/rigidbody_constraint.c +++ b/source/blender/editors/physics/rigidbody_constraint.c @@ -117,8 +117,9 @@ static int rigidbody_con_add_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); + SceneLayer *sl = CTX_data_scene_layer(C); RigidBodyWorld *rbw = BKE_rigidbody_get_world(scene); - Object *ob = (scene) ? OBACT : NULL; + Object *ob = OBACT_NEW; int type = RNA_enum_get(op->ptr, "type"); bool changed; @@ -166,11 +167,8 @@ static int rigidbody_con_remove_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); - Object *ob = (scene) ? OBACT : NULL; - - /* sanity checks */ - if (scene == NULL) - return OPERATOR_CANCELLED; + SceneLayer *sl = CTX_data_scene_layer(C); + Object *ob = OBACT_NEW; /* apply to active object */ if (ELEM(NULL, ob, ob->rigidbody_constraint)) { |