Select tool prop to dix prop group and UI change

gpv2
Pullusb 2021-06-24 16:40:22 +02:00
parent 0740e835d8
commit 15aec65b19
3 changed files with 28 additions and 37 deletions

View File

@ -78,14 +78,13 @@ class GPTB_OT_file_checker(bpy.types.Operator):
if hasattr(area.spaces[0], 'show_locked_time'):
setattr(area.spaces[0], 'show_locked_time', True)
## set cursor type (according to prefs ?)
if fix.set_cursor_type:
if context.mode in ("EDIT_GPENCIL", "SCULPT_GPENCIL"):
tool = prefs.select_active_tool
if tool != 'none':
if bpy.context.workspace.tools.from_space_view3d_mode(bpy.context.mode, create=False).idname != tool:
bpy.ops.wm.tool_set_by_id(name=tool)# Tweaktoolcode
problems.append(f'tool changed to {tool.split(".")[1]}')
## set cursor type
if context.mode in ("EDIT_GPENCIL", "SCULPT_GPENCIL"):
tool = fix.select_active_tool
if tool != 'none':
if bpy.context.workspace.tools.from_space_view3d_mode(bpy.context.mode, create=False).idname != tool:
bpy.ops.wm.tool_set_by_id(name=tool)# Tweaktoolcode
problems.append(f'tool changed to {tool.split(".")[1]}')
# ## GP use additive drawing (else creating a frame in dopesheet makes it blank...)
# if not context.scene.tool_settings.use_gpencil_draw_additive:

View File

@ -247,19 +247,6 @@ class GPTB_prefs(bpy.types.AddonPreferences):
default=False,
)
## default active tool to use
select_active_tool : EnumProperty(
name="Default selection tool", description="Active tool to set when launching check fix scene",
default='builtin.select_lasso',
items=(
('none', 'Dont change', 'Let the current active tool without change', 0),#'MOUSE_RMB'
('builtin.select', 'Select tweak', 'Use active select tweak active tool', 1),#'MOUSE_RMB'
('builtin.select_box', 'Select box', 'Use active select box active tool', 2),#'MOUSE_LMB'
('builtin.select_circle', 'Select circle', 'Use active select circle active tool', 3),#'MOUSE_MMB'
('builtin.select_lasso', 'Select lasso', 'Use active select lasso active tool', 4),#'MOUSE_MMB'
))
## render settings
render_obj_exclusion : StringProperty(
name="GP obj exclude filter",
@ -356,6 +343,9 @@ class GPTB_prefs(bpy.types.AddonPreferences):
row.prop(self, 'render_res_x', text='Width')
row.prop(self, 'render_res_y', text='Height')
box.prop(self, 'use_relative_remap_on_save')
box.prop(self, "render_obj_exclusion", icon='FILTER')#
subbox = box.box()
subbox.label(text='Project folders:')
@ -376,8 +366,6 @@ class GPTB_prefs(bpy.types.AddonPreferences):
subbox.prop(self, 'separator')
subbox.prop(self, 'prefixes')
box.prop(self, 'use_relative_remap_on_save')
### TODO add render settings
# layout.separator()## Playblast
@ -421,15 +409,6 @@ class GPTB_prefs(bpy.types.AddonPreferences):
box.label(text="No Jump hotkey auto set. Following operators needs to be set manually", icon="ERROR")
box.label(text="screen.gp_keyframe_jump - preferably in 'screen' category to jump from any editor")
## Active tool
box = layout.box()
box.label(text='Autofix check button options:')
box.prop(self, "select_active_tool", icon='RESTRICT_SELECT_OFF')
box.prop(self, "render_obj_exclusion", icon='FILTER')#
box = layout.box()
box.label(text='Tools options:')
box.prop(self, 'use_precise_eraser')
@ -486,6 +465,7 @@ class GPTB_prefs(bpy.types.AddonPreferences):
col.prop(self.fixprops, 'disable_guide')
col.prop(self.fixprops, 'list_disabled_anim')
col.prop(self.fixprops, 'autokey_add_n_replace')
col.prop(self.fixprops, "select_active_tool", icon='RESTRICT_SELECT_OFF')
# row.label(text='lock the active camera if not a draw cam (and if not "layout" in blendfile name)')
if self.pref_tabs == 'UPDATE':

View File

@ -42,11 +42,6 @@ class GP_PG_FixSettings(bpy.types.PropertyGroup):
description="Toggle on the use of show slider and sync range",
default=True, options={'HIDDEN'})
set_cursor_type : BoolProperty(
name="Set Select Cursor Mode",
description="Set the type of the selection cursor (according to addon prefs)",
default=True, options={'HIDDEN'})
check_front_axis : BoolProperty(
name="Check If Draw Axis is Front (X-Z)",
description="Alert if the current grease pencil draw axis is not front (X-Z)",
@ -77,6 +72,23 @@ class GP_PG_FixSettings(bpy.types.PropertyGroup):
description="Change autokey mode back to 'Add & Replace'",
default=True, options={'HIDDEN'})
# set_cursor_type : BoolProperty(
# name="Set Select Cursor Mode",
# description="Set the type of the selection cursor (according to addon prefs)",
# default=True, options={'HIDDEN'})
## default active tool to use
select_active_tool : EnumProperty(
name="Default selection tool", description="Active tool to set when launching check fix scene",
default='builtin.select_lasso',
items=(
('none', 'Dont change', 'Let the current active tool without change', 0),#'MOUSE_RMB'
('builtin.select', 'Select tweak', 'Use active select tweak active tool', 1),#'MOUSE_RMB'
('builtin.select_box', 'Select box', 'Use active select box active tool', 2),#'MOUSE_LMB'
('builtin.select_circle', 'Select circle', 'Use active select circle active tool', 3),#'MOUSE_MMB'
('builtin.select_lasso', 'Select lasso', 'Use active select lasso active tool', 4),#'MOUSE_MMB'
))
class GP_PG_ToolsSettings(bpy.types.PropertyGroup):
eraser_radius : IntProperty(
name="Eraser Radius", description="Radius of eraser brush",