diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-03-09 18:27:24 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-03-09 18:27:24 +0300 |
commit | 29f3af95272590d26f610ae828b2eeee89c82a00 (patch) | |
tree | a696a58a2561c48f7ec6166e369e22081e0a64d8 /release/scripts/startup/bl_ui/properties_data_modifier.py | |
parent | dcb93126876879d969a30a7865700abd072066f8 (diff) |
GPencil: Refactor of Draw Engine, Vertex Paint and all internal functions
This commit is a full refactor of the grease pencil modules including Draw Engine, Modifiers, VFX, depsgraph update, improvements in operators and conversion of Sculpt and Weight paint tools to real brushes.
Also, a huge code cleanup has been done at all levels.
Thanks to @fclem for his work and yo @pepeland and @mendio for the testing and help in the development.
Differential Revision: https://developer.blender.org/D6293
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_data_modifier.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_modifier.py | 551 |
1 files changed, 131 insertions, 420 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 603c873c290..9070aa5faee 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -1746,132 +1746,102 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel): # ...to avoid lengthy if statements # so each type must have a function here. - def GP_NOISE(self, layout, ob, md): + def gpencil_masking(self, layout, ob, md, use_vertex, use_curve=False): gpd = ob.data - split = layout.split() - - col = split.column() - row = col.row(align=True) - row.prop(md, "factor") - row.prop(md, "random", text="", icon='TIME', toggle=True) - row = col.row() - row.enabled = md.random - row.prop(md, "step") - row = col.row() - row.enabled = md.random - row.prop(md, "seed") - col.prop(md, "full_stroke") - col.prop(md, "move_extreme") - - row = layout.row(align=True) - row.label(text="Affect:") - row = layout.row(align=True) - row.prop(md, "use_edit_position", text="Position", icon='MESH_DATA', toggle=True) - row.prop(md, "use_edit_strength", text="Strength", icon='COLOR', toggle=True) - row.prop(md, "use_edit_thickness", text="Thickness", icon='LINE_DATA', toggle=True) - row.prop(md, "use_edit_uv", text="UV", icon='MOD_UVPROJECT', toggle=True) + layout.separator() + layout.label(text="Influence Filters:") - col = layout.column() - col.separator() - col.label(text="Vertex Group:") - row = col.row(align=True) - row.prop_search(md, "vertex_group", ob, "vertex_groups", text="") - row.prop(md, "invert_vertex", text="", icon='ARROW_LEFTRIGHT') + split = layout.split(factor=0.25) - col = layout.column() - col.separator() + col1 = split.column() - col.label(text="Material:") - row = col.row(align=True) - row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE') - row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "pass_index", text="Pass") - row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT') + col1.label(text="Layer:") + col1.label(text="Material:") + if use_vertex: + col1.label(text="Vertex Group:") - col = layout.column() - col.separator() + col2 = split.column() - col.label(text="Layer:") - row = col.row(align=True) + split = col2.split(factor=0.6) + row = split.row(align=True) row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL') row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) + + row = split.row(align=True) row.prop(md, "layer_pass", text="Pass") row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') - def GP_SMOOTH(self, layout, ob, md): - gpd = ob.data - col = layout.column() - col.prop(md, "factor") - col.prop(md, "step") + split = col2.split(factor=0.6) - col.label(text="Affect:") - row = col.row(align=True) - row.prop(md, "use_edit_position", text="Position", icon='MESH_DATA', toggle=True) - row.prop(md, "use_edit_strength", text="Strength", icon='COLOR', toggle=True) - row.prop(md, "use_edit_thickness", text="Thickness", icon='LINE_DATA', toggle=True) - row.prop(md, "use_edit_uv", text="UV", icon='MOD_UVPROJECT', toggle=True) - - col.separator() - col.label(text="Vertex Group:") - row = col.row(align=True) - row.prop_search(md, "vertex_group", ob, "vertex_groups", text="") - row.prop(md, "invert_vertex", text="", icon='ARROW_LEFTRIGHT') - - col = layout.column() - col.separator() - - col.label(text="Material:") - row = col.row(align=True) + row = split.row(align=True) row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE') row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) + + row = split.row(align=True) row.prop(md, "pass_index", text="Pass") row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT') - col = layout.column() - col.separator() + if use_vertex: + row = col2.row(align=True) + row.prop_search(md, "vertex_group", ob, "vertex_groups", text="") + row.prop(md, "invert_vertex", text="", icon='ARROW_LEFTRIGHT') - col.label(text="Layer:") - row = col.row(align=True) - row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL') - row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "layer_pass", text="Pass") - row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') + if use_curve: + col = layout.column() + col.separator() + col.prop(md, "use_custom_curve") + if md.use_custom_curve: + col.template_curve_mapping(md, "curve") - def GP_SUBDIV(self, layout, ob, md): - gpd = ob.data + def GP_NOISE(self, layout, ob, md): split = layout.split() col = split.column() row = col.row(align=True) - row.prop(md, "level") - row.prop(md, "simple", text="", icon='PARTICLE_POINT') + row.prop(md, "factor", text="Position") + row = col.row(align=True) + row.prop(md, "factor_strength", text="Strength") + row = col.row(align=True) + row.prop(md, "factor_thickness", text="Thickness") + row = col.row(align=True) + row.prop(md, "factor_uvs", text="UV") - col = layout.column() col.separator() - - col.label(text="Material:") row = col.row(align=True) + row.prop(md, "random", text="", icon='TIME', toggle=True) - row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE') - row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "pass_index", text="Pass") - row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT') + subrow = row.row(align=True) + subrow.enabled = md.random + subrow.prop(md, "step") + subrow.prop(md, "seed") - col = layout.column() col.separator() + col.prop(md, "noise_scale") - col.label(text="Layer:") + self.gpencil_masking(layout, ob, md, True, True) + + def GP_SMOOTH(self, layout, ob, md): + col = layout.column() + col.prop(md, "factor") + col.prop(md, "step", text="Repeat") + + col.label(text="Affect:") row = col.row(align=True) - row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL') - row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "layer_pass", text="Pass") - row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') + row.prop(md, "use_edit_position", text="Position", toggle=True) + row.prop(md, "use_edit_strength", text="Strength", toggle=True) + row.prop(md, "use_edit_thickness", text="Thickness", toggle=True) + row.prop(md, "use_edit_uv", text="UV", toggle=True) + + self.gpencil_masking(layout, ob, md, True, True) + + def GP_SUBDIV(self, layout, ob, md): + layout.row().prop(md, "subdivision_type", expand=True) + split = layout.split() + col = split.column() + row = col.row(align=True) + row.prop(md, "level", text="Subdivisions") + + self.gpencil_masking(layout, ob, md, False) def GP_SIMPLIFY(self, layout, ob, md): gpd = ob.data @@ -1893,77 +1863,21 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel): elif md.mode == 'MERGE': col.prop(md, "distance") - col = layout.column() - col.separator() - - col.label(text="Material:") - row = col.row(align=True) - row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE') - row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "pass_index", text="Pass") - row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT') - - col = layout.column() - col.separator() - - col.label(text="Layer:") - row = col.row(align=True) - row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL') - row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "layer_pass", text="Pass") - row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') + self.gpencil_masking(layout, ob, md, False) def GP_THICK(self, layout, ob, md): - gpd = ob.data - split = layout.split() - - col = split.column() - row = col.row(align=True) - row.prop(md, "thickness", text="Thickness Factor") - - col.prop(md, "normalize_thickness") - - if not md.normalize_thickness: - split = layout.split() - col = split.column() - col.prop(md, "use_custom_curve") - - if md.use_custom_curve: - col.template_curve_mapping(md, "curve") - - col = layout.column() - col.separator() - col.label(text="Vertex Group:") - row = col.row(align=True) - row.prop_search(md, "vertex_group", ob, "vertex_groups", text="") - row.prop(md, "invert_vertex", text="", icon='ARROW_LEFTRIGHT') - col = layout.column() - col.separator() - col.label(text="Material:") - row = col.row(align=True) - row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE') - row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "pass_index", text="Pass") - row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT') + col.prop(md, "normalize_thickness") - col = layout.column() - col.separator() + if md.normalize_thickness: + col.prop(md, "thickness") + else: + col.prop(md, "thickness_factor") - col.label(text="Layer:") - row = col.row(align=True) - row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL') - row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "layer_pass", text="Pass") - row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') + self.gpencil_masking(layout, ob, md, True, True) def GP_TINT(self, layout, ob, md): - gpd = ob.data split = layout.split() col = split.column() @@ -1971,30 +1885,9 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel): col.prop(md, "factor") row = layout.row() - row.prop(md, "create_materials") row.prop(md, "modify_color") - col = layout.column() - col.separator() - - col.label(text="Material:") - row = col.row(align=True) - row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE') - row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "pass_index", text="Pass") - row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT') - - col = layout.column() - col.separator() - - col.label(text="Layer:") - row = col.row(align=True) - row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL') - row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "layer_pass", text="Pass") - row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') + self.gpencil_masking(layout, ob, md, False, True) def GP_TIME(self, layout, ob, md): gpd = ob.data @@ -2040,7 +1933,6 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel): row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') def GP_COLOR(self, layout, ob, md): - gpd = ob.data split = layout.split() col = split.column() @@ -2050,134 +1942,66 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel): col.prop(md, "value", text="V", slider=True) row = layout.row() - row.prop(md, "create_materials") row.prop(md, "modify_color") - col = layout.column() - col.separator() - - col.label(text="Material:") - row = col.row(align=True) - row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE') - row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "pass_index", text="Pass") - row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT') - - col = layout.column() - col.separator() - - col.label(text="Layer:") - row = col.row(align=True) - row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL') - row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "layer_pass", text="Pass") - row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') + self.gpencil_masking(layout, ob, md, False, True) def GP_OPACITY(self, layout, ob, md): - gpd = ob.data split = layout.split() col = split.column() - col.label(text="Opacity:") - col.prop(md, "factor") - - row = layout.row() - row.prop(md, "opacity_mode", text="Mode") - - if md.opacity_mode == 'MATERIAL': - row = layout.row() - row.prop(md, "create_materials") - row.prop(md, "modify_color", text="Change") + col.prop(md, "normalize_opacity") + if md.normalize_opacity is True: + text="Strength" else: - col = layout.column() - col.separator() - col.label(text="Vertex Group:") - row = col.row(align=True) - row.prop_search(md, "vertex_group", ob, "vertex_groups", text="") - row.prop(md, "invert_vertex", text="", icon='ARROW_LEFTRIGHT') - - col = layout.column() - col.separator() - - col.label(text="Material:") - row = col.row(align=True) - row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE') - row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "pass_index", text="Pass") - row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT') + text="Opacity Factor" - col = layout.column() - col.separator() + col.prop(md, "factor", text=text) + col.prop(md, "modify_color") - col.label(text="Layer:") - row = col.row(align=True) - row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL') - row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "layer_pass", text="Pass") - row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') + self.gpencil_masking(layout, ob, md, True, True) def GP_ARRAY(self, layout, ob, md): - gpd = ob.data - col = layout.column() col.prop(md, "count") split = layout.split() col = split.column() - col.label(text="Offset:") - col.prop(md, "offset", text="") - col.prop(md, "offset_object", text="Object") + col.prop(md, "use_constant_offset", text="Constant Offset") + subcol = col.column() + subcol.enabled = md.use_constant_offset + subcol.prop(md, "constant_offset", text="") + + col.prop(md, "use_object_offset") + subcol = col.column() + subcol.enabled = md.use_object_offset + subcol.prop(md, "offset_object", text="") col = split.column() - col.label(text="Shift:") - col.prop(md, "shift", text="") + col.prop(md, "use_relative_offset", text="Relative Offset") + subcol = col.column() + subcol.enabled = md.use_relative_offset + subcol.prop(md, "relative_offset", text="") split = layout.split() col = split.column() - col.label(text="Rotation:") - col.prop(md, "rotation", text="") - col.separator() - row = col.row(align=True) - row.prop(md, "random_rot", text="", icon='TIME', toggle=True) - row.prop(md, "rot_factor", text="") + col.label(text="Random Offset:") + col.prop(md, "random_offset", text="") col = split.column() - col.label(text="Scale:") - col.prop(md, "scale", text="") - col.separator() - row = col.row(align=True) - row.prop(md, "random_scale", text="", icon='TIME', toggle=True) - row.prop(md, "scale_factor", text="") + col.label(text="Random Rotation:") + col.prop(md, "random_rotation", text="") - col = layout.column() - col.prop(md, "replace_material", text="Material") - col.prop(md, "keep_on_top", text="Keep original stroke on top") - - col = layout.column() - col.separator() - - col.label(text="Material:") - row = col.row(align=True) - row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE') - row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "pass_index", text="Pass") - row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT') + col = split.column() + col.label(text="Random Scale:") + col.prop(md, "random_scale", text="") col = layout.column() + col.prop(md, "seed") col.separator() + col.prop(md, "replace_material", text="Material Override") - col.label(text="Layer:") - row = col.row(align=True) - row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL') - row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "layer_pass", text="Pass") - row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') + self.gpencil_masking(layout, ob, md, False) def GP_BUILD(self, layout, ob, md): gpd = ob.data @@ -2215,7 +2039,6 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel): row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') def GP_LATTICE(self, layout, ob, md): - gpd = ob.data split = layout.split() col = split.column() @@ -2224,70 +2047,20 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel): layout.prop(md, "strength", slider=True) - col = layout.column() - col.separator() - col.label(text="Vertex Group:") - row = col.row(align=True) - row.prop_search(md, "vertex_group", ob, "vertex_groups", text="") - row.prop(md, "invert_vertex", text="", icon='ARROW_LEFTRIGHT') - - col = layout.column() - col.separator() - - col.label(text="Material:") - row = col.row(align=True) - row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE') - row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "pass_index", text="Pass") - row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT') - - col = layout.column() - col.separator() - - col.label(text="Layer:") - row = col.row(align=True) - row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL') - row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "layer_pass", text="Pass") - row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') + self.gpencil_masking(layout, ob, md, True) def GP_MIRROR(self, layout, ob, md): - gpd = ob.data - row = layout.row(align=True) row.prop(md, "x_axis") row.prop(md, "y_axis") row.prop(md, "z_axis") - layout.label(text="Object:") + layout.label(text="Mirror Object:") layout.prop(md, "object", text="") - col = layout.column() - col.separator() - - col.label(text="Material:") - row = col.row(align=True) - row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE') - row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "pass_index", text="Pass") - row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT') - - col = layout.column() - col.separator() - - col.label(text="Layer:") - row = col.row(align=True) - row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL') - row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "layer_pass", text="Pass") - row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') + self.gpencil_masking(layout, ob, md, False) def GP_HOOK(self, layout, ob, md): - gpd = ob.data split = layout.split() col = split.column() @@ -2317,71 +2090,16 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel): col = split.column() col.prop(md, "use_falloff_uniform") - col = layout.column() - col.separator() - col.label(text="Vertex Group:") - row = col.row(align=True) - row.prop_search(md, "vertex_group", ob, "vertex_groups", text="") - row.prop(md, "invert_vertex", text="", icon='ARROW_LEFTRIGHT') - - col = layout.column() - col.separator() - - col.label(text="Material:") - row = col.row(align=True) - row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE') - row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "pass_index", text="Pass") - row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT') - - col = layout.column() - col.separator() - - col.label(text="Layer:") - row = col.row(align=True) - row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL') - row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "layer_pass", text="Pass") - row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') + self.gpencil_masking(layout, ob, md, True) def GP_OFFSET(self, layout, ob, md): - gpd = ob.data - col = layout.column() - - col.prop(md, "location") - col.prop(md, "scale") - col.prop(md, "rotation") - - col = layout.column() - col.separator() - col.label(text="Vertex Group:") - row = col.row(align=True) - row.prop_search(md, "vertex_group", ob, "vertex_groups", text="") - row.prop(md, "invert_vertex", text="", icon='ARROW_LEFTRIGHT') - - col = layout.column() - col.separator() - - col.label(text="Material:") - row = col.row(align=True) - row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE') - row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "pass_index", text="Pass") - row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT') + split = layout.split() - col = layout.column() - col.separator() + split.column().prop(md, "location") + split.column().prop(md, "rotation") + split.column().prop(md, "scale") - col.label(text="Layer:") - row = col.row(align=True) - row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL') - row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "layer_pass", text="Pass") - row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') + self.gpencil_masking(layout, ob, md, True) def GP_ARMATURE(self, layout, ob, md): split = layout.split() @@ -2407,50 +2125,42 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel): sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT') def GP_MULTIPLY(self, layout, ob, md): - gpd = ob.data col = layout.column() - col.prop(md, "duplications") + col.prop(md, "duplicates") subcol = col.column() - subcol.enabled = md.duplications > 0 + subcol.enabled = md.duplicates > 0 subcol.prop(md, "distance") subcol.prop(md, "offset", slider=True) subcol.separator() - subcol.prop(md, "enable_fading") - if md.enable_fading: + subcol.prop(md, "use_fade") + if md.use_fade: subcol.prop(md, "fading_center") subcol.prop(md, "fading_thickness", slider=True) subcol.prop(md, "fading_opacity", slider=True) - subcol.separator() - - col.prop(md, "enable_angle_splitting") - if md.enable_angle_splitting: - col.prop(md, "split_angle") + self.gpencil_masking(layout, ob, md, False) + def GP_VERTEXCOLOR(self, layout, ob, md): col = layout.column() - col.separator() + col.label(text="Object:") + col.prop(md, "object", text="") - col.label(text="Material:") + col.separator() row = col.row(align=True) - row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE') - row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "pass_index", text="Pass") - row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT') + row.prop(md, "radius") + row.prop(md, "factor", text="Strength", slider=True) - col = layout.column() col.separator() + col.label(text="Colors:") + col.template_color_ramp(md, "colors") - col.label(text="Layer:") - row = col.row(align=True) - row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL') - row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT') - row = layout.row(align=True) - row.prop(md, "layer_pass", text="Pass") - row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT') + col.separator() + col.prop(md, "vertex_mode") + + self.gpencil_masking(layout, ob, md, True, True) classes = ( @@ -2460,5 +2170,6 @@ classes = ( if __name__ == "__main__": # only for live edit. from bpy.utils import register_class + for cls in classes: register_class(cls) |