From 3e56dd8fd9210735c654661c8ada5a5f92623826 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Wed, 19 Aug 2020 15:30:38 +0200 Subject: [PATCH] GPencil: Change default Onion Keyframe mode to ALL Now by default the selection mode is All keyframes types. Also removed the icon for All option and renamed from `All Types`to `All`. UI review by @pablovazquez --- .../bl_app_templates_system/2D_Animation/__init__.py | 7 +++++++ source/blender/blenkernel/intern/gpencil.c | 1 + source/blender/makesrna/intern/rna_gpencil.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/release/scripts/startup/bl_app_templates_system/2D_Animation/__init__.py b/release/scripts/startup/bl_app_templates_system/2D_Animation/__init__.py index 009cb65d150..1892bea41f7 100644 --- a/release/scripts/startup/bl_app_templates_system/2D_Animation/__init__.py +++ b/release/scripts/startup/bl_app_templates_system/2D_Animation/__init__.py @@ -55,6 +55,13 @@ def load_handler(dummy): space.shading.type = 'MATERIAL' space.shading.use_scene_world = True + # Grease pencil object + scene = bpy.data.scenes[0] + if scene: + for ob in scene.objects: + if ob.type == 'GPENCIL': + gpd = ob.data + gpd.onion_keyframe_type = 'ALL' def register(): bpy.app.handlers.load_factory_startup_post.append(load_handler) diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 09305434289..4f65f8a57ab 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -532,6 +532,7 @@ bGPdata *BKE_gpencil_data_addnew(Main *bmain, const char name[]) gpd->grid.lines = GP_DEFAULT_GRID_LINES; /* Number of lines */ /* Onion-skinning settings (data-block level) */ + gpd->onion_keytype = -1; /* All by default. */ gpd->onion_flag |= (GP_ONION_GHOST_PREVCOL | GP_ONION_GHOST_NEXTCOL); gpd->onion_flag |= GP_ONION_FADE; gpd->onion_mode = GP_ONION_MODE_RELATIVE; diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index c8d16ab65cc..9bcf2b81557 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -106,7 +106,7 @@ static const EnumPropertyItem rna_enum_keyframe_type_items[] = { }; static const EnumPropertyItem rna_enum_onion_keyframe_type_items[] = { - {-1, "ALL", ICON_ACTION, "All Types", "Include all Keyframe types"}, + {-1, "ALL", 0, "All", "Include all Keyframe types"}, {BEZT_KEYTYPE_KEYFRAME, "KEYFRAME", ICON_KEYTYPE_KEYFRAME_VEC,