From 230a2e62f09f3e9c18aa585231985023a7c270bb Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 24 Mar 2010 12:48:03 +0000 Subject: Keying Sets - PyAPI consistency issues: * Added 'id_name' property, which is used as the "typeinfo_name" by Keying Set instances. This is simply the name of the relevant KeyingSetInfo classes. * Renamed the 'array_index' arg for ks.add_path() to 'index'. Also removed the 'entire array' toggle arg in favour of just passing -1 to index. However, Keying Sets in general still maintain their 'entire array' toggle flags for now, it's just that the API function does conversion between the two. --- source/blender/makesrna/intern/rna_animation_api.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/blender/makesrna/intern/rna_animation_api.c') diff --git a/source/blender/makesrna/intern/rna_animation_api.c b/source/blender/makesrna/intern/rna_animation_api.c index b4a0c457c8e..d70370be68d 100644 --- a/source/blender/makesrna/intern/rna_animation_api.c +++ b/source/blender/makesrna/intern/rna_animation_api.c @@ -41,19 +41,20 @@ #include "BKE_animsys.h" static KS_Path *rna_KeyingSet_add_path(KeyingSet *keyingset, ReportList *reports, - ID *id, char rna_path[], int array_index, int entire_array, - int grouping_method, char group_name[]) + ID *id, char rna_path[], int index, int grouping_method, char group_name[]) { KS_Path *ksp = NULL; short flag = 0; - /* validate flags */ - if (entire_array) + /* special case when index = -1, we key the whole array (as with other places where index is used) */ + if (index == -1) { flag |= KSP_FLAG_WHOLE_ARRAY; + index = 0; + } /* if data is valid, call the API function for this */ if (keyingset) { - ksp= BKE_keyingset_add_path(keyingset, id, group_name, rna_path, array_index, flag, grouping_method); + ksp= BKE_keyingset_add_path(keyingset, id, group_name, rna_path, index, flag, grouping_method); keyingset->active_path= BLI_countlist(&keyingset->paths); } else { @@ -100,9 +101,8 @@ void RNA_api_keyingset(StructRNA *srna) /* rna-path */ parm= RNA_def_string(func, "data_path", "", 256, "Data-Path", "RNA-Path to destination property."); // xxx hopefully this is long enough RNA_def_property_flag(parm, PROP_REQUIRED); - parm=RNA_def_int(func, "array_index", 0, 0, INT_MAX, "Array Index", "If applicable, the index ", 0, INT_MAX); - /* flags */ - parm=RNA_def_boolean(func, "entire_array", 1, "Entire Array", "When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), entire array is to be used."); + /* index (defaults to -1 for entire array) */ + parm=RNA_def_int(func, "index", -1, 0, INT_MAX, "Index", "The index of the destination property (i.e. axis of Location/Rotation/etc.), or -1 for the entire array.", 0, INT_MAX); /* grouping */ parm=RNA_def_enum(func, "grouping_method", keyingset_path_grouping_items, KSP_GROUP_KSNAME, "Grouping Method", "Method used to define which Group-name to use."); parm=RNA_def_string(func, "group_name", "", 64, "Group Name", "Name of Action Group to assign destination to (only if grouping mode is to use this name)."); -- cgit v1.2.3