GPencil: Changes in 2D template

Differential Revision: https://developer.blender.org/D7619
This commit is contained in:
Antonio Vazquez 2020-05-14 16:31:15 +02:00
parent b7386c66f9
commit e585257063
Notes: blender-bot 2023-02-14 05:59:31 +01:00
Referenced by commit 0d57ab611c, Fix T76851: GPencil brush is reset after change mode
Referenced by issue #76851, Grease Pencil Behavior changes Brush when going in and out of Drawing mode
Referenced by issue #76400, 2D Animation Template updates for 2.83
2 changed files with 47 additions and 2 deletions

View File

@ -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)

View File

@ -1423,6 +1423,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_select(Panel, View3DPanel, GreasePenci
class VIEW3D_PT_tools_grease_pencil_brush_settings(Panel, View3DPanel, GreasePencilPaintPanel):
bl_label = "Brush Settings"
bl_options = {'DEFAULT_CLOSED'}
# What is the point of brush presets? Seems to serve the exact same purpose as brushes themselves??
def draw_header_preset(self, _context):
@ -2105,7 +2106,6 @@ class VIEW3D_PT_tools_grease_pencil_brush_mixcolor(View3DPanel, Panel):
bl_context = ".greasepencil_paint"
bl_label = "Color"
bl_category = "Tool"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
@ -2165,7 +2165,6 @@ class VIEW3D_PT_tools_grease_pencil_brush_mix_palette(View3DPanel, Panel):
bl_label = "Palette"
bl_category = "Tool"
bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_mixcolor'
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):