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)
204 lines
8.5 KiB
Python
Executable File
204 lines
8.5 KiB
Python
Executable File
import bpy
|
|
from bpy.props import (
|
|
IntProperty,
|
|
BoolProperty,
|
|
StringProperty,
|
|
FloatProperty,
|
|
EnumProperty,
|
|
)
|
|
|
|
from .OP_cursor_snap_canvas import cursor_follow_update
|
|
from .OP_layer_manager import layer_name_build
|
|
|
|
def change_edit_lines_opacity(self, context):
|
|
for gp in bpy.data.grease_pencils:
|
|
if not gp.is_annotation:
|
|
gp.edit_line_color[3]=self.edit_lines_opacity
|
|
|
|
|
|
def update_layer_name(self, context):
|
|
if not self.layer_name:
|
|
# never replace by nothing (since there should be prefix/suffix)
|
|
return
|
|
if not context.object or context.object.type != 'GPENCIL':
|
|
return
|
|
if not context.object.data.layers.active:
|
|
return
|
|
layer_name_build(context.object.data.layers.active, desc=self.layer_name)
|
|
# context.object.data.layers.active.info = self.layer_name
|
|
|
|
|
|
class GP_PG_FixSettings(bpy.types.PropertyGroup):
|
|
|
|
check_only : BoolProperty(
|
|
name="Dry run mode (Check only)",
|
|
description="Do not change anything, just print the messages",
|
|
default=False, options={'HIDDEN'})
|
|
|
|
lock_main_cam : BoolProperty(
|
|
name="Lock Main Cam",
|
|
description="Lock the main camera (works only if 'layout' is not in name)",
|
|
default=False, options={'HIDDEN'})
|
|
|
|
set_scene_res : BoolProperty(
|
|
name="Reset Scene Resolution",
|
|
description="Set the scene resolution to current prefs project settings",
|
|
default=False, options={'HIDDEN'})
|
|
|
|
set_res_percentage : BoolProperty(
|
|
name="Reset Resolution Percentage To 100%",
|
|
description="",
|
|
default=True, options={'HIDDEN'})
|
|
|
|
set_fps : BoolProperty(
|
|
name="Reset Fps",
|
|
description="Set the framerate of the scene to current prefs project settings",
|
|
default=False, options={'HIDDEN'})
|
|
|
|
set_slider_n_sync : BoolProperty(
|
|
name="Dopesheets Show Slider And Sync Range",
|
|
description="Toggle on the use of show slider and sync range",
|
|
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)",
|
|
default=True, options={'HIDDEN'})
|
|
|
|
check_placement : BoolProperty(
|
|
name="Check Stroke Placement",
|
|
description="Alert if the current grease pencil stroke placement is not Origin",
|
|
default=True, options={'HIDDEN'})
|
|
|
|
set_pivot_median_point : BoolProperty(
|
|
name="Set Pivot To Median Point",
|
|
description="Change the pivot point to the most used median point",
|
|
default=True, options={'HIDDEN'})
|
|
|
|
disable_guide : BoolProperty(
|
|
name="Disable Drawing Guide",
|
|
description="Disable constrained guide in draw mode",
|
|
default=False, options={'HIDDEN'})
|
|
|
|
list_disabled_anim : BoolProperty(
|
|
name="List Disabled Animation",
|
|
description="Alert if there are disabled animations",
|
|
default=True, options={'HIDDEN'})
|
|
|
|
autokey_add_n_replace : BoolProperty(
|
|
name="Autokey Mode Add and Replace",
|
|
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="Set 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'
|
|
))
|
|
|
|
## check file path mapping type
|
|
file_path_type : EnumProperty(
|
|
name="Check File Path Mapping", description="Check if all path in scene are relative, absolute or disable the check",
|
|
default='RELATIVE',
|
|
items=(
|
|
('none', 'No Check', 'Do not check for path type', 0),
|
|
('RELATIVE', 'Relative', 'Check if all path are relative', 1),
|
|
('ABSOLUTE', 'Absolute', 'Check if all path are absolute', 2),
|
|
))
|
|
|
|
## check set lock object mode
|
|
lock_object_mode : EnumProperty(
|
|
name="Set Lock Object Mode", description="Set 'Lock object mode' parameter check'",
|
|
default='none',
|
|
items=(
|
|
('none', 'Do nothing', 'Do not set', 0),
|
|
('LOCK', 'Lock object mode', 'Toggle lock object mode On', 1),
|
|
('UNLOCK', 'Unlock object mode', 'Toggle lock object mode Off', 2),
|
|
))
|
|
|
|
class GP_PG_ToolsSettings(bpy.types.PropertyGroup):
|
|
eraser_radius : IntProperty(
|
|
name="Eraser Radius", description="Radius of eraser brush",
|
|
default=20, min=0, max=500, subtype='PIXEL')
|
|
|
|
drawcam_passepartout : BoolProperty(
|
|
name="Show cam passepartout",
|
|
description="Show a darkened overlay outside image area in Camera view",
|
|
default=True,
|
|
options={'HIDDEN'})
|
|
|
|
autotint_offset : IntProperty(
|
|
name="Tint hue offset", description="offset the tint by this value for better color",
|
|
default=0, min=-5000, max=5000, soft_min=-999, soft_max=999, step=1,
|
|
options={'HIDDEN'})#, subtype='PERCENTAGE'
|
|
|
|
autotint_namespace : BoolProperty(
|
|
name="Use prefix", description="Put same color on layers unsing the same prefix (separated by '_') of full name withjout separator",
|
|
default=True,
|
|
options={'HIDDEN'})
|
|
|
|
resolution_percentage: IntProperty(
|
|
name="Resolution %", description="Overrides resolution percentage for playblast",
|
|
default = 50, min=1, max= 100, subtype='PERCENTAGE')#, precision=0
|
|
|
|
cursor_follow : BoolProperty(
|
|
name='Cursor Follow', description="3D cursor follow active object animation when activated",
|
|
default=False, update=cursor_follow_update)
|
|
|
|
edit_lines_opacity : FloatProperty(
|
|
name="Edit Lines Opacity", description="Change edit lines opacity for all grease pencils",
|
|
default=0.5, min=0.0, max=1.0, step=3, precision=2, update=change_edit_lines_opacity)
|
|
|
|
## render
|
|
name_for_current_render : StringProperty(
|
|
name="Render_name", description="Name use for render current",
|
|
default="")
|
|
|
|
keyframe_type : EnumProperty(
|
|
name="Keyframe Filter", description="Only jump to defined keyframe type",
|
|
default='ALL', options={'HIDDEN', 'SKIP_SAVE'},
|
|
items=(
|
|
('ALL', 'All', '', 0), # 'KEYFRAME'
|
|
('KEYFRAME', 'Keyframe', '', 'KEYTYPE_KEYFRAME_VEC', 1),
|
|
('BREAKDOWN', 'Breakdown', '', 'KEYTYPE_BREAKDOWN_VEC', 2),
|
|
('MOVING_HOLD', 'Moving Hold', '', 'KEYTYPE_MOVING_HOLD_VEC', 3),
|
|
('EXTREME', 'Extreme', '', 'KEYTYPE_EXTREME_VEC', 4),
|
|
('JITTER', 'Jitter', '', 'KEYTYPE_JITTER_VEC', 5),
|
|
))
|
|
|
|
layer_name : StringProperty(
|
|
name="Layer Name",
|
|
description="The layer name, should describe the content of the layer",
|
|
default="",
|
|
update=update_layer_name)# update=None, get=None, set=None
|
|
"""
|
|
reconnect_parent = bpy.props.PointerProperty(type =bpy.types.Object,poll=poll_armature)
|
|
render_settings = bpy.props.BoolProperty(default = False)
|
|
render_color = bpy.props.BoolProperty(default = True)
|
|
render_contour = bpy.props.BoolProperty(default = False)
|
|
precision = bpy.props.IntProperty(default = 75,subtype = 'PERCENTAGE',min=0,max=100)
|
|
|
|
border_render = bpy.props.BoolProperty(default = False)
|
|
|
|
spacialize = bpy.props.BoolProperty(default = False)
|
|
depth = bpy.props.FloatProperty(default = 2.0)
|
|
|
|
extra_tools = bpy.props.BoolProperty(default = False)
|
|
enable_ob_filter = bpy.props.BoolProperty(default = False)
|
|
auto_cursor = bpy.props.BoolProperty(default = True)
|
|
|
|
opacity_layers = bpy.props.FloatProperty(min=0,max=1,default = 1,update = update_layers_opacity)
|
|
|
|
stroke_select = bpy.props.EnumProperty(items = [("POINT","Point",""),("STROKE","Stroke","")],update = update_selection_mode)
|
|
""" |