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:
authorCampbell Barton <ideasman42@gmail.com>2009-11-11 22:58:30 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-11-11 22:58:30 +0300
commit53250f85dbecdc4cdd6eded772972b137f3f8c6c (patch)
tree2deea82dca566fd752753d34b7df3e38ba4d0216 /source/blender/editors/object/object_relations.c
parent047ee04418a5a785177258dd965f94571d553b57 (diff)
object.constraints.add()/remove()/active, same for PoseChannel
modified internal api for minimal rna wrapper functions. TODO - missing updates for pose channels - typecheck for pose/object constraints
Diffstat (limited to 'source/blender/editors/object/object_relations.c')
-rw-r--r--source/blender/editors/object/object_relations.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 95b874e7145..7e7b1d99825 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -608,14 +608,11 @@ static int parent_set_exec(bContext *C, wmOperator *op)
bFollowPathConstraint *data;
float cmat[4][4], vec[3];
- con = add_new_constraint(CONSTRAINT_TYPE_FOLLOWPATH);
- strcpy (con->name, "AutoPath");
+ con = add_ob_constraint(ob, "AutoPath", CONSTRAINT_TYPE_FOLLOWPATH);
data = con->data;
data->tar = par;
- add_constraint_to_object(con, ob);
-
get_constraint_target_matrix(scene, con, 0, CONSTRAINT_OBTYPE_OBJECT, NULL, cmat, scene->r.cfra - give_timeoffset(ob));
sub_v3_v3v3(vec, ob->obmat[3], cmat[3]);
@@ -923,8 +920,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
if(ob!=obact) {
- con = add_new_constraint(CONSTRAINT_TYPE_TRACKTO);
- strcpy (con->name, "AutoTrack");
+ con = add_ob_constraint(ob, "AutoTrack", CONSTRAINT_TYPE_TRACKTO);
data = con->data;
data->tar = obact;
@@ -935,8 +931,6 @@ static int track_set_exec(bContext *C, wmOperator *op)
data->reserved1 = TRACK_nZ;
data->reserved2 = UP_Y;
}
-
- add_constraint_to_object(con, ob);
}
}
CTX_DATA_END;
@@ -947,8 +941,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
if(ob!=obact) {
- con = add_new_constraint(CONSTRAINT_TYPE_LOCKTRACK);
- strcpy (con->name, "AutoTrack");
+ con = add_ob_constraint(ob, "AutoTrack", CONSTRAINT_TYPE_LOCKTRACK);
data = con->data;
data->tar = obact;
@@ -959,8 +952,6 @@ static int track_set_exec(bContext *C, wmOperator *op)
data->trackflag = TRACK_nZ;
data->lockflag = LOCK_Y;
}
-
- add_constraint_to_object(con, ob);
}
}
CTX_DATA_END;