diff options
author | Joshua Leung <aligorith@gmail.com> | 2012-05-17 14:28:30 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2012-05-17 14:28:30 +0400 |
commit | f9043865a23f42b2705c66ffcdf7b9f4e6f6072d (patch) | |
tree | d4715afac91547e3a7ba03d817d72c7e161299f4 /source/blender/editors/object/object_constraint.c | |
parent | c7c937547b0ceb622262ea064db71364f61669c6 (diff) |
Disable setting non-object actions as the action used by the Action Constraint
(... I could've sworn there used to be some dynamic enums for filtering actions
by root type)
Diffstat (limited to 'source/blender/editors/object/object_constraint.c')
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index d73b53deecc..7cc11fa0209 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -356,8 +356,15 @@ static void test_constraints(Object *owner, bPoseChannel *pchan) bActionConstraint *data = curcon->data; /* validate action */ - if (data->act == NULL) + if (data->act == NULL) { + /* must have action */ curcon->flag |= CONSTRAINT_DISABLE; + } + else if (data->act->idroot != ID_OB) { + /* only object-rooted actions can be used */ + data->act = NULL; + curcon->flag |= CONSTRAINT_DISABLE; + } } else if (curcon->type == CONSTRAINT_TYPE_FOLLOWPATH) { bFollowPathConstraint *data = curcon->data; @@ -409,12 +416,12 @@ static void test_constraints(Object *owner, bPoseChannel *pchan) if (data->clip != NULL && data->track[0]) { MovieTracking *tracking = &data->clip->tracking; MovieTrackingObject *tracking_object; - + if (data->object[0]) tracking_object = BKE_tracking_named_object(tracking, data->object); else tracking_object = BKE_tracking_get_camera_object(tracking); - + if (!tracking_object) { curcon->flag |= CONSTRAINT_DISABLE; } @@ -428,14 +435,14 @@ static void test_constraints(Object *owner, bPoseChannel *pchan) } else if (curcon->type == CONSTRAINT_TYPE_CAMERASOLVER) { bCameraSolverConstraint *data = curcon->data; - - if ((data->flag & CAMERASOLVER_ACTIVECLIP) == 0 && data->clip == NULL) + + if ((data->flag & CAMERASOLVER_ACTIVECLIP) == 0 && (data->clip == NULL)) curcon->flag |= CONSTRAINT_DISABLE; } else if (curcon->type == CONSTRAINT_TYPE_OBJECTSOLVER) { bObjectSolverConstraint *data = curcon->data; - - if ((data->flag & CAMERASOLVER_ACTIVECLIP) == 0 && data->clip == NULL) + + if ((data->flag & CAMERASOLVER_ACTIVECLIP) == 0 && (data->clip == NULL)) curcon->flag |= CONSTRAINT_DISABLE; } |