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:
Diffstat (limited to 'source/blender/editors/physics/rigidbody_constraint.c')
-rw-r--r--source/blender/editors/physics/rigidbody_constraint.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/editors/physics/rigidbody_constraint.c b/source/blender/editors/physics/rigidbody_constraint.c
index eb799f46177..66ae2d323fd 100644
--- a/source/blender/editors/physics/rigidbody_constraint.c
+++ b/source/blender/editors/physics/rigidbody_constraint.c
@@ -40,12 +40,21 @@
/* ********************************************** */
/* Helper API's for RigidBody Constraint Editing */
+static bool operator_rigidbody_constraints_editable_poll(Scene *scene)
+{
+ if (scene == NULL || ID_IS_LINKED(scene) || ID_IS_OVERRIDE_LIBRARY(scene) ||
+ (scene->rigidbody_world != NULL && scene->rigidbody_world->constraints != NULL &&
+ (ID_IS_LINKED(scene->rigidbody_world->constraints) ||
+ ID_IS_OVERRIDE_LIBRARY(scene->rigidbody_world->constraints)))) {
+ return false;
+ }
+ return true;
+}
+
static bool ED_operator_rigidbody_con_active_poll(bContext *C)
{
Scene *scene = CTX_data_scene(C);
- if (scene == NULL || ID_IS_LINKED(&scene->id) ||
- (scene->rigidbody_world != NULL && scene->rigidbody_world->constraints != NULL &&
- ID_IS_LINKED(&scene->rigidbody_world->constraints->id))) {
+ if (!operator_rigidbody_constraints_editable_poll(scene)) {
return false;
}
@@ -59,9 +68,7 @@ static bool ED_operator_rigidbody_con_active_poll(bContext *C)
static bool ED_operator_rigidbody_con_add_poll(bContext *C)
{
Scene *scene = CTX_data_scene(C);
- if (scene == NULL || ID_IS_LINKED(&scene->id) ||
- (scene->rigidbody_world != NULL && scene->rigidbody_world->constraints != NULL &&
- ID_IS_LINKED(&scene->rigidbody_world->constraints->id))) {
+ if (!operator_rigidbody_constraints_editable_poll(scene)) {
return false;
}
return ED_operator_object_active_editable(C);