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:
authorJoshua Leung <aligorith@gmail.com>2012-05-17 14:28:30 +0400
committerJoshua Leung <aligorith@gmail.com>2012-05-17 14:28:30 +0400
commitf9043865a23f42b2705c66ffcdf7b9f4e6f6072d (patch)
treed4715afac91547e3a7ba03d817d72c7e161299f4 /source/blender/editors
parentc7c937547b0ceb622262ea064db71364f61669c6 (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')
-rw-r--r--source/blender/editors/object/object_constraint.c21
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;
}