[Bf-blender-cvs] [8ef0a9fdeaa] modifier-panels-ui: Layouts for great pencil modifiers
Hans Goudey
noreply at git.blender.org
Tue Apr 28 21:53:08 CEST 2020
Commit: 8ef0a9fdeaaa4253a2b879b921e021765483acaa
Author: Hans Goudey
Date: Tue Apr 28 14:52:59 2020 -0500
Branches: modifier-panels-ui
https://developer.blender.org/rB8ef0a9fdeaaa4253a2b879b921e021765483acaa
Layouts for great pencil modifiers
Worked out the layouts with Matias Mendiola and implemented them here.
===================================================================
M release/scripts/startup/bl_ui/properties_data_modifier.py
M source/blender/blenkernel/BKE_gpencil_modifier.h
M source/blender/blenkernel/intern/gpencil_modifier.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilarray.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
M source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
M source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c
M source/blender/gpencil_modifiers/intern/MOD_gpenciltexture.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c
M source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c
M source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c
M source/blender/gpencil_modifiers/intern/MOD_ui_common.c
M source/blender/gpencil_modifiers/intern/MOD_ui_common.h
M source/blender/makesrna/intern/rna_gpencil_modifier.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index c7788adff3e..449cd87861c 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -46,13 +46,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
bl_label = "Modifiers"
- def check_conflicts(self, layout, ob):
- for md in ob.grease_pencil_modifiers:
- if md.type == 'GP_TIME':
- row = layout.row()
- row.label(text="Build and Time Offset modifier not compatible", icon='ERROR')
- break
-
@classmethod
def poll(cls, context):
ob = context.object
@@ -64,457 +57,6 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
layout.template_grease_pencil_modifiers()
- def gpencil_masking(self, layout, ob, md, use_vertex, use_curve=False):
- gpd = ob.data
- layout.separator()
- layout.label(text="Influence Filters:")
-
- split = layout.split(factor=0.25)
-
- col1 = split.column()
-
- col1.label(text="Layer:")
- col1.label(text="Material:")
- if use_vertex:
- col1.label(text="Vertex Group:")
-
- col2 = split.column()
-
- 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 = split.row(align=True)
- row.prop(md, "layer_pass", text="Pass")
- row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT')
-
- split = col2.split(factor=0.6)
-
- 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 = split.row(align=True)
- row.prop(md, "pass_index", text="Pass")
- row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT')
-
- 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')
-
- 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_NOISE(self, layout, ob, md):
- split = layout.split()
-
- col = split.column()
- row = col.row(align=True)
- 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.separator()
- row = col.row(align=True)
- row.prop(md, "random", text="", icon='TIME', toggle=True)
-
- subrow = row.row(align=True)
- subrow.enabled = md.random
- subrow.prop(md, "step")
- subrow.prop(md, "seed")
-
- col.separator()
- col.prop(md, "noise_scale")
-
- 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(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
-
- row = layout.row()
- row.prop(md, "mode")
-
- split = layout.split()
-
- col = split.column()
- col.label(text="Settings:")
-
- if md.mode == 'FIXED':
- col.prop(md, "step")
- elif md.mode == 'ADAPTIVE':
- col.prop(md, "factor")
- elif md.mode == 'SAMPLE':
- col.prop(md, "length")
- elif md.mode == 'MERGE':
- col.prop(md, "distance")
-
- self.gpencil_masking(layout, ob, md, False)
-
- def GP_THICK(self, layout, ob, md):
- col = layout.column()
-
- col.prop(md, "normalize_thickness")
-
- if md.normalize_thickness:
- col.prop(md, "thickness")
- else:
- col.prop(md, "thickness_factor")
-
- self.gpencil_masking(layout, ob, md, True, True)
-
- def GP_TEXTURE(self, layout, ob, md):
- col = layout.column()
-
- col.prop(md, "mode")
- if md.mode in {'STROKE', 'STROKE_AND_FILL'}:
- col.label(text="Stroke Texture Control:")
- col.prop(md, "fit_method")
- col.prop(md, "uv_offset")
- col.prop(md, "uv_scale")
-
- if md.mode == 'STROKE_AND_FILL':
- col.separator()
-
- if md.mode in {'FILL', 'STROKE_AND_FILL'}:
- col.label(text="Fill Texture Control:")
- col.prop(md, "fill_rotation", text="Rotation")
- col.prop(md, "fill_offset", text="Location")
- col.prop(md, "fill_scale", text="Scale")
-
- self.gpencil_masking(layout, ob, md, True)
-
- def GP_TINT(self, layout, ob, md):
- layout.row().prop(md, "tint_type", expand=True)
-
- if md.tint_type == 'UNIFORM':
- col = layout.column()
- col.prop(md, "color")
-
- col.separator()
- col.prop(md, "factor")
-
- if md.tint_type == 'GRADIENT':
- col = layout.column()
- col.label(text="Colors:")
- col.template_color_ramp(md, "colors")
-
- col.separator()
-
- col.label(text="Object:")
- col.prop(md, "object", text="")
-
- col.separator()
- row = col.row(align=True)
- row.prop(md, "radius")
- row.prop(md, "factor")
-
- col.separator()
- col.prop(md, "vertex_mode")
-
- self.gpencil_masking(layout, ob, md, True, True)
-
- def GP_TIME(self, layout, ob, md):
- gpd = ob.data
-
- row = layout.row()
- row.prop(md, "mode", text="Mode")
-
- row = layout.row()
- if md.mode == 'FIX':
- txt = "Frame"
- else:
- txt = "Frame Offset"
- row.prop(md, "offset", text=txt)
-
- row = layout.row()
- row.enabled = md.mode != 'FIX'
- row.prop(md, "frame_scale")
-
- row = layout.row()
- row.separator()
-
- row = layout.row()
- row.enabled = md.mode != 'FIX'
- row.prop(md, "use_custom_frame_range")
-
- row = layout.row(align=True)
- row.enabled = md.mode != 'FIX' and md.use_custom_frame_range is True
- row.prop(md, "frame_start")
- row.prop(md, "frame_end")
-
- row = layout.row()
- row.enabled = md.mode != 'FIX'
- row.prop(md, "use_keep_loop")
-
- row = layout.row()
- row.label(text="Layer:")
- row = layout.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')
-
- def GP_COLOR(self, layout, ob, md):
- split = layout.split()
-
- col = split.column()
- col.label(text="Color:")
- col.prop(md, "hue", text="H", slider=True)
- col.prop(md, "saturation", text="S", slider=True)
- col.prop(md, "value", text="V", slider=True)
-
- row = layout.row()
- row.prop(md, "modify_color")
-
- self.gpencil_masking(layout, ob, md, False, True)
-
- def GP_OPACITY(self, layout, ob, md):
- split = layout.split()
-
- col = split.column()
- col.prop(md, "modify_color")
-
- if md.modify_color == 'HARDNESS':
- col.prop(md, "hardness")
- show = False
- else:
- col.prop(md, "normalize_opacity")
- if md.normalize_opacity is True:
- text="Strength"
- else:
- text="Opacity Factor"
-
- col.prop(md, "factor", text=text)
- show = True
- self.gpencil_masking(layout, ob, md, show, show)
-
- def GP_ARRAY(self, layout, ob, md):
- col = layout.column()
- col.prop(md, "count")
-
- split = layout.split()
- col = split.column()
- 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.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="Random Offset:")
- col.prop(md, "random_offset", text="")
-
- col = split.column()
- col.label(text="Random Rotation:")
- col.prop(md, "random_rotation", tex
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list