namespace improvement

1.5.8

- feat: Namespace improvement:
  - new suffixes list that generate suffix buttons
  - dynamic layer name field that show active (msgbus)
  - possible to disable the panel with an option
This commit is contained in:
Pullusb
2021-07-20 18:53:39 +02:00
parent 9612c84396
commit 212436c451
5 changed files with 137 additions and 44 deletions
+15 -2
View File
@@ -8,7 +8,7 @@ from bpy.props import (
)
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:
@@ -16,6 +16,18 @@ def change_edit_lines_opacity(self, context):
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(
@@ -168,7 +180,8 @@ class GP_PG_ToolsSettings(bpy.types.PropertyGroup):
layer_name : StringProperty(
name="Layer Name",
description="The layer name, should describe the content of the layer",
default="")# update=None, get=None, set=None
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)