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
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-04-05 15:26:33 +0400
committerJoshua Leung <aligorith@gmail.com>2009-04-05 15:26:33 +0400
commitc99b9d792282fd371e0a8e5a91cebb0d272e3cf4 (patch)
tree94da858d8b32b7a664329be76216b287a72d4497 /source
parent3906a62cc18e64b2e7f1846ebbb8892c572399ea (diff)
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).
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/animation/keyframing.c8
-rw-r--r--source/blender/makesrna/intern/rna_action.c12
-rw-r--r--source/blender/makesrna/intern/rna_animation.c7
3 files changed, 12 insertions, 15 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 17b1794765a..f0813a7e59d 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -716,10 +716,10 @@ short insertkey (ID *id, const char group[], const char rna_path[], int array_in
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 @@ void ANIM_OT_insert_keyframe (wmOperatorType *ot)
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) ------------------------ */
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 6cb38ed9cdc..a73f9627121 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -57,11 +57,11 @@ static int rna_Driver_RnaPath_length(PointerRNA *ptr)
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,7 +70,7 @@ static void rna_Driver_RnaPath_set(PointerRNA *ptr, const char *value)
else
driver->rna_path= NULL;
}
-#endif
+
static void rna_FCurve_RnaPath_get(PointerRNA *ptr, char *value)
{
@@ -92,7 +92,6 @@ static int rna_FCurve_RnaPath_length(PointerRNA *ptr)
return 0;
}
-#if 0
static void rna_FCurve_RnaPath_set(PointerRNA *ptr, const char *value)
{
FCurve *fcu= (FCurve *)ptr->data;
@@ -105,7 +104,6 @@ static void rna_FCurve_RnaPath_set(PointerRNA *ptr, const char *value)
else
fcu->rna_path= NULL;
}
-#endif
#else
@@ -139,7 +137,6 @@ void rna_def_channeldriver(BlenderRNA *brna)
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 @@ void rna_def_fcurve(BlenderRNA *brna)
/* 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 */
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index 160c0294f7f..1559144e9e5 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -57,20 +57,18 @@ static int rna_ksPath_RnaPath_length(PointerRNA *ptr)
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 @@ void rna_def_keyingset_path(BlenderRNA *brna)
/* 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 */