diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-10-30 12:57:46 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-11-09 13:11:05 +0300 |
commit | ad85256e71081016fe7b4009f8a0c0cd7e18dafe (patch) | |
tree | cd0eb7f225c2282d4be71d5f9ff55553d1cf0207 /source/blender/makesrna | |
parent | 25375c769a158c54396f60b9ceecd3c267871f3e (diff) |
Animation: move group colors switch to user preferences
Move the "Show Group Colors" toggle from a per-editor option to a single
user preference in the Animation preferences. The Grease Pencil
animation channel side panel allows picking a channel color; this now
shows a message when channel colors are disabled.
The old "Show Group Colors" toggle had to be set per editor, and was on
by default. This meant that disabling group colors would require an
action for every file, for every editor. It is very hard to select a
color that works both as bone color in the 3D Viewport (needs to be
bright there) as well as the channel list (needs to be dark there), most
animators turn channel list colors off.
Differential Revision: https://developer.blender.org/D9391
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 17 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 18 |
2 files changed, 18 insertions, 17 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index e0ee33bd234..0f4904e5e8f 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -5175,15 +5175,6 @@ static void rna_def_space_dopesheet(BlenderRNA *brna) "(Action and Shape Key Editors only)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL); - prop = RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWGCOLORS); - RNA_def_property_ui_text( - prop, - "Show Group Colors", - "Display groups and channels with colors matching their corresponding groups " - "(pose bones only currently)"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL); - prop = RNA_def_property(srna, "show_interpolation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SHOW_INTERPOLATION); RNA_def_property_ui_text(prop, @@ -5351,14 +5342,6 @@ static void rna_def_space_graph(BlenderRNA *brna) "(disable for better performance)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); - prop = RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWGCOLORS); - RNA_def_property_ui_text( - prop, - "Show Group Colors", - "Display groups and channels with colors matching their corresponding groups"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); - prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SHOW_MARKERS); RNA_def_property_ui_text( diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 932aa260bd5..2ae084d5a5d 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -409,6 +409,15 @@ static void rna_userdef_autokeymode_set(PointerRNA *ptr, int value) } } +static void rna_userdef_anim_update(Main *UNUSED(bmain), + Scene *UNUSED(scene), + PointerRNA *UNUSED(ptr)) +{ + WM_main_add_notifier(NC_SPACE | ND_SPACE_GRAPH, NULL); + WM_main_add_notifier(NC_SPACE | ND_SPACE_DOPESHEET, NULL); + USERDEF_TAG_DIRTY; +} + static void rna_userdef_tablet_api_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) @@ -4994,6 +5003,15 @@ static void rna_def_userdef_edit(BlenderRNA *brna) "Color for newly added transformation F-Curves (Location, Rotation, Scale) " "and also Color is based on the transform axis"); + prop = RNA_def_property(srna, "use_anim_channel_group_colors", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "animation_flag", USER_ANIM_SHOW_CHANNEL_GROUP_COLORS); + RNA_def_property_ui_text( + prop, + "Channel Group Colors", + "Use animation channel group colors; generally this is used to show bone group colors"); + RNA_def_property_boolean_default(prop, true); + RNA_def_property_update(prop, 0, "rna_userdef_anim_update"); + prop = RNA_def_property(srna, "fcurve_new_auto_smoothing", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_enum_fcurve_auto_smoothing_items); RNA_def_property_enum_sdna(prop, NULL, "auto_smoothing_new"); |