diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-12-23 17:58:42 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-12-23 17:58:42 +0400 |
commit | 789b2acd772c2856a09017972e9cc7278f60c4ab (patch) | |
tree | 757db2f996ce41ca3407bd64f9fcdf10f65ba41d /source/blender/makesrna | |
parent | 851cb9b3455369fb9796e3c27e05e5e88f4f36b0 (diff) |
Add keying "options" parameter to keyframe_insert() bpy_rna function, so now you can enable 'INSERTKEY_NEEDED', 'INSERTKEY_VISUAL' and/or 'INSERTKEY_XYZ_TO_RGB' when you directly key some property from python script (previously those options were only available through keyingsets).
Thanks to Campbell for review!
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/RNA_enum_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_animation.c | 25 |
2 files changed, 15 insertions, 11 deletions
diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index 0f9a00de7b6..9d08cf2d364 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -70,6 +70,7 @@ extern EnumPropertyItem keyframe_handle_type_items[]; extern EnumPropertyItem keyblock_type_items[]; extern EnumPropertyItem keyingset_path_grouping_items[]; +extern EnumPropertyItem keying_flag_items[]; extern EnumPropertyItem keyframe_paste_offset_items[]; extern EnumPropertyItem keyframe_paste_merge_items[]; diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 7229dddf6d6..402d05a20b6 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -52,6 +52,20 @@ EnumPropertyItem keyingset_path_grouping_items[] = { {0, NULL, 0, NULL, NULL} }; +/* It would be cool to get rid of this 'INSERTKEY_' prefix in 'py strings' values, but it would break existing + * exported keyingset... :/ + */ +EnumPropertyItem keying_flag_items[] = { + {INSERTKEY_NEEDED, "INSERTKEY_NEEDED", 0, "Only Needed", + "Only insert keyframes where they're needed in the relevant F-Curves"}, + {INSERTKEY_MATRIX, "INSERTKEY_VISUAL", 0, "Visual Keying", + "Insert keyframes based on 'visual transforms'"}, + {INSERTKEY_XYZ2RGB, "INSERTKEY_XYZ_TO_RGB", 0, "XYZ=RGB Colors", + "Color for newly added transformation F-Curves (Location, Rotation, Scale) " + "and also Color is based on the transform axis"}, + {0, NULL, 0, NULL, NULL} +}; + #ifdef RNA_RUNTIME #include "BLI_math_base.h" @@ -518,17 +532,6 @@ static void rna_def_common_keying_flags(StructRNA *srna, short UNUSED(reg)) { PropertyRNA *prop; - static EnumPropertyItem keying_flag_items[] = { - {INSERTKEY_NEEDED, "INSERTKEY_NEEDED", 0, "Only Needed", - "Only insert keyframes where they're needed in the relevant F-Curves"}, - {INSERTKEY_MATRIX, "INSERTKEY_VISUAL", 0, "Visual Keying", - "Insert keyframes based on 'visual transforms'"}, - {INSERTKEY_XYZ2RGB, "INSERTKEY_XYZ_TO_RGB", 0, "XYZ=RGB Colors", - "Color for newly added transformation F-Curves (Location, Rotation, Scale) " - "and also Color is based on the transform axis"}, - {0, NULL, 0, NULL, NULL} - }; - prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "keyingflag"); RNA_def_property_enum_items(prop, keying_flag_items); |