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>2009-08-02 16:52:02 +0400
committerJoshua Leung <aligorith@gmail.com>2009-08-02 16:52:02 +0400
commit1aa3885ef72658771bec837007b3ef0296a81bc4 (patch)
tree0d2bd93f5307c1aff09071143a65e84b3ba67be9
parentc5f0be6d99cd711b07643fcbc6ece218fe805665 (diff)
2.5 - Animation/RNA Bugfixes
* Settings for Bones can now be animated properly from UI * Settings for constraints on bones and objects can now be keyframed properly * Added missing 'subtarget' property wrapping for StretchTo constraint.
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c21
-rw-r--r--source/blender/makesrna/intern/rna_pose.c7
2 files changed, 27 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index d84d6f159d8..d08e59c11dc 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -141,7 +141,21 @@ StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
static char *rna_Constraint_path(PointerRNA *ptr)
{
- return BLI_sprintfN("constraints[%s]", ((bConstraint*)ptr->data)->name);
+ Object *ob= ptr->id.data;
+ bConstraint *con= ptr->data;
+ bPoseChannel *pchan= get_active_posechannel(ob);
+ ListBase *actlist= get_active_constraints(ob);
+ short inList = 0;
+
+ /* check if constraint is in the given list */
+ if (actlist)
+ inList= (BLI_findindex(actlist, con) != -1);
+
+ /* if constraint is in the list, the list is for the active bone... */
+ if ((inList) && (actlist != &ob->constraints) && (pchan))
+ return BLI_sprintfN("pose.pose_channels[\"%s\"].constraints[\"%s\"]", pchan->name, con->name);
+ else
+ return BLI_sprintfN("constraints[\"%s\"]", con->name);
}
static void rna_Constraint_update(bContext *C, PointerRNA *ptr)
@@ -906,6 +920,11 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "subtarget");
+ RNA_def_property_ui_text(prop, "Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "volume", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "volmode");
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 0963f2483f3..095471dd053 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -58,6 +58,12 @@ static void rna_Pose_update(bContext *C, PointerRNA *ptr)
DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_DATA);
}
+static char *rna_PoseChannel_path(PointerRNA *ptr)
+{
+ // XXX do we really need the 'pose.' bit?
+ return BLI_sprintfN("pose.pose_channels[\"%s\"]", ((bPoseChannel*)ptr->data)->name);
+}
+
static void rna_BoneGroup_color_set_set(PointerRNA *ptr, int value)
{
bActionGroup *grp= ptr->data;
@@ -297,6 +303,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
srna= RNA_def_struct(brna, "PoseChannel", NULL);
RNA_def_struct_sdna(srna, "bPoseChannel");
RNA_def_struct_ui_text(srna, "Pose Channel", "Channel defining pose data for a bone in a Pose.");
+ RNA_def_struct_path_func(srna, "rna_PoseChannel_path");
RNA_def_struct_idproperties_func(srna, "rna_PoseChannel_idproperties");
prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);