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>2011-02-16 03:17:22 +0300
committerJoshua Leung <aligorith@gmail.com>2011-02-16 03:17:22 +0300
commit147309e3c5b2047ee1017af7a810539f1514007d (patch)
tree994ae692f1e2266ed1a1da8a35f4d27dd3640e4b /source/blender/makesrna
parentc195e68e8ea186e0c1e9dee5c6b081c90530fc6e (diff)
Pose Lib: Start of PoseLib UI in Armature buttons
This presents a UI from which PoseLibs can be assigned/removed from Objects. From here, it is also possible to see the list of poses and add/remove poses from this list. Known Issues: - [Py/RNA/Operators BUG ALERT!] If after immediately starting Blender you try to remove a pose from the PoseLib using the UI buttons, you'll get a an error the first time you do so (but not for subsequent attempts). This seems to be caused by the "pose" enum (dynamically generated) of the POSELIB_OT_pose_remove operator, which does not seem to be getting initialised when the operator's exec gets called without the invoke having been called previously - Changing the active Pose Library still seems to be broken (to be fixed soon) Todos: - Operator button to make the selected pose get shown in the 3d view - Restore the "validate action" operator and add that to this panel - Rename pose access
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_action.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index f9f6478cc3d..6cfd122d08e 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -149,6 +149,15 @@ static void rna_Action_pose_markers_remove(bAction *act, ReportList *reports, Ti
MEM_freeN(marker);
}
+static void rna_Action_active_pose_marker_index_range(PointerRNA *ptr, int *min, int *max)
+{
+ bAction *act= (bAction *)ptr->data;
+
+ *min= 0;
+ *max= BLI_countlist(&act->markers)-1;
+ *max= MAX2(0, *max);
+}
+
static void rna_Action_frame_range_get(PointerRNA *ptr,float *values)
{
calc_action_range(ptr->id.data, values, values+1, 1);
@@ -422,6 +431,7 @@ static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
+ PropertyRNA *prop;
FunctionRNA *func;
PropertyRNA *parm;
@@ -445,6 +455,11 @@ static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+
+ prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "active_marker");
+ RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Action_active_pose_marker_index_range");
+ RNA_def_property_ui_text(prop, "Active Pose Marker Index", "Index of active pose marker");
}
static void rna_def_action(BlenderRNA *brna)