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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-01-04 21:20:08 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-01-04 21:20:08 +0400
commitcd84a43334f59d9ff613a240467bbec5c882b7da (patch)
tree3029252a961de0257785fbf2387be1fc874d6ff4 /source/blender/makesrna/intern/rna_constraint.c
parent829216325de89ec156885ec7b8d2783c645e49a2 (diff)
Camera tracking: added depth object to Follow Track constraint
If this object is defined, object with Follow Track constraint would be projected into surface of this depth object. If object is not set or there's no projection onto it, projection plane calculated based on original object position would be used. This allows to make cheap facial mocap.
Diffstat (limited to 'source/blender/makesrna/intern/rna_constraint.c')
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index 6439d22e808..3258b8c3dcb 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -358,6 +358,34 @@ static void rna_Constraint_followTrack_camera_set(PointerRNA *ptr, PointerRNA va
}
}
+static void rna_Constraint_followTrack_depthObject_set(PointerRNA *ptr, PointerRNA value)
+{
+ bConstraint *con= (bConstraint*)ptr->data;
+ bFollowTrackConstraint *data= (bFollowTrackConstraint*)con->data;
+ Object *ob= (Object*)value.data;
+
+ if (ob) {
+ if (ob->type == OB_MESH && ob != (Object*)ptr->id.data) {
+ data->depth_ob= ob;
+ }
+ } else {
+ data->depth_ob= NULL;
+ }
+}
+
+static int rna_Constraint_followTrack_depthObject_poll(PointerRNA *ptr, PointerRNA value)
+{
+ Object *ob= (Object*)value.data;
+
+ if(ob) {
+ if (ob->type == OB_MESH && ob != (Object*)ptr->id.data) {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
static void rna_Constraint_objectSolver_camera_set(PointerRNA *ptr, PointerRNA value)
{
bConstraint *con= (bConstraint*)ptr->data;
@@ -2126,6 +2154,14 @@ static void rna_def_constraint_follow_track(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
RNA_def_property_pointer_funcs(prop, NULL, "rna_Constraint_followTrack_camera_set", NULL, "rna_Constraint_cameraObject_poll");
+
+ /* depth object */
+ prop= RNA_def_property(srna, "depth_object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "depth_ob");
+ RNA_def_property_ui_text(prop, "Depth Object", "Object used to define depth in camera space by projecting onto surface of this object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Constraint_followTrack_depthObject_set", NULL, "rna_Constraint_followTrack_depthObject_poll");
}
static void rna_def_constraint_camera_solver(BlenderRNA *brna)