stripped obsolete features and compacted UI

1.7.0

- remove: Obsolete operators and panels
  - Remove "line closer" panel as it's been a native tool for a while in 2.9x (stop register of `GP_guided_colorize > OP_line_closer`)
  - Remove "Render" subpanel, obsolete and not adapted to production
- ui: clean and refactor
  - Gp clipboard panel and aimation Manager subpanel layout to aligned columns (gain space)
  - add `GP` on each panel name for wuick eye search
  - follow cursor now in animation manager subpanel (should be in an extra menu or removed in the end)
This commit is contained in:
Pullusb
2021-10-20 13:56:01 +02:00
parent 8b838b52ca
commit f7e8dce0ff
7 changed files with 147 additions and 614 deletions
+68 -64
View File
@@ -36,7 +36,7 @@ class GPTB_PT_dataprop_panel(bpy.types.Panel):
## UI in Gpencil sidebar menu
class GPTB_PT_sidebar_panel(bpy.types.Panel):
bl_label = "Toolbox"
bl_label = "GP Toolbox"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Gpencil"
@@ -50,18 +50,18 @@ class GPTB_PT_sidebar_panel(bpy.types.Panel):
# addon_updater_ops.check_for_update_background()
# layout.label(text='View options:')
col = layout.column()
## flip X cam
if context.scene.camera and context.scene.camera.scale.x < 0:
# layout.label(text='! Flipped !')
row = layout.row(align=True)
row = col.row(align=True)
row.operator('gp.mirror_flipx', text = 'Mirror flip', icon = 'MOD_MIRROR')# ARROW_LEFTRIGHT
row.label(text='',icon='LOOP_BACK')
else:
layout.operator('gp.mirror_flipx', text = 'Mirror flip', icon = 'MOD_MIRROR')# ARROW_LEFTRIGHT
col.operator('gp.mirror_flipx', text = 'Mirror flip', icon = 'MOD_MIRROR')# ARROW_LEFTRIGHT
## draw/manipulation camera
col = layout.column()
if context.scene.camera and context.scene.camera.name.startswith(('draw', 'obj')):
row = col.row(align=True)
row.operator('gp.draw_cam_switch', text = 'Main cam', icon = 'OUTLINER_OB_CAMERA')
@@ -126,13 +126,11 @@ class GPTB_PT_sidebar_panel(bpy.types.Panel):
layout.operator('gp.straight_stroke', icon ="CURVE_PATH")
## Options
layout.separator()
layout.label(text = 'Options:')
col = layout.column()
col.label(text = 'Options:')
## Kf Jump filter
layout.prop(context.scene.gptoolprops, 'keyframe_type', text='Jump On') # Keyframe Jump
col = layout.column()
col.prop(context.scene.gptoolprops, 'keyframe_type', text='Jump On') # Keyframe Jump
# col.prop(context.space_data.overlay, 'use_gpencil_onion_skin') # not often used
if context.object and context.object.type == 'GPENCIL':
@@ -157,41 +155,18 @@ class GPTB_PT_sidebar_panel(bpy.types.Panel):
else:
col.label(text='No GP object selected')
col.prop(context.scene.gptoolprops, 'edit_lines_opacity')
row = col.row(align=True)
## realign / reproject
row.operator('gp.realign', icon='AXIS_FRONT')
## move in depth
row.operator('object.depth_proportional_move', text='Depth move', icon='TRANSFORM_ORIGINS')
## col.operator('gp.batch_reproject_all_frames') # text=Batch Reproject # added to context menu
## check drawing alignement
col.operator('gp.check_canvas_alignement', icon='DRIVER_ROTATIONAL_DIFFERENCE')
## Create empty frame on layer (ops stored under GP_colorize... might be best to separate in another panel )
col.operator('gp.create_empty_frames', icon='DECORATE_KEYFRAME')
## File checker
row = col.row(align=True)
row.operator('gp.file_checker', text = 'Check file', icon = 'SCENE_DATA')
row.operator('gp.links_checker', text = 'Check links', icon = 'UNLINKED')
text, icon = ('Cursor Follow On', 'PIVOT_CURSOR') if context.scene.gptoolprops.cursor_follow else ('Cursor Follow Off', 'CURSOR')
col.prop(context.scene.gptoolprops, 'cursor_follow', text=text, icon=icon)
# Mention update as notice
# addon_updater_ops.update_notice_box_ui(self, context)
# row = layout.row(align=False)
# row.label(text='arrow choice')
# row.operator("my_operator.multi_op", text='', icon='TRIA_LEFT').left = 1
# row.operator("my_operator.multi_op", text='', icon='TRIA_RIGHT').left = 0
class GPTB_PT_anim_manager(bpy.types.Panel):
bl_label = "Animation manager"
bl_label = "Animation Manager"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Gpencil"
@@ -204,11 +179,12 @@ class GPTB_PT_anim_manager(bpy.types.Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
col = layout.column()
## Animation enable disable anim (shift click to select) OP_helpers.GPTB_OT_toggle_mute_animation
layout.operator('gp.list_disabled_anims')
col.operator('gp.list_disabled_anims')
## Objs ()
row = layout.row(align=True)
row = col.row(align=True)
row.label(text='Obj anims:')
ops = row.operator('gp.toggle_mute_animation', text = 'ON')#, icon = 'GRAPH'
ops.skip_gp = True
@@ -220,7 +196,7 @@ class GPTB_PT_anim_manager(bpy.types.Panel):
ops.skip_obj = False
ops.mute = True
## Gps
row = layout.row(align=True)
row = col.row(align=True)
row.label(text='Gp anims:')
ops = row.operator('gp.toggle_mute_animation', text = 'ON')#, icon = 'GRAPH'
ops.skip_gp = False
@@ -232,6 +208,12 @@ class GPTB_PT_anim_manager(bpy.types.Panel):
ops.skip_obj = True
ops.mute = True
## This can go in an extra category...
col = layout.column()
col.use_property_split = False
text, icon = ('Cursor Follow On', 'PIVOT_CURSOR') if context.scene.gptoolprops.cursor_follow else ('Cursor Follow Off', 'CURSOR')
col.prop(context.scene.gptoolprops, 'cursor_follow', text=text, icon=icon)
class GPTB_PT_toolbox_playblast(bpy.types.Panel):
bl_label = "Playblast"
bl_space_type = "VIEW_3D"
@@ -255,17 +237,13 @@ class GPTB_PT_toolbox_playblast(bpy.types.Panel):
row.operator('render.playblast_anim', text = 'Viewport').use_view = True
class GPTB_PT_tint_layers(bpy.types.Panel):
bl_label = "Tint layers"
bl_label = "Tint Layers"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Gpencil"
bl_parent_id = "GPTB_PT_sidebar_panel"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return context.scene.camera
# def draw_header(self,context):
# self.layout.prop(context.scene.camera.data, "show_background_images", text="")
@@ -282,40 +260,65 @@ class GPTB_PT_tint_layers(bpy.types.Panel):
col.operator("gp.auto_tint_gp_layers", icon = "COLOR").reset = False
col.operator("gp.auto_tint_gp_layers", text = "Reset tint", icon = "COLOR").reset = True
class GPTB_PT_render(bpy.types.Panel):
bl_label = "Render"
class GPTB_PT_checker(bpy.types.Panel):
bl_label = "Checker"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Gpencil"
bl_parent_id = "GPTB_PT_sidebar_panel"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return context.scene.camera
# def draw_header(self,context):
# self.layout.prop(context.scene.camera.data, "show_background_images", text="")
def draw(self, context):
layout = self.layout
layout.operator('render.render_anim', text = 'Render invividually', icon = 'RENDERLAYERS').mode = 'INDIVIDUAL'#RENDER_STILL #RESTRICT_RENDER_OFF
layout.operator('render.render_anim', text = 'Render grouped', icon = 'IMAGE_RGB').mode = 'GROUP'
col = layout.column()
row = col.row(align=True)
## realign / reproject
row.operator('gp.realign', icon='AXIS_FRONT')
## move in depth
row.operator('object.depth_proportional_move', text='Depth move', icon='TRANSFORM_ORIGINS')
layout.separator()
row = layout.row()
row.prop(context.scene.gptoolprops, 'name_for_current_render', text = 'Output name')#icon = 'OUTPUT'
row.operator('render.use_active_object_name', text = '', icon='OUTLINER_DATA_GP_LAYER')#icon = 'OUTPUT'
## col.operator('gp.batch_reproject_all_frames') # text=Batch Reproject # added to context menu
## check drawing alignement
col.operator('gp.check_canvas_alignement', icon='DRIVER_ROTATIONAL_DIFFERENCE')
layout.operator('render.setup_render_path', text = 'Setup output', icon = 'TOOL_SETTINGS')#SETTINGS
blend = bpy.data.filepath
if blend:
blend = Path(blend)
out = blend.parents[1] / "compo" / "base"
layout.operator("wm.path_open", text='Open render folder', icon='FILE_FOLDER').filepath = str(out)
## File checker
row = col.row(align=True)
row.operator('gp.file_checker', text = 'Check file', icon = 'SCENE_DATA')
row.operator('gp.links_checker', text = 'Check links', icon = 'UNLINKED')
class GPTB_PT_color(bpy.types.Panel):
bl_label = "Color"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Gpencil"
bl_parent_id = "GPTB_PT_sidebar_panel"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
## Create empty frame on layer
layout.operator('gp.create_empty_frames', icon='DECORATE_KEYFRAME')
""" # unused : added in Animation Manager
class GPTB_PT_extra(bpy.types.Panel):
bl_label = "Extra"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Gpencil"
bl_parent_id = "GPTB_PT_sidebar_panel"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
col = layout.column()
text, icon = ('Cursor Follow On', 'PIVOT_CURSOR') if context.scene.gptoolprops.cursor_follow else ('Cursor Follow Off', 'CURSOR')
col.prop(context.scene.gptoolprops, 'cursor_follow', text=text, icon=icon)
"""
"""
## unused -- (integrated in sidebar_panel)
@@ -363,11 +366,12 @@ def palette_manager_menu(self, context):
classes = (
GPTB_PT_sidebar_panel,
GPTB_PT_checker,
GPTB_PT_anim_manager,
GPTB_PT_toolbox_playblast,
GPTB_PT_color,
GPTB_PT_tint_layers,
GPTB_PT_render,
## GPTB_PT_cam_ref_panel,
GPTB_PT_toolbox_playblast,
# GPTB_PT_extra,
)
def register():