diff options
author | Sergej Reich <sergej.reich@googlemail.com> | 2014-01-08 06:29:12 +0400 |
---|---|---|
committer | Sergej Reich <sergej.reich@googlemail.com> | 2014-01-08 06:29:12 +0400 |
commit | 3739f53a6e2ea7e643cd9630f999b9c7503110e3 (patch) | |
tree | bf60e22a5fb75f324fdd21340175a56dced4a276 /source/blender/editors/physics | |
parent | 7647a2b751d477f8016dd587b7bd300efe67ecf6 (diff) |
Fix T38112: Rigid Body can't be created for objects with linked mesh
Make poll function for rigid body add operators less strict.
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r-- | source/blender/editors/physics/rigidbody_object.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/editors/physics/rigidbody_object.c b/source/blender/editors/physics/rigidbody_object.c index b166f36d48b..e4426fdbbf2 100644 --- a/source/blender/editors/physics/rigidbody_object.c +++ b/source/blender/editors/physics/rigidbody_object.c @@ -80,6 +80,16 @@ static int ED_operator_rigidbody_active_poll(bContext *C) return 0; } +static int ED_operator_rigidbody_add_poll(bContext *C) +{ + if (ED_operator_object_active_editable(C)) { + Object *ob = ED_object_active_context(C); + return (ob && ob->type == OB_MESH); + } + else + return 0; +} + /* ----------------- */ bool ED_rigidbody_object_add(Scene *scene, Object *ob, int type, ReportList *reports) @@ -172,7 +182,7 @@ void RIGIDBODY_OT_object_add(wmOperatorType *ot) /* callbacks */ ot->exec = rigidbody_object_add_exec; - ot->poll = ED_operator_object_active_editable_mesh; + ot->poll = ED_operator_rigidbody_add_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -263,7 +273,7 @@ void RIGIDBODY_OT_objects_add(wmOperatorType *ot) /* callbacks */ ot->exec = rigidbody_objects_add_exec; - ot->poll = ED_operator_object_active_editable_mesh; + ot->poll = ED_operator_rigidbody_add_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; |