2011-05-24 07:08:58 +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.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
|
|
|
|
|
|
|
# <pep8 compliant>
|
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
from bpy.types import (
|
|
|
|
Panel,
|
|
|
|
UIList,
|
|
|
|
)
|
2019-06-11 16:08:32 +10:00
|
|
|
from bl_ui.properties_physics_common import (
|
2017-10-21 12:41:42 +11:00
|
|
|
point_cache_ui,
|
|
|
|
effector_weights_ui,
|
|
|
|
)
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
class PHYSICS_UL_dynapaint_surfaces(UIList):
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index):
|
2012-12-28 10:45:59 +00:00
|
|
|
# assert(isinstance(item, bpy.types.DynamicPaintSurface)
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
surf = item
|
|
|
|
sticon = layout.enum_item_icon(surf, "surface_type", surf.surface_type)
|
2018-08-17 12:03:39 +02:00
|
|
|
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.label(text="", icon_value=icon)
|
2013-11-23 20:37:23 +01:00
|
|
|
row.prop(surf, "name", text="", emboss=False, icon_value=sticon)
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(surf, "is_active", text="")
|
2018-08-17 12:03:39 +02:00
|
|
|
|
2015-04-14 10:29:11 +10:00
|
|
|
elif self.layout_type == 'GRID':
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
layout.alignment = 'CENTER'
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.label(text="", icon_value=icon)
|
|
|
|
row.label(text="", icon_value=sticon)
|
|
|
|
|
|
|
|
|
2015-01-29 15:35:06 +11:00
|
|
|
class PhysicButtonsPanel:
|
2011-05-24 07:08:58 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "physics"
|
|
|
|
|
2019-04-19 07:51:14 +02:00
|
|
|
@staticmethod
|
2018-08-17 12:03:39 +02:00
|
|
|
def poll_dyn_paint(context):
|
2011-05-24 07:08:58 +00:00
|
|
|
ob = context.object
|
2018-08-17 12:03:39 +02:00
|
|
|
return (ob and ob.type == 'MESH') and context.dynamic_paint
|
|
|
|
|
2019-04-19 07:51:14 +02:00
|
|
|
@staticmethod
|
2018-08-17 12:03:39 +02:00
|
|
|
def poll_dyn_canvas(context):
|
|
|
|
if not PhysicButtonsPanel.poll_dyn_paint(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
md = context.dynamic_paint
|
|
|
|
return (md and md.ui_type == 'CANVAS' and md.canvas_settings and md.canvas_settings.canvas_surfaces.active)
|
|
|
|
|
2019-04-19 07:51:14 +02:00
|
|
|
@staticmethod
|
2018-08-17 12:03:39 +02:00
|
|
|
def poll_dyn_canvas_paint(context):
|
|
|
|
if not PhysicButtonsPanel.poll_dyn_canvas(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
|
|
|
|
return (surface.surface_type == 'PAINT')
|
|
|
|
|
2019-04-19 07:51:14 +02:00
|
|
|
@staticmethod
|
2018-08-17 12:03:39 +02:00
|
|
|
def poll_dyn_canvas_brush(context):
|
|
|
|
if not PhysicButtonsPanel.poll_dyn_paint(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
md = context.dynamic_paint
|
|
|
|
return (md and md.ui_type == 'BRUSH' and md.brush_settings)
|
|
|
|
|
2019-04-19 07:51:14 +02:00
|
|
|
@staticmethod
|
2018-08-17 12:03:39 +02:00
|
|
|
def poll_dyn_output(context):
|
|
|
|
if not PhysicButtonsPanel.poll_dyn_canvas(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
|
|
|
|
return (not (surface.surface_format == 'VERTEX' and (surface.surface_type in {'DISPLACE', 'WAVE'})))
|
|
|
|
|
2019-04-19 07:51:14 +02:00
|
|
|
@staticmethod
|
2018-08-17 12:03:39 +02:00
|
|
|
def poll_dyn_output_maps(context):
|
|
|
|
if not PhysicButtonsPanel.poll_dyn_output(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
|
|
|
|
return (surface.surface_format == 'IMAGE' and surface.surface_type == 'PAINT')
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel):
|
2011-05-24 07:08:58 +00:00
|
|
|
bl_label = "Dynamic Paint"
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if not PhysicButtonsPanel.poll_dyn_paint(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-08-17 12:03:39 +02:00
|
|
|
layout.use_property_split = True
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
md = context.dynamic_paint
|
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
layout.prop(md, "ui_type")
|
|
|
|
|
|
|
|
|
|
|
|
class PHYSICS_PT_dynamic_paint_settings(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Settings"
|
|
|
|
bl_parent_id = 'PHYSICS_PT_dynamic_paint'
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if not PhysicButtonsPanel.poll_dyn_paint(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
md = context.dynamic_paint
|
2011-11-10 19:10:23 +00:00
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
if md.ui_type == 'CANVAS':
|
2011-11-10 19:10:23 +00:00
|
|
|
canvas = md.canvas_settings
|
2011-11-11 03:28:46 +00:00
|
|
|
|
|
|
|
if canvas is None:
|
2011-11-10 19:10:23 +00:00
|
|
|
layout.operator("dpaint.type_toggle", text="Add Canvas").type = 'CANVAS'
|
2018-08-17 12:03:39 +02:00
|
|
|
return # do nothing.
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
layout.operator("dpaint.type_toggle", text="Remove Canvas", icon='X').type = 'CANVAS'
|
2011-11-10 20:31:50 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list(
|
|
|
|
"PHYSICS_UL_dynapaint_surfaces", "", canvas, "canvas_surfaces",
|
2019-06-21 08:36:03 +10:00
|
|
|
canvas.canvas_surfaces, "active_index", rows=1,
|
2018-08-17 12:03:39 +02:00
|
|
|
)
|
2011-11-10 19:10:23 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
col = row.column(align=True)
|
2018-10-01 10:45:50 +02:00
|
|
|
col.operator("dpaint.surface_slot_add", icon='ADD', text="")
|
|
|
|
col.operator("dpaint.surface_slot_remove", icon='REMOVE', text="")
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
layout.separator()
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
layout.use_property_split = True
|
2018-07-25 15:57:30 +02:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
if surface:
|
|
|
|
flow = layout.grid_flow(
|
2019-06-21 08:36:03 +10:00
|
|
|
row_major=True, columns=0, even_columns=True, even_rows=False, align=False,
|
2018-08-17 12:03:39 +02:00
|
|
|
)
|
|
|
|
col = flow.column()
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
col.prop(surface, "surface_format")
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
if surface.surface_format != 'VERTEX':
|
|
|
|
col.prop(surface, "image_resolution")
|
|
|
|
col.prop(surface, "use_antialiasing")
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
col = flow.column(align=True)
|
|
|
|
col.prop(surface, "frame_start", text="Frame Start")
|
|
|
|
col.prop(surface, "frame_end", text="End")
|
|
|
|
|
|
|
|
col.prop(surface, "frame_substeps")
|
2011-11-10 19:10:23 +00:00
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
elif md.ui_type == 'BRUSH':
|
2011-11-10 19:10:23 +00:00
|
|
|
brush = md.brush_settings
|
2011-11-11 03:28:46 +00:00
|
|
|
|
|
|
|
if brush is None:
|
2011-11-10 19:10:23 +00:00
|
|
|
layout.operator("dpaint.type_toggle", text="Add Brush").type = 'BRUSH'
|
2018-08-17 12:03:39 +02:00
|
|
|
return # do nothing.
|
|
|
|
|
|
|
|
layout.operator("dpaint.type_toggle", text="Remove Brush", icon='X').type = 'BRUSH'
|
2011-11-10 19:10:23 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
layout.use_property_split = True
|
2011-11-10 19:10:23 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
flow = layout.grid_flow(
|
2019-06-21 08:36:03 +10:00
|
|
|
row_major=True, columns=0, even_columns=True, even_rows=False, align=False,
|
2018-08-17 12:03:39 +02:00
|
|
|
)
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(brush, "paint_color")
|
|
|
|
col.prop(brush, "paint_alpha", text="Alpha", slider=True)
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(brush, "paint_wetness", text="Wetness", slider=True)
|
|
|
|
col.prop(brush, "use_absolute_alpha")
|
|
|
|
col.prop(brush, "use_paint_erase")
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
|
2019-06-02 20:24:54 +02:00
|
|
|
class PHYSICS_PT_dp_surface_canvas(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Surface"
|
2018-06-20 16:02:32 +02:00
|
|
|
bl_parent_id = "PHYSICS_PT_dynamic_paint"
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-08-17 12:03:39 +02:00
|
|
|
if not PhysicButtonsPanel.poll_dyn_canvas(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-08-17 12:03:39 +02:00
|
|
|
layout.use_property_split = True
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
2011-06-18 18:41:20 +00:00
|
|
|
surface = canvas.canvas_surfaces.active
|
2011-11-11 03:28:46 +00:00
|
|
|
surface_type = surface.surface_type
|
|
|
|
|
2011-11-10 20:31:50 +00:00
|
|
|
layout.prop(surface, "surface_type")
|
2018-07-25 15:57:30 +02:00
|
|
|
|
2011-06-27 07:30:58 +00:00
|
|
|
layout.separator()
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2011-08-05 09:31:35 +00:00
|
|
|
# per type settings
|
2011-11-11 03:28:46 +00:00
|
|
|
if surface_type == 'DISPLACE':
|
2018-08-17 12:03:39 +02:00
|
|
|
col = flow.column()
|
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
if surface.surface_format == 'VERTEX':
|
2018-07-25 15:57:30 +02:00
|
|
|
col.prop(surface, "depth_clamp")
|
|
|
|
col.prop(surface, "displace_factor")
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
col.prop(surface, "use_incremental_displace")
|
2018-07-25 15:57:30 +02:00
|
|
|
col.separator()
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-07-25 15:57:30 +02:00
|
|
|
elif surface_type == 'WAVE':
|
2018-08-17 12:03:39 +02:00
|
|
|
col = flow.column()
|
2018-07-25 15:57:30 +02:00
|
|
|
col.prop(surface, "use_wave_open_border")
|
2011-07-02 18:06:39 +00:00
|
|
|
col.prop(surface, "wave_timescale")
|
|
|
|
col.prop(surface, "wave_speed")
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
col = flow.column()
|
2011-07-02 18:06:39 +00:00
|
|
|
col.prop(surface, "wave_damping")
|
|
|
|
col.prop(surface, "wave_spring")
|
2013-08-03 09:46:38 +00:00
|
|
|
col.prop(surface, "wave_smoothness")
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-07-25 15:57:30 +02:00
|
|
|
col.separator()
|
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
col = flow.column()
|
2018-11-28 17:49:52 +01:00
|
|
|
col.prop(surface, "brush_collection")
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
if surface_type not in {'DISPLACE', 'WAVE'}:
|
|
|
|
col = flow.column() # flow the layout otherwise.
|
|
|
|
|
|
|
|
col.prop(surface, "brush_influence_scale", text="Scale Influence")
|
|
|
|
col.prop(surface, "brush_radius_scale", text="Radius")
|
2018-07-25 15:57:30 +02:00
|
|
|
|
|
|
|
|
2019-06-02 20:24:54 +02:00
|
|
|
class PHYSICS_PT_dp_surface_canvas_paint_dry(PhysicButtonsPanel, Panel):
|
2018-07-25 15:57:30 +02:00
|
|
|
bl_label = "Dry"
|
2019-06-02 20:24:54 +02:00
|
|
|
bl_parent_id = "PHYSICS_PT_dp_surface_canvas"
|
2018-07-25 15:57:30 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-07-25 15:57:30 +02:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-08-17 12:03:39 +02:00
|
|
|
if not PhysicButtonsPanel.poll_dyn_canvas_paint(context):
|
|
|
|
return False
|
2018-07-25 15:57:30 +02:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
2018-07-25 15:57:30 +02:00
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
self.layout.prop(surface, "use_drying", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-08-17 12:03:39 +02:00
|
|
|
layout.use_property_split = True
|
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
2018-07-25 15:57:30 +02:00
|
|
|
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
flow.active = surface.use_drying
|
2018-07-25 15:57:30 +02:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
col = flow.column()
|
2018-07-25 15:57:30 +02:00
|
|
|
col.prop(surface, "dry_speed", text="Time")
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(surface, "color_dry_threshold", text="Color")
|
2018-07-25 15:57:30 +02:00
|
|
|
col.prop(surface, "use_dry_log", text="Slow")
|
|
|
|
|
|
|
|
|
2019-06-02 20:24:54 +02:00
|
|
|
class PHYSICS_PT_dp_surface_canvas_paint_dissolve(PhysicButtonsPanel, Panel):
|
2018-07-25 15:57:30 +02:00
|
|
|
bl_label = "Dissolve"
|
2019-06-02 20:24:54 +02:00
|
|
|
bl_parent_id = "PHYSICS_PT_dp_surface_canvas"
|
2018-07-25 15:57:30 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-07-25 15:57:30 +02:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-08-17 12:03:39 +02:00
|
|
|
if not PhysicButtonsPanel.poll_dyn_canvas(context):
|
|
|
|
return False
|
2018-07-25 15:57:30 +02:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
|
|
|
|
|
|
|
|
return (surface.surface_type != 'WAVE' and context.engine in cls.COMPAT_ENGINES)
|
2018-07-25 15:57:30 +02:00
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
self.layout.prop(surface, "use_dissolve", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-08-17 12:03:39 +02:00
|
|
|
layout.use_property_split = True
|
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
2018-07-25 15:57:30 +02:00
|
|
|
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
flow.active = surface.use_dissolve
|
2018-07-25 15:57:30 +02:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
col = flow.column()
|
2018-07-25 15:57:30 +02:00
|
|
|
col.prop(surface, "dissolve_speed", text="Time")
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
col = flow.column()
|
2018-07-25 15:57:30 +02:00
|
|
|
col.prop(surface, "use_dissolve_log", text="Slow")
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
|
|
|
|
class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel):
|
2018-06-20 16:02:32 +02:00
|
|
|
bl_label = "Output"
|
|
|
|
bl_parent_id = "PHYSICS_PT_dynamic_paint"
|
2011-05-24 07:08:58 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-08-17 12:03:39 +02:00
|
|
|
if not PhysicButtonsPanel.poll_dyn_output(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-07-25 15:57:30 +02:00
|
|
|
layout.use_property_split = True
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
2011-06-18 18:41:20 +00:00
|
|
|
surface = canvas.canvas_surfaces.active
|
2011-05-24 07:08:58 +00:00
|
|
|
ob = context.object
|
2011-11-11 03:28:46 +00:00
|
|
|
|
|
|
|
surface_type = surface.surface_type
|
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
# vertex format outputs.
|
2011-11-11 03:28:46 +00:00
|
|
|
if surface.surface_format == 'VERTEX':
|
|
|
|
if surface_type == 'PAINT':
|
2018-08-17 12:03:39 +02:00
|
|
|
# paint-map output.
|
2011-06-16 10:41:00 +00:00
|
|
|
row = layout.row()
|
2017-09-02 15:42:29 +10:00
|
|
|
row.prop_search(surface, "output_name_a", ob.data, "vertex_colors", text="Paintmap Layer")
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-10-01 10:45:50 +02:00
|
|
|
icons = 'REMOVE' if surface.output_exists(object=ob, index=0) else 'ADD'
|
2018-08-17 12:03:39 +02:00
|
|
|
row.operator("dpaint.output_toggle", icon=icons, text="").output = 'A'
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
# wet-map output.
|
2011-06-16 10:41:00 +00:00
|
|
|
row = layout.row()
|
2017-09-02 15:42:29 +10:00
|
|
|
row.prop_search(surface, "output_name_b", ob.data, "vertex_colors", text="Wetmap Layer")
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-10-01 10:45:50 +02:00
|
|
|
icons = 'REMOVE' if surface.output_exists(object=ob, index=1) else 'ADD'
|
2018-08-17 12:03:39 +02:00
|
|
|
row.operator("dpaint.output_toggle", icon=icons, text="").output = 'B'
|
2011-11-11 03:28:46 +00:00
|
|
|
|
|
|
|
elif surface_type == 'WEIGHT':
|
2011-08-03 18:31:48 +00:00
|
|
|
row = layout.row()
|
2014-03-26 23:27:51 +01:00
|
|
|
row.prop_search(surface, "output_name_a", ob, "vertex_groups", text="Vertex Group")
|
2011-11-10 20:31:50 +00:00
|
|
|
|
2018-10-01 10:45:50 +02:00
|
|
|
icons = 'REMOVE' if surface.output_exists(object=ob, index=0) else 'ADD'
|
2018-08-17 12:03:39 +02:00
|
|
|
row.operator("dpaint.output_toggle", icon=icons, text="").output = 'A'
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
# image format outputs.
|
2011-11-11 03:28:46 +00:00
|
|
|
if surface.surface_format == 'IMAGE':
|
2019-06-02 20:24:54 +02:00
|
|
|
|
|
|
|
layout.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT')
|
|
|
|
|
|
|
|
layout.prop(surface, "image_output_path", text="Cache Path")
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
|
2018-08-24 10:51:53 +10:00
|
|
|
col.prop_search(surface, "uv_layer", ob.data, "uv_layers", text="UV Map")
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(surface, "image_fileformat")
|
|
|
|
col.prop(surface, "use_premultiply", text="Premultiply Alpha")
|
|
|
|
|
|
|
|
if surface_type != 'PAINT':
|
|
|
|
col = col.column()
|
|
|
|
col.prop(surface, "output_name_a", text="Filename")
|
2011-11-11 03:28:46 +00:00
|
|
|
|
|
|
|
if surface_type == 'DISPLACE':
|
2011-10-28 14:46:09 +00:00
|
|
|
col.prop(surface, "displace_type", text="Displace Type")
|
2011-10-13 20:00:22 +00:00
|
|
|
col.prop(surface, "depth_clamp")
|
2018-08-17 12:03:39 +02:00
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
elif surface_type == 'WAVE':
|
2011-10-13 20:00:22 +00:00
|
|
|
col.prop(surface, "depth_clamp", text="Wave Clamp")
|
2011-09-10 08:55:44 +00:00
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
class PHYSICS_PT_dp_canvas_output_paintmaps(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Paintmaps"
|
|
|
|
bl_parent_id = "PHYSICS_PT_dp_canvas_output"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if not PhysicButtonsPanel.poll_dyn_output_maps(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
self.layout.prop(surface, "use_output_a", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
|
|
|
|
sub = layout.column()
|
|
|
|
sub.active = surface.use_output_a
|
|
|
|
sub.prop(surface, "output_name_a", text="Name")
|
|
|
|
|
|
|
|
|
|
|
|
class PHYSICS_PT_dp_canvas_output_wetmaps(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Wetmaps"
|
|
|
|
bl_parent_id = "PHYSICS_PT_dp_canvas_output"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if not PhysicButtonsPanel.poll_dyn_output_maps(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
self.layout.prop(surface, "use_output_b", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
|
|
|
|
sub = layout.column()
|
|
|
|
sub.active = surface.use_output_b
|
|
|
|
sub.prop(surface, "output_name_b", text="Name")
|
|
|
|
|
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel):
|
2018-06-20 16:02:32 +02:00
|
|
|
bl_label = "Initial Color"
|
|
|
|
bl_parent_id = "PHYSICS_PT_dynamic_paint"
|
2011-09-10 08:55:44 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2011-09-10 08:55:44 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-08-17 12:03:39 +02:00
|
|
|
if not PhysicButtonsPanel.poll_dyn_canvas_paint(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
2011-09-10 08:55:44 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
ob = context.object
|
|
|
|
|
2018-07-25 15:57:30 +02:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
col = layout.column()
|
|
|
|
col.prop(surface, "init_color_type", text="Type", expand=False)
|
|
|
|
|
2013-12-11 12:40:17 +01:00
|
|
|
if surface.init_color_type != 'NONE':
|
2018-08-17 12:03:39 +02:00
|
|
|
col.separator()
|
2011-09-10 08:55:44 +00:00
|
|
|
|
|
|
|
# dissolve
|
2011-11-11 03:28:46 +00:00
|
|
|
if surface.init_color_type == 'COLOR':
|
2011-09-10 08:55:44 +00:00
|
|
|
layout.prop(surface, "init_color")
|
2011-11-11 03:28:46 +00:00
|
|
|
|
|
|
|
elif surface.init_color_type == 'TEXTURE':
|
2018-08-17 12:03:39 +02:00
|
|
|
col.prop(surface, "init_texture")
|
2018-08-24 10:51:53 +10:00
|
|
|
col.prop_search(surface, "init_layername", ob.data, "uv_layers", text="UV Map")
|
2011-11-11 03:28:46 +00:00
|
|
|
|
|
|
|
elif surface.init_color_type == 'VERTEX_COLOR':
|
2018-08-24 10:51:53 +10:00
|
|
|
col.prop_search(surface, "init_layername", ob.data, "vertex_colors", text="Color Layer")
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
|
|
|
|
class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel):
|
2018-06-20 16:02:32 +02:00
|
|
|
bl_label = "Effects"
|
2018-08-17 12:03:39 +02:00
|
|
|
bl_parent_id = 'PHYSICS_PT_dynamic_paint'
|
2011-05-24 07:08:58 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-08-17 12:03:39 +02:00
|
|
|
if not PhysicButtonsPanel.poll_dyn_canvas_paint(context):
|
2011-11-11 03:28:46 +00:00
|
|
|
return False
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw(self, _context):
|
2018-08-17 12:03:39 +02:00
|
|
|
return # do nothing.
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2018-07-25 15:57:30 +02:00
|
|
|
|
|
|
|
class PHYSICS_PT_dp_effects_spread(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Spread"
|
|
|
|
bl_parent_id = "PHYSICS_PT_dp_effects"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-07-25 15:57:30 +02:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if not PhysicButtonsPanel.poll_dyn_paint(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
|
|
|
|
2018-07-25 15:57:30 +02:00
|
|
|
def draw_header(self, context):
|
2011-05-24 07:08:58 +00:00
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
2011-06-18 18:41:20 +00:00
|
|
|
surface = canvas.canvas_surfaces.active
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2018-07-25 15:57:30 +02:00
|
|
|
self.layout.prop(surface, "use_spread", text="")
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2018-07-25 15:57:30 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
2018-08-17 12:03:39 +02:00
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2018-07-25 15:57:30 +02:00
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
layout.active = surface.use_spread
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(surface, "spread_speed", text="Speed")
|
2011-08-03 18:31:48 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(surface, "color_spread_speed", text="Color")
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-07-25 15:57:30 +02:00
|
|
|
class PHYSICS_PT_dp_effects_drip(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Drip"
|
|
|
|
bl_parent_id = "PHYSICS_PT_dp_effects"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-07-25 15:57:30 +02:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if not PhysicButtonsPanel.poll_dyn_paint(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
|
|
|
|
2018-07-25 15:57:30 +02:00
|
|
|
def draw_header(self, context):
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
|
|
|
|
self.layout.prop(surface, "use_drip", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
2018-08-17 12:03:39 +02:00
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
2018-07-25 15:57:30 +02:00
|
|
|
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
flow.active = surface.use_drip
|
2018-07-25 15:57:30 +02:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
col = flow.column()
|
2018-07-25 15:57:30 +02:00
|
|
|
col.prop(surface, "drip_velocity", slider=True)
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
col = flow.column()
|
2018-07-25 15:57:30 +02:00
|
|
|
col.prop(surface, "drip_acceleration", slider=True)
|
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
class PHYSICS_PT_dp_effects_drip_weights(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Weights"
|
|
|
|
bl_parent_id = "PHYSICS_PT_dp_effects_drip"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if not PhysicButtonsPanel.poll_dyn_paint(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
|
|
|
|
layout.active = surface.use_drip
|
2018-07-25 15:57:30 +02:00
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
effector_weights_ui(self, surface.effector_weights, 'DYNAMIC_PAINT')
|
2018-07-25 15:57:30 +02:00
|
|
|
|
2018-07-31 21:06:08 +10:00
|
|
|
|
2018-07-25 15:57:30 +02:00
|
|
|
class PHYSICS_PT_dp_effects_shrink(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Shrink"
|
|
|
|
bl_parent_id = "PHYSICS_PT_dp_effects"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-07-25 15:57:30 +02:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if not PhysicButtonsPanel.poll_dyn_paint(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
|
|
|
|
2018-07-25 15:57:30 +02:00
|
|
|
def draw_header(self, context):
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
|
|
|
|
self.layout.prop(surface, "use_shrink", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
canvas = context.dynamic_paint.canvas_settings
|
|
|
|
surface = canvas.canvas_surfaces.active
|
|
|
|
layout.active = surface.use_shrink
|
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
layout.prop(surface, "shrink_speed", text="Speed")
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
|
|
|
|
class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel):
|
2018-06-20 16:02:32 +02:00
|
|
|
bl_label = "Cache"
|
|
|
|
bl_parent_id = "PHYSICS_PT_dynamic_paint"
|
2011-06-16 10:41:00 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2011-06-16 10:41:00 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-08-17 12:03:39 +02:00
|
|
|
if not PhysicButtonsPanel.poll_dyn_canvas(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
|
|
|
|
return (surface.is_cache_user and (context.engine in cls.COMPAT_ENGINES))
|
2011-06-16 10:41:00 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
2011-06-18 18:41:20 +00:00
|
|
|
surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
|
2011-06-16 10:41:00 +00:00
|
|
|
cache = surface.point_cache
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
point_cache_ui(self, cache, (cache.is_baked is False), 'DYNAMIC_PAINT')
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, Panel):
|
2018-06-20 16:02:32 +02:00
|
|
|
bl_label = "Source"
|
|
|
|
bl_parent_id = "PHYSICS_PT_dynamic_paint"
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-08-17 12:03:39 +02:00
|
|
|
if not PhysicButtonsPanel.poll_dyn_canvas_brush(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-07-25 15:57:30 +02:00
|
|
|
layout.use_property_split = True
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
brush = context.dynamic_paint.brush_settings
|
2011-05-24 07:08:58 +00:00
|
|
|
ob = context.object
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
layout.prop(brush, "paint_source", text="Paint")
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
if brush.paint_source == 'PARTICLE_SYSTEM':
|
2018-08-17 12:03:39 +02:00
|
|
|
col = flow.column()
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
2018-08-24 10:51:53 +10:00
|
|
|
col.prop_search(brush, "particle_system", ob, "particle_systems")
|
2018-08-17 12:03:39 +02:00
|
|
|
|
2011-10-28 14:46:09 +00:00
|
|
|
if brush.particle_system:
|
2018-08-17 12:03:39 +02:00
|
|
|
col = flow.column()
|
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
sub = col.column()
|
2011-10-31 13:01:06 +00:00
|
|
|
sub.active = not brush.use_particle_radius
|
2018-08-17 12:03:39 +02:00
|
|
|
sub.prop(brush, "solid_radius", text="Effect Solid Radius")
|
|
|
|
|
2011-10-28 14:46:09 +00:00
|
|
|
col.prop(brush, "use_particle_radius", text="Use Particle's Radius")
|
2017-09-02 15:42:29 +10:00
|
|
|
col.prop(brush, "smooth_radius", text="Smooth Radius")
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2011-10-28 14:46:09 +00:00
|
|
|
if brush.paint_source in {'DISTANCE', 'VOLUME_DISTANCE', 'POINT'}:
|
2018-08-17 12:03:39 +02:00
|
|
|
col = flow.column()
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
col.prop(brush, "paint_distance", text="Distance")
|
|
|
|
col.prop(brush, "proximity_falloff")
|
2018-07-25 15:57:30 +02:00
|
|
|
|
2012-01-19 11:13:41 +00:00
|
|
|
if brush.paint_source == 'VOLUME_DISTANCE':
|
2018-07-25 15:57:30 +02:00
|
|
|
col.prop(brush, "invert_proximity")
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
col = flow.column()
|
2018-07-25 15:57:30 +02:00
|
|
|
col.prop(brush, "use_negative_volume")
|
2018-08-17 12:03:39 +02:00
|
|
|
|
2012-01-19 11:13:41 +00:00
|
|
|
if brush.paint_source in {'DISTANCE', 'VOLUME_DISTANCE'}:
|
2018-08-17 12:03:39 +02:00
|
|
|
col = flow.column() if brush.paint_source != 'VOLUME_DISTANCE' else col.column()
|
|
|
|
col.prop(brush, "use_proximity_project")
|
|
|
|
|
2018-07-25 15:57:30 +02:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = brush.use_proximity_project
|
|
|
|
sub.prop(brush, "ray_direction")
|
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
class PHYSICS_PT_dp_brush_source_color_ramp(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Falloff Ramp"
|
|
|
|
bl_parent_id = "PHYSICS_PT_dp_brush_source"
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if not PhysicButtonsPanel.poll_dyn_canvas_brush(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
brush = context.dynamic_paint.brush_settings
|
|
|
|
return ((brush.paint_source in {'DISTANCE', 'VOLUME_DISTANCE', 'POINT'})
|
|
|
|
and (brush.proximity_falloff == 'RAMP')
|
|
|
|
and (context.engine in cls.COMPAT_ENGINES))
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
brush = context.dynamic_paint.brush_settings
|
|
|
|
layout.prop(brush, "use_proximity_ramp_alpha", text="Only Use Alpha")
|
|
|
|
|
|
|
|
layout.use_property_split = False
|
|
|
|
layout.template_color_ramp(brush, "paint_ramp", expand=True)
|
2011-11-11 03:28:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, Panel):
|
2018-06-20 16:02:32 +02:00
|
|
|
bl_label = "Velocity"
|
|
|
|
bl_parent_id = "PHYSICS_PT_dynamic_paint"
|
2011-10-22 16:16:14 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2011-10-22 16:16:14 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-08-17 12:03:39 +02:00
|
|
|
if not PhysicButtonsPanel.poll_dyn_canvas_brush(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
2011-10-22 16:16:14 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-07-25 15:57:30 +02:00
|
|
|
layout.use_property_split = True
|
2018-08-17 12:03:39 +02:00
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
2011-10-22 16:16:14 +00:00
|
|
|
|
|
|
|
brush = context.dynamic_paint.brush_settings
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
col = flow.column()
|
2011-11-14 07:07:59 +00:00
|
|
|
col.prop(brush, "use_velocity_alpha")
|
|
|
|
col.prop(brush, "use_velocity_color")
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
col = flow.column()
|
2018-07-25 15:57:30 +02:00
|
|
|
col.prop(brush, "use_velocity_depth")
|
2018-08-17 12:03:39 +02:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = (brush.use_velocity_alpha or brush.use_velocity_color or brush.use_velocity_depth)
|
|
|
|
sub.prop(brush, "velocity_max")
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
class PHYSICS_PT_dp_brush_velocity_color_ramp(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Ramp"
|
|
|
|
bl_parent_id = "PHYSICS_PT_dp_brush_velocity"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if not PhysicButtonsPanel.poll_dyn_canvas_brush(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
brush = context.dynamic_paint.brush_settings
|
|
|
|
|
|
|
|
layout.template_color_ramp(brush, "velocity_ramp", expand=True)
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-07-25 15:57:30 +02:00
|
|
|
|
|
|
|
class PHYSICS_PT_dp_brush_velocity_smudge(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Smudge"
|
|
|
|
bl_parent_id = "PHYSICS_PT_dp_brush_velocity"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-07-25 15:57:30 +02:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-08-17 12:03:39 +02:00
|
|
|
if not PhysicButtonsPanel.poll_dyn_canvas_brush(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
2018-07-25 15:57:30 +02:00
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
brush = context.dynamic_paint.brush_settings
|
|
|
|
|
|
|
|
self.layout.prop(brush, "use_smudge", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
brush = context.dynamic_paint.brush_settings
|
|
|
|
|
|
|
|
layout.active = brush.use_smudge
|
2018-08-17 12:03:39 +02:00
|
|
|
layout.prop(brush, "smudge_strength", text="Strength", slider=True)
|
2011-11-11 03:28:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, Panel):
|
2018-06-20 16:02:32 +02:00
|
|
|
bl_label = "Waves"
|
|
|
|
bl_parent_id = "PHYSICS_PT_dynamic_paint"
|
2011-10-22 16:16:14 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2011-10-22 16:16:14 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-08-17 12:03:39 +02:00
|
|
|
if not PhysicButtonsPanel.poll_dyn_canvas_brush(context):
|
|
|
|
return False
|
|
|
|
|
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
2011-10-22 16:16:14 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-07-25 15:57:30 +02:00
|
|
|
layout.use_property_split = True
|
2011-10-22 16:16:14 +00:00
|
|
|
|
|
|
|
brush = context.dynamic_paint.brush_settings
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
layout.prop(brush, "wave_type", text="Type")
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
|
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
if brush.wave_type != 'REFLECT':
|
2018-08-17 12:03:39 +02:00
|
|
|
col = flow.column()
|
2018-07-25 15:57:30 +02:00
|
|
|
col.prop(brush, "wave_factor")
|
2018-08-17 12:03:39 +02:00
|
|
|
|
|
|
|
col = flow.column()
|
2018-07-25 15:57:30 +02:00
|
|
|
col.prop(brush, "wave_clamp")
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
|
2017-03-18 20:03:24 +11:00
|
|
|
classes = (
|
2017-03-20 02:34:32 +11:00
|
|
|
PHYSICS_UL_dynapaint_surfaces,
|
|
|
|
PHYSICS_PT_dynamic_paint,
|
2018-08-17 12:03:39 +02:00
|
|
|
PHYSICS_PT_dynamic_paint_settings,
|
2019-06-02 20:24:54 +02:00
|
|
|
PHYSICS_PT_dp_surface_canvas,
|
|
|
|
PHYSICS_PT_dp_surface_canvas_paint_dissolve,
|
|
|
|
PHYSICS_PT_dp_surface_canvas_paint_dry,
|
2018-08-17 12:03:39 +02:00
|
|
|
PHYSICS_PT_dp_cache,
|
2017-03-20 02:34:32 +11:00
|
|
|
PHYSICS_PT_dp_effects,
|
2018-07-25 15:57:30 +02:00
|
|
|
PHYSICS_PT_dp_effects_spread,
|
|
|
|
PHYSICS_PT_dp_effects_drip,
|
2018-08-17 12:03:39 +02:00
|
|
|
PHYSICS_PT_dp_effects_drip_weights,
|
2018-07-25 15:57:30 +02:00
|
|
|
PHYSICS_PT_dp_effects_shrink,
|
2018-08-17 12:03:39 +02:00
|
|
|
PHYSICS_PT_dp_canvas_initial_color,
|
2017-03-18 20:03:24 +11:00
|
|
|
PHYSICS_PT_dp_brush_source,
|
2018-08-17 12:03:39 +02:00
|
|
|
PHYSICS_PT_dp_brush_source_color_ramp,
|
2017-03-18 20:03:24 +11:00
|
|
|
PHYSICS_PT_dp_brush_velocity,
|
2018-08-17 12:03:39 +02:00
|
|
|
PHYSICS_PT_dp_brush_velocity_color_ramp,
|
2018-07-25 15:57:30 +02:00
|
|
|
PHYSICS_PT_dp_brush_velocity_smudge,
|
2017-03-18 20:03:24 +11:00
|
|
|
PHYSICS_PT_dp_brush_wave,
|
2018-08-17 12:03:39 +02:00
|
|
|
PHYSICS_PT_dp_canvas_output,
|
|
|
|
PHYSICS_PT_dp_canvas_output_paintmaps,
|
|
|
|
PHYSICS_PT_dp_canvas_output_wetmaps,
|
2017-03-18 20:03:24 +11:00
|
|
|
)
|
|
|
|
|
2018-08-17 12:03:39 +02:00
|
|
|
|
2017-03-18 20:03:24 +11:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
from bpy.utils import register_class
|
|
|
|
for cls in classes:
|
|
|
|
register_class(cls)
|