diff options
author | Joshua Leung <aligorith@gmail.com> | 2015-01-26 09:15:46 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2015-01-26 09:19:33 +0300 |
commit | 8db4a24e4efc6d94e69e790a1ce3179f2e9948e7 (patch) | |
tree | 1b3db1be1fd90b3797681755f7256f4f90289b6b /source/blender/makesrna/intern/rna_animation.c | |
parent | 146a0e94477372f3dc5e52902cc99aba642c5a9c (diff) |
Bugfix T43343: Buttons for Keyframing Settings are Mutually Exclusive
Since 1c3f2354f83b3e79dee31d837ca4d7c08d2c3f26 the keyframing settings on
Keying Sets have been incorrectly displayed as a clump of toggle buttons,
which are usually only used when only one of the options apply.
Reverting this back to how it was, while leaving bl_options in place still for
the one case where it makes sense to do it that way (i.e. for KeyingSetInfo)
Diffstat (limited to 'source/blender/makesrna/intern/rna_animation.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_animation.c | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 12fa754e636..8e1d4c0e333 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -554,16 +554,24 @@ static FCurve *rna_Driver_from_existing(AnimData *adt, bContext *C, FCurve *src_ #else /* helper function for Keying Set -> keying settings */ -/* TODO: use reg option! */ -static void rna_def_common_keying_flags(StructRNA *srna, short UNUSED(reg)) +static void rna_def_common_keying_flags(StructRNA *srna, short reg) { PropertyRNA *prop; - - 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); - RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL | PROP_ENUM_FLAG); - RNA_def_property_ui_text(prop, "Options", "Keying set options"); + + prop = RNA_def_property(srna, "use_insertkey_needed", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_NEEDED); + RNA_def_property_ui_text(prop, "Insert Keyframes - Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves"); + if (reg) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); + + prop = RNA_def_property(srna, "use_insertkey_visual", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_MATRIX); + RNA_def_property_ui_text(prop, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'"); + if (reg) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); + + prop = RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_XYZ2RGB); + RNA_def_property_ui_text(prop, "F-Curve Colors - XYZ to RGB", "Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis"); + if (reg) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); } /* --- */ @@ -610,7 +618,20 @@ static void rna_def_keyingset_info(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); RNA_def_property_ui_text(prop, "Description", "A short description of the keying set"); - rna_def_common_keying_flags(srna, 1); /* '1' arg here is to indicate that we need these to be set on registering */ + /* Regarding why we don't use rna_def_common_keying_flags() here: + * - Using it would keep this case in sync with the other places + * where these options are exposed (which are optimised for being + * used in the UI). + * - Unlike all the other places, this case is used for defining + * new "built in" Keying Sets via the Python API. In that case, + * it makes more sense to expose these in a way more similar to + * other places featuring bl_idname/label/description (i.e. operators) + */ + 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); + RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL | PROP_ENUM_FLAG); + RNA_def_property_ui_text(prop, "Options", "Keying Set options to use when inserting keyframes"); RNA_define_verify_sdna(1); |