diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-05-14 17:31:15 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-05-14 17:31:51 +0300 |
commit | e58525706328f902baaa0252cb28b4a33534259c (patch) | |
tree | 65cda9ea75bb53641adf7d0ea05b59194d8a940c /release/scripts/startup/bl_app_templates_system/2D_Animation | |
parent | b7386c66f9fdd8b6a3139c1ea4a4256c9729aab5 (diff) |
GPencil: Changes in 2D template
Differential Revision: https://developer.blender.org/D7619
Diffstat (limited to 'release/scripts/startup/bl_app_templates_system/2D_Animation')
-rw-r--r-- | release/scripts/startup/bl_app_templates_system/2D_Animation/__init__.py | 46 |
1 files changed, 46 insertions, 0 deletions
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 new file mode 100644 index 00000000000..62c1edbee85 --- /dev/null +++ b/release/scripts/startup/bl_app_templates_system/2D_Animation/__init__.py @@ -0,0 +1,46 @@ +# Initialization script for 2D Animation template + +import bpy +from bpy.app.handlers import persistent + + +@persistent +def load_handler(dummy): + import bpy + + # 2D Animation + screen = bpy.data.screens['2D Animation'] + if screen: + for area in screen.areas: + # Set Tool settings as default in properties panel. + if area.type == 'PROPERTIES': + for space in area.spaces: + if space.type != 'PROPERTIES': + continue + space.context = 'TOOL' + + # Open sidebar in Dopesheet. + elif area.type == 'DOPESHEET_EDITOR': + for space in area.spaces: + if space.type != 'DOPESHEET_EDITOR': + continue + space.show_region_ui = True + + # 2D Full Canvas + screen = bpy.data.screens['2D Full Canvas'] + if screen: + for area in screen.areas: + if area.type == 'VIEW_3D': + for space in area.spaces: + if space.type != 'VIEW_3D': + continue + space.shading.type = 'MATERIAL' + space.shading.use_scene_world = True + + +def register(): + bpy.app.handlers.load_factory_startup_post.append(load_handler) + + +def unregister(): + bpy.app.handlers.load_factory_startup_post.remove(load_handler) |