[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19545] branches/blender2.5/blender/source /blender: Animato - RNA Wrapping:
Joshua Leung
aligorith at gmail.com
Sun Apr 5 13:26:33 CEST 2009
Revision: 19545
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19545
Author: aligorith
Date: 2009-04-05 13:26:33 +0200 (Sun, 05 Apr 2009)
Log Message:
-----------
Animato - RNA Wrapping:
RNA-Paths + Array Indices for Keying Sets, F-Curves, and Drivers are now editable. We could disable these later if need be, it is useful to be able to edit these (especially for debugging purposes now).
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/editors/animation/keyframing.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_animation.c
Modified: branches/blender2.5/blender/source/blender/editors/animation/keyframing.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/keyframing.c 2009-04-05 10:03:23 UTC (rev 19544)
+++ branches/blender2.5/blender/source/blender/editors/animation/keyframing.c 2009-04-05 11:26:33 UTC (rev 19545)
@@ -716,10 +716,10 @@
PropertyRNA *prop;
FCurve *fcu;
- /* validate pointer first - exit if failure*/
+ /* validate pointer first - exit if failure */
RNA_id_pointer_create(id, &id_ptr);
- if (RNA_path_resolve(&id_ptr, rna_path, &ptr, &prop) == 0 || prop == NULL) {
- printf("Insert Key: Could not insert keyframe, as RNA Path is invalid for the given ID (%s)\n", rna_path);
+ if ((RNA_path_resolve(&id_ptr, rna_path, &ptr, &prop) == 0) || (prop == NULL)) {
+ printf("Insert Key: Could not insert keyframe, as RNA Path is invalid for the given ID (ID = %s, Path = %s)\n", id->name, rna_path);
return 0;
}
@@ -2159,7 +2159,7 @@
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* settings */
- RNA_def_boolean(ot->srna, "builtin", 0, "Built-In Keying Set", "Use one of the relative Keying Sets defined by default");
+ RNA_def_int(ot->srna, "type", 0, INT_MIN, INT_MAX, "Keying Set Number", "Index (determined internally) of the Keying Set to use", 0, 1);
}
/* Insert Key Operator (With Menu) ------------------------ */
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c 2009-04-05 10:03:23 UTC (rev 19544)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c 2009-04-05 11:26:33 UTC (rev 19545)
@@ -57,11 +57,11 @@
return 0;
}
-#if 0
static void rna_Driver_RnaPath_set(PointerRNA *ptr, const char *value)
{
ChannelDriver *driver= (ChannelDriver *)ptr->data;
-
+
+ // XXX in this case we need to be very careful, as this will require some new dependencies to be added!
if (driver->rna_path)
MEM_freeN(driver->rna_path);
@@ -70,8 +70,8 @@
else
driver->rna_path= NULL;
}
-#endif
+
static void rna_FCurve_RnaPath_get(PointerRNA *ptr, char *value)
{
FCurve *fcu= (FCurve *)ptr->data;
@@ -92,7 +92,6 @@
return 0;
}
-#if 0
static void rna_FCurve_RnaPath_set(PointerRNA *ptr, const char *value)
{
FCurve *fcu= (FCurve *)ptr->data;
@@ -105,7 +104,6 @@
else
fcu->rna_path= NULL;
}
-#endif
#else
@@ -139,7 +137,6 @@
RNA_def_property_ui_text(prop, "Driver Object", "Object that controls this Driver.");
prop= RNA_def_property(srna, "rna_path", PROP_STRING, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Driver_RnaPath_get", "rna_Driver_RnaPath_length", "rna_Driver_RnaPath_set");
RNA_def_property_ui_text(prop, "Driver RNA Path", "RNA Path (from Driver Object) to property used as Driver.");
@@ -179,11 +176,12 @@
/* Path + Array Index */
prop= RNA_def_property(srna, "rna_path", PROP_STRING, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ //RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now editable
RNA_def_property_string_funcs(prop, "rna_FCurve_RnaPath_get", "rna_FCurve_RnaPath_length", "rna_FCurve_RnaPath_set");
RNA_def_property_ui_text(prop, "RNA Path", "RNA Path to property affected by F-Curve.");
prop= RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE);
+ //RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now editable
RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific property affected by F-Curve if applicable.");
/* Color */
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_animation.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_animation.c 2009-04-05 10:03:23 UTC (rev 19544)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_animation.c 2009-04-05 11:26:33 UTC (rev 19545)
@@ -57,20 +57,18 @@
return 0;
}
-#if 0
static void rna_ksPath_RnaPath_set(PointerRNA *ptr, const char *value)
{
KS_Path *ksp= (KS_Path *)ptr->data;
if (ksp->rna_path)
- MEM_freeN(ksp->ksp_path);
+ MEM_freeN(ksp->rna_path);
if (strlen(value))
ksp->rna_path= BLI_strdup(value);
else
ksp->rna_path= NULL;
}
-#endif
#else
@@ -106,11 +104,12 @@
/* Path + Array Index */
prop= RNA_def_property(srna, "rna_path", PROP_STRING, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ //RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now editable
RNA_def_property_string_funcs(prop, "rna_ksPath_RnaPath_get", "rna_ksPath_RnaPath_length", "rna_ksPath_RnaPath_set");
RNA_def_property_ui_text(prop, "RNA Path", "RNA Path to property setting.");
prop= RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE);
+ //RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now editable
RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific setting if applicable.");
/* Flags */
More information about the Bf-blender-cvs
mailing list