2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
|
#
|
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-05-08 18:17:57 +00:00
|
|
|
import bpy
|
2011-08-12 06:57:00 +00:00
|
|
|
from bpy.types import Panel
|
2013-02-10 10:29:38 +00:00
|
|
|
from bpy.app.translations import pgettext_iface as iface_
|
2013-02-10 09:09:26 +00:00
|
|
|
|
2011-09-20 18:29:19 +00:00
|
|
|
|
2015-01-29 15:35:06 +11:00
|
|
|
class ModifierButtonsPanel:
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
|
bl_context = "modifier"
|
2012-03-10 20:08:25 +00:00
|
|
|
bl_options = {'HIDE_HEADER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-07-31 21:06:08 +10:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Modifiers"
|
|
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
ob = context.object
|
|
|
|
|
return ob and ob.type != 'GPENCIL'
|
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2010-01-30 08:45:31 +00:00
|
|
|
layout.operator_menu_enum("object.modifier_add", "type")
|
2020-06-05 10:41:03 -04:00
|
|
|
layout.template_modifiers()
|
2020-05-13 12:39:17 +02:00
|
|
|
|
2013-12-22 07:08:35 +11:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
|
|
|
|
|
bl_label = "Modifiers"
|
|
|
|
|
|
2018-10-25 19:15:32 +02:00
|
|
|
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
|
|
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
ob = context.object
|
|
|
|
|
return ob and ob.type == 'GPENCIL'
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
|
|
|
|
|
|
layout.operator_menu_enum("object.gpencil_modifier_add", "type")
|
|
|
|
|
|
|
|
|
|
for md in ob.grease_pencil_modifiers:
|
|
|
|
|
box = layout.template_greasepencil_modifier(md)
|
|
|
|
|
if box:
|
|
|
|
|
# match enum type to our functions, avoids a lookup table.
|
|
|
|
|
getattr(self, md.type)(box, ob, md)
|
|
|
|
|
|
|
|
|
|
# the mt.type enum is (ab)used for a lookup on function names
|
|
|
|
|
# ...to avoid lengthy if statements
|
|
|
|
|
# so each type must have a function here.
|
2020-05-11 16:19:53 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
def gpencil_masking(self, layout, ob, md, use_vertex, use_curve=False):
|
2018-07-31 10:22:19 +02:00
|
|
|
gpd = ob.data
|
2020-03-09 16:27:24 +01:00
|
|
|
layout.separator()
|
|
|
|
|
layout.label(text="Influence Filters:")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
split = layout.split(factor=0.25)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
col1 = split.column()
|
2019-08-21 08:30:45 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
col1.label(text="Layer:")
|
|
|
|
|
col1.label(text="Material:")
|
|
|
|
|
if use_vertex:
|
|
|
|
|
col1.label(text="Vertex Group:")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
col2 = split.column()
|
2019-08-21 08:30:45 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
split = col2.split(factor=0.6)
|
|
|
|
|
row = split.row(align=True)
|
2018-10-24 16:46:14 +02:00
|
|
|
row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
|
|
|
|
|
row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT')
|
2020-03-09 16:27:24 +01:00
|
|
|
|
|
|
|
|
row = split.row(align=True)
|
2018-10-24 16:46:14 +02:00
|
|
|
row.prop(md, "layer_pass", text="Pass")
|
|
|
|
|
row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT')
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
split = col2.split(factor=0.6)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
row = split.row(align=True)
|
2020-05-11 16:18:08 +02:00
|
|
|
|
|
|
|
|
valid = md.material in (slot.material for slot in ob.material_slots) or md.material is None
|
|
|
|
|
if valid:
|
|
|
|
|
icon = 'SHADING_TEXTURE'
|
|
|
|
|
else:
|
|
|
|
|
icon = 'ERROR'
|
|
|
|
|
|
|
|
|
|
row.alert = not valid
|
|
|
|
|
row.prop_search(md, "material", gpd, "materials", text="", icon=icon)
|
2019-08-21 08:30:45 +02:00
|
|
|
row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT')
|
2020-03-09 16:27:24 +01:00
|
|
|
|
|
|
|
|
row = split.row(align=True)
|
2018-07-31 10:22:19 +02:00
|
|
|
row.prop(md, "pass_index", text="Pass")
|
2018-10-24 16:46:14 +02:00
|
|
|
row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT')
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
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')
|
2019-08-21 08:30:45 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
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")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
def GP_NOISE(self, layout, ob, md):
|
2018-07-31 10:22:19 +02:00
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
|
row = col.row(align=True)
|
2020-03-09 16:27:24 +01:00
|
|
|
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")
|
2018-10-24 16:46:14 +02:00
|
|
|
|
|
|
|
|
col.separator()
|
2018-07-31 10:22:19 +02:00
|
|
|
row = col.row(align=True)
|
2020-03-09 16:27:24 +01:00
|
|
|
row.prop(md, "random", text="", icon='TIME', toggle=True)
|
2019-09-10 06:11:52 +10:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
subrow = row.row(align=True)
|
|
|
|
|
subrow.enabled = md.random
|
|
|
|
|
subrow.prop(md, "step")
|
|
|
|
|
subrow.prop(md, "seed")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2019-08-21 08:30:45 +02:00
|
|
|
col.separator()
|
2020-03-09 16:27:24 +01:00
|
|
|
col.prop(md, "noise_scale")
|
2019-08-21 08:30:45 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
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:")
|
2018-07-31 10:22:19 +02:00
|
|
|
row = col.row(align=True)
|
2020-03-09 16:27:24 +01:00
|
|
|
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)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
def GP_SIMPLIFY(self, layout, ob, md):
|
|
|
|
|
gpd = ob.data
|
|
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
row.prop(md, "mode")
|
|
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
|
|
col = split.column()
|
2018-08-28 12:34:51 +10:00
|
|
|
col.label(text="Settings:")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2019-08-08 16:12:13 +02:00
|
|
|
if md.mode == 'FIXED':
|
|
|
|
|
col.prop(md, "step")
|
|
|
|
|
elif md.mode == 'ADAPTIVE':
|
|
|
|
|
col.prop(md, "factor")
|
|
|
|
|
elif md.mode == 'SAMPLE':
|
|
|
|
|
col.prop(md, "length")
|
2019-08-08 17:16:06 +02:00
|
|
|
elif md.mode == 'MERGE':
|
2019-08-10 17:16:12 +02:00
|
|
|
col.prop(md, "distance")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
self.gpencil_masking(layout, ob, md, False)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
def GP_THICK(self, layout, ob, md):
|
2019-08-21 08:30:45 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
col.prop(md, "normalize_thickness")
|
2018-10-24 16:46:14 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
if md.normalize_thickness:
|
|
|
|
|
col.prop(md, "thickness")
|
|
|
|
|
else:
|
|
|
|
|
col.prop(md, "thickness_factor")
|
2019-08-21 08:30:45 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
self.gpencil_masking(layout, ob, md, True, True)
|
2018-10-24 16:46:14 +02:00
|
|
|
|
2020-04-19 17:25:36 +02:00
|
|
|
def GP_TEXTURE(self, layout, ob, md):
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
|
|
col.prop(md, "mode")
|
|
|
|
|
if md.mode in {'STROKE', 'STROKE_AND_FILL'}:
|
2020-04-28 18:35:38 +02:00
|
|
|
col.label(text="Stroke Texture:")
|
2020-04-19 17:25:36 +02:00
|
|
|
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'}:
|
2020-04-28 18:35:38 +02:00
|
|
|
col.label(text="Fill Texture:")
|
2020-04-19 17:25:36 +02:00
|
|
|
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)
|
|
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
def GP_TINT(self, layout, ob, md):
|
2020-03-13 10:28:30 +01:00
|
|
|
layout.row().prop(md, "tint_type", expand=True)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-03-13 10:28:30 +01:00
|
|
|
if md.tint_type == 'UNIFORM':
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(md, "color")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-03-13 10:28:30 +01:00
|
|
|
col.separator()
|
|
|
|
|
col.prop(md, "factor")
|
2018-10-24 16:46:14 +02:00
|
|
|
|
2020-03-13 10:28:30 +01:00
|
|
|
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)
|
2018-08-21 17:18:42 +10:00
|
|
|
|
2018-10-22 18:25:13 +02:00
|
|
|
def GP_TIME(self, layout, ob, md):
|
|
|
|
|
gpd = ob.data
|
|
|
|
|
|
|
|
|
|
row = layout.row()
|
2018-10-24 10:31:48 +02:00
|
|
|
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)
|
|
|
|
|
|
2018-10-23 16:44:31 +02:00
|
|
|
row = layout.row()
|
2018-10-24 10:31:48 +02:00
|
|
|
row.enabled = md.mode != 'FIX'
|
2018-10-23 16:44:31 +02:00
|
|
|
row.prop(md, "frame_scale")
|
2018-10-22 18:25:13 +02:00
|
|
|
|
2018-11-03 17:11:38 +01:00
|
|
|
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")
|
|
|
|
|
|
2018-10-24 16:46:14 +02:00
|
|
|
row = layout.row()
|
|
|
|
|
row.enabled = md.mode != 'FIX'
|
|
|
|
|
row.prop(md, "use_keep_loop")
|
|
|
|
|
|
2018-10-22 18:25:13 +02:00
|
|
|
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')
|
|
|
|
|
|
2018-10-24 11:02:52 +02:00
|
|
|
row = layout.row(align=True)
|
2018-10-24 16:46:14 +02:00
|
|
|
row.prop(md, "layer_pass", text="Pass")
|
|
|
|
|
row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT')
|
2018-10-22 18:25:13 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
def GP_COLOR(self, layout, ob, md):
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
|
|
col = split.column()
|
2018-08-28 12:34:51 +10:00
|
|
|
col.label(text="Color:")
|
2019-06-26 20:58:18 +02:00
|
|
|
col.prop(md, "hue", text="H", slider=True)
|
|
|
|
|
col.prop(md, "saturation", text="S", slider=True)
|
|
|
|
|
col.prop(md, "value", text="V", slider=True)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2018-10-24 16:46:14 +02:00
|
|
|
row = layout.row()
|
|
|
|
|
row.prop(md, "modify_color")
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
self.gpencil_masking(layout, ob, md, False, True)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
def GP_OPACITY(self, layout, ob, md):
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
|
|
col = split.column()
|
2020-03-09 16:27:24 +01:00
|
|
|
col.prop(md, "modify_color")
|
2019-08-21 08:30:45 +02:00
|
|
|
|
2020-04-02 16:27:14 +02:00
|
|
|
if md.modify_color == 'HARDNESS':
|
|
|
|
|
col.prop(md, "hardness")
|
2020-03-20 15:37:56 +01:00
|
|
|
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)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2018-10-28 18:08:24 +01:00
|
|
|
def GP_ARRAY(self, layout, ob, md):
|
2018-07-31 10:22:19 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(md, "count")
|
|
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
col = split.column()
|
2020-03-09 16:27:24 +01:00
|
|
|
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="")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
col = split.column()
|
2020-03-09 16:27:24 +01:00
|
|
|
col.prop(md, "use_relative_offset", text="Relative Offset")
|
|
|
|
|
subcol = col.column()
|
|
|
|
|
subcol.enabled = md.use_relative_offset
|
|
|
|
|
subcol.prop(md, "relative_offset", text="")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
col = split.column()
|
2020-03-09 16:27:24 +01:00
|
|
|
col.label(text="Random Offset:")
|
|
|
|
|
col.prop(md, "random_offset", text="")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
col = split.column()
|
2020-03-09 16:27:24 +01:00
|
|
|
col.label(text="Random Rotation:")
|
|
|
|
|
col.prop(md, "random_rotation", text="")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
col = split.column()
|
|
|
|
|
col.label(text="Random Scale:")
|
|
|
|
|
col.prop(md, "random_scale", text="")
|
2018-10-24 16:46:14 +02:00
|
|
|
|
2019-08-21 08:30:45 +02:00
|
|
|
col = layout.column()
|
2020-03-09 16:27:24 +01:00
|
|
|
col.prop(md, "seed")
|
2019-08-21 08:30:45 +02:00
|
|
|
col.separator()
|
2020-03-09 16:27:24 +01:00
|
|
|
col.prop(md, "replace_material", text="Material Override")
|
2019-08-21 08:30:45 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
self.gpencil_masking(layout, ob, md, False)
|
2018-09-29 16:42:33 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
def GP_BUILD(self, layout, ob, md):
|
|
|
|
|
gpd = ob.data
|
|
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
|
|
col = split.column()
|
2018-10-25 19:15:32 +02:00
|
|
|
self.check_conflicts(col, ob)
|
|
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
col.prop(md, "mode")
|
|
|
|
|
if md.mode == 'CONCURRENT':
|
|
|
|
|
col.prop(md, "concurrent_time_alignment")
|
|
|
|
|
|
2018-10-24 16:46:14 +02:00
|
|
|
col.separator()
|
2018-07-31 10:22:19 +02:00
|
|
|
col.prop(md, "transition")
|
|
|
|
|
sub = col.column(align=True)
|
|
|
|
|
sub.prop(md, "start_delay")
|
|
|
|
|
sub.prop(md, "length")
|
|
|
|
|
|
2018-10-24 16:46:14 +02:00
|
|
|
col = layout.column(align=True)
|
2018-07-31 10:22:19 +02:00
|
|
|
col.prop(md, "use_restrict_frame_range")
|
|
|
|
|
sub = col.column(align=True)
|
|
|
|
|
sub.active = md.use_restrict_frame_range
|
|
|
|
|
sub.prop(md, "frame_start", text="Start")
|
|
|
|
|
sub.prop(md, "frame_end", text="End")
|
|
|
|
|
|
2020-05-11 12:57:22 +02:00
|
|
|
col.prop(md, "use_percentage")
|
|
|
|
|
sub = col.column(align=True)
|
|
|
|
|
sub.active = md.use_percentage
|
|
|
|
|
sub.prop(md, "percentage_factor")
|
|
|
|
|
|
2020-03-12 10:39:41 +01:00
|
|
|
layout.label(text="Influence Filters:")
|
|
|
|
|
|
|
|
|
|
split = layout.split(factor=0.25)
|
|
|
|
|
|
|
|
|
|
col1 = split.column()
|
|
|
|
|
|
|
|
|
|
col1.label(text="Layer:")
|
|
|
|
|
|
|
|
|
|
col2 = split.column()
|
|
|
|
|
|
|
|
|
|
split = col2.split(factor=0.6)
|
|
|
|
|
row = split.row(align=True)
|
2018-07-31 10:22:19 +02:00
|
|
|
row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
|
2018-09-03 14:15:18 +10:00
|
|
|
row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT')
|
2020-03-12 10:39:41 +01:00
|
|
|
|
|
|
|
|
row = split.row(align=True)
|
2018-10-24 16:46:14 +02:00
|
|
|
row.prop(md, "layer_pass", text="Pass")
|
|
|
|
|
row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT')
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
def GP_LATTICE(self, layout, ob, md):
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
|
col.label(text="Object:")
|
|
|
|
|
col.prop(md, "object", text="")
|
|
|
|
|
|
2018-10-24 16:46:14 +02:00
|
|
|
layout.prop(md, "strength", slider=True)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
self.gpencil_masking(layout, ob, md, True)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
def GP_MIRROR(self, layout, ob, md):
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
|
row.prop(md, "x_axis")
|
|
|
|
|
row.prop(md, "y_axis")
|
|
|
|
|
row.prop(md, "z_axis")
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
layout.label(text="Mirror Object:")
|
2018-10-24 16:46:14 +02:00
|
|
|
layout.prop(md, "object", text="")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
self.gpencil_masking(layout, ob, md, False)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
def GP_HOOK(self, layout, ob, md):
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
|
col.label(text="Object:")
|
|
|
|
|
col.prop(md, "object", text="")
|
|
|
|
|
if md.object and md.object.type == 'ARMATURE':
|
|
|
|
|
col.label(text="Bone:")
|
|
|
|
|
col.prop_search(md, "subtarget", md.object.data, "bones", text="")
|
|
|
|
|
|
|
|
|
|
use_falloff = (md.falloff_type != 'NONE')
|
|
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
|
if use_falloff:
|
|
|
|
|
row.prop(md, "falloff_radius")
|
|
|
|
|
row.prop(md, "strength", slider=True)
|
|
|
|
|
layout.prop(md, "falloff_type")
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
if use_falloff:
|
|
|
|
|
if md.falloff_type == 'CURVE':
|
|
|
|
|
col.template_curve_mapping(md, "falloff_curve")
|
|
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
|
col.prop(md, "use_falloff_uniform")
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
self.gpencil_masking(layout, ob, md, True)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2018-10-24 16:46:14 +02:00
|
|
|
def GP_OFFSET(self, layout, ob, md):
|
2020-03-09 16:27:24 +01:00
|
|
|
split = layout.split()
|
2018-10-24 16:46:14 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
split.column().prop(md, "location")
|
|
|
|
|
split.column().prop(md, "rotation")
|
|
|
|
|
split.column().prop(md, "scale")
|
2019-08-21 08:30:45 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
self.gpencil_masking(layout, ob, md, True)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2018-08-30 12:22:55 +02:00
|
|
|
def GP_ARMATURE(self, layout, ob, md):
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
|
col.label(text="Object:")
|
|
|
|
|
col.prop(md, "object", text="")
|
2018-09-14 08:57:46 +02:00
|
|
|
# col.prop(md, "use_deform_preserve_volume")
|
2018-08-30 12:22:55 +02:00
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
|
col.label(text="Bind To:")
|
|
|
|
|
col.prop(md, "use_vertex_groups", text="Vertex Groups")
|
|
|
|
|
col.prop(md, "use_bone_envelopes", text="Bone Envelopes")
|
|
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
2018-10-24 17:10:51 +02:00
|
|
|
row = layout.row(align=True)
|
|
|
|
|
row.label(text="Vertex Group:")
|
|
|
|
|
row = layout.row(align=True)
|
2018-08-30 12:22:55 +02:00
|
|
|
row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
|
|
|
|
|
sub = row.row(align=True)
|
|
|
|
|
sub.active = bool(md.vertex_group)
|
|
|
|
|
sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
|
|
|
|
|
|
2019-11-14 19:18:23 +01:00
|
|
|
def GP_MULTIPLY(self, layout, ob, md):
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
col.prop(md, "duplicates")
|
2019-11-14 19:18:23 +01:00
|
|
|
subcol = col.column()
|
2020-03-09 16:27:24 +01:00
|
|
|
subcol.enabled = md.duplicates > 0
|
2019-11-14 19:18:23 +01:00
|
|
|
subcol.prop(md, "distance")
|
|
|
|
|
subcol.prop(md, "offset", slider=True)
|
2019-12-11 22:31:20 -03:00
|
|
|
|
2019-11-14 19:18:23 +01:00
|
|
|
subcol.separator()
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
subcol.prop(md, "use_fade")
|
|
|
|
|
if md.use_fade:
|
2019-11-14 19:18:23 +01:00
|
|
|
subcol.prop(md, "fading_center")
|
|
|
|
|
subcol.prop(md, "fading_thickness", slider=True)
|
|
|
|
|
subcol.prop(md, "fading_opacity", slider=True)
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
self.gpencil_masking(layout, ob, md, False)
|
2019-11-14 19:18:23 +01:00
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
|
2017-03-18 20:03:24 +11:00
|
|
|
classes = (
|
|
|
|
|
DATA_PT_modifiers,
|
2018-07-31 10:22:19 +02:00
|
|
|
DATA_PT_gpencil_modifiers,
|
2017-03-18 20:03:24 +11:00
|
|
|
)
|
|
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
2017-03-18 20:03:24 +11:00
|
|
|
from bpy.utils import register_class
|
2020-03-09 16:27:24 +01:00
|
|
|
|
2017-03-18 20:03:24 +11:00
|
|
|
for cls in classes:
|
|
|
|
|
register_class(cls)
|