From 3b41ab432badf2d4598b798e0d0c6c9ece51172b Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Tue, 24 May 2011 07:08:58 +0000 Subject: Applied Dynamic Paint 1.18f patch as a codebase for GSoC. --- release/scripts/startup/bl_ui/__init__.py | 1 + .../startup/bl_ui/properties_data_modifier.py | 3 + .../startup/bl_ui/properties_physics_common.py | 1 + .../bl_ui/properties_physics_dynamicpaint.py | 264 +++++++++++++++++++++ 4 files changed, 269 insertions(+) create mode 100644 release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py (limited to 'release') diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 2f933fb5771..9d5221b4e92 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -43,6 +43,7 @@ _modules = ( "properties_particle", "properties_physics_cloth", "properties_physics_common", + "properties_physics_dynamicpaint", "properties_physics_field", "properties_physics_fluid", "properties_physics_smoke", diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 75069993521..4e40db267de 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -229,6 +229,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel): row.prop(md, "mid_level") row.prop(md, "strength") + def DYNAMIC_PAINT(self, layout, ob, md): + layout.label(text="See Dynamic Paint panel.") + def EDGE_SPLIT(self, layout, ob, md): split = layout.split() diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py index f7cf8da1840..0030abff71b 100644 --- a/release/scripts/startup/bl_ui/properties_physics_common.py +++ b/release/scripts/startup/bl_ui/properties_physics_common.py @@ -64,6 +64,7 @@ class PHYSICS_PT_add(PhysicButtonsPanel, bpy.types.Panel): if(ob.type == 'MESH'): physics_add(self, col, context.collision, "Collision", 'COLLISION', 'MOD_PHYSICS', False) physics_add(self, col, context.cloth, "Cloth", 'CLOTH', 'MOD_CLOTH', True) + physics_add(self, col, context.dynamic_paint, "Dynamic Paint", 'DYNAMIC_PAINT', 'MOD_FLUIDSIM', True) col = split.column() diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py new file mode 100644 index 00000000000..a564704e80f --- /dev/null +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -0,0 +1,264 @@ +# ##### 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 ##### + +# +import bpy + + +class PhysicButtonsPanel(): + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "physics" + + @classmethod + def poll(cls, context): + ob = context.object + rd = context.scene.render + return (ob and ob.type == 'MESH') and (not rd.use_game_engine) and (context.dynamic_paint) + + +class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel): + bl_label = "Dynamic Paint" + + def draw(self, context): + layout = self.layout + + md = context.dynamic_paint + ob = context.object + + if md: + layout.prop(md, "dynamicpaint_type", expand=True) + + if md.dynamicpaint_type == 'CANVAS': + canvas = md.canvas_settings + + layout.operator("dpaint.bake", text="Bake Dynamic Paint", icon='MOD_FLUIDSIM') + if len(canvas.ui_info) != 0: + layout.label(text=canvas.ui_info) + + col = layout.column() + col.label(text="Quality:") + col.prop(canvas, "resolution") + col.prop(canvas, "use_anti_aliasing") + + col = layout.column() + col.label(text="Frames:") + split = col.split() + + col = split.column(align=True) + col.prop(canvas, "start_frame", text="Start") + col.prop(canvas, "end_frame", text="End") + + col = split.column() + col.prop(canvas, "substeps") + + + elif md.dynamicpaint_type == 'PAINT': + paint = md.paint_settings + + layout.prop(paint, "do_paint") + + split = layout.split() + + col = split.column() + col.active = paint.do_paint + col.prop(paint, "absolute_alpha") + col.prop(paint, "paint_erase") + col.prop(paint, "paint_wetness", text="Wetness") + + col = split.column() + col.active = paint.do_paint + sub = col.column() + sub.active = (paint.paint_source != "PSYS"); + sub.prop(paint, "use_material") + if paint.use_material and paint.paint_source != "PSYS": + col.prop(paint, "material", text="") + else: + col.prop(paint, "paint_color", text="") + col.prop(paint, "paint_alpha", text="Alpha") + + layout.label() + layout.prop(paint, "do_displace") + + +class PHYSICS_PT_dp_output(PhysicButtonsPanel, bpy.types.Panel): + bl_label = "Dynamic Paint: Output" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + md = context.dynamic_paint + return md and (md.dynamicpaint_type == 'CANVAS') + + def draw(self, context): + layout = self.layout + + canvas = context.dynamic_paint.canvas_settings + + col = layout.column() + col.prop(canvas, "output_paint") + sub = col.column() + sub.active = canvas.output_paint + sub.prop(canvas, "paint_output_path", text="") + sub.prop(canvas, "premultiply", text="Premultiply alpha") + + layout.separator() + + col = layout.column() + col.prop(canvas, "output_wet") + sub = col.column() + sub.active = canvas.output_wet + sub.prop(canvas, "wet_output_path", text="") + + layout.separator() + + col = layout.column() + col.prop(canvas, "output_disp") + sub = col.column() + sub.active = canvas.output_disp + sub.prop(canvas, "displace_output_path", text="") + sub.prop(canvas, "displacement", text="Strength") + + split = sub.split() + sub = split.column() + sub.prop(canvas, "disp_type", text="Type") + sub = split.column() + sub.prop(canvas, "disp_format", text="Format") + + +class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): + bl_label = "Dynamic Paint: Advanced" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + md = context.dynamic_paint + return md and (md.dynamicpaint_type == 'CANVAS') + + def draw(self, context): + layout = self.layout + + canvas = context.dynamic_paint.canvas_settings + ob = context.object + + col = layout.column() + split = col.split(percentage=0.7) + split.prop(canvas, "dry_speed", text="Dry Time") + split.prop(canvas, "use_dry_log", text="Slow") + + col = layout.column() + col.prop(canvas, "use_dissolve_paint") + sub = col.column() + sub.active = canvas.use_dissolve_paint + sub.prop(canvas, "dissolve_speed", text="Time") + + col = layout.column() + col.prop(canvas, "use_flatten_disp", text="Flatten Displace") + sub = col.column() + sub.active = canvas.use_flatten_disp + sub.prop(canvas, "flatten_speed", text="Time") + + layout.separator() + + layout.prop_search(canvas, "uv_layer", ob.data, "uv_textures") + +class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel): + bl_label = "Dynamic Paint: Effects" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + md = context.dynamic_paint + return md and (md.dynamicpaint_type == 'CANVAS') + + def draw(self, context): + layout = self.layout + + canvas = context.dynamic_paint.canvas_settings + + layout.prop(canvas, "effect_ui", expand=True) + + if canvas.effect_ui == "SPREAD": + layout.prop(canvas, "use_spread") + col = layout.column() + col.active = canvas.use_spread + col.prop(canvas, "spread_speed") + + elif canvas.effect_ui == "DRIP": + layout.prop(canvas, "use_drip") + col = layout.column() + col.active = canvas.use_drip + col.prop(canvas, "drip_speed") + + elif canvas.effect_ui == "SHRINK": + layout.prop(canvas, "use_shrink") + col = layout.column() + col.active = canvas.use_shrink + col.prop(canvas, "shrink_speed") + +class PHYSICS_PT_dp_advanced_paint(PhysicButtonsPanel, bpy.types.Panel): + bl_label = "Dynamic Paint: Advanced" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + md = context.dynamic_paint + return md and (md.dynamicpaint_type == 'PAINT') + + def draw(self, context): + layout = self.layout + + paint = context.dynamic_paint.paint_settings + ob = context.object + + split = layout.split() + col = split.column() + col.prop(paint, "paint_source") + + if paint.paint_source == "PSYS": + col.prop_search(paint, "psys", ob, "particle_systems", text="") + if paint.psys: + col.label(text="Particle effect:") + sub = col.column() + sub.active = not paint.use_part_radius + sub.prop(paint, "solid_radius", text="Solid Radius") + col.prop(paint, "use_part_radius", text="Use Particle's Radius") + col.prop(paint, "smooth_radius", text="Smooth radius") + + elif paint.paint_source == "DISTANCE" or paint.paint_source == "VOLDIST": + col.prop(paint, "paint_distance", text="Paint Distance") + split = layout.row().split() + sub = split.column() + sub.prop(paint, "prox_facealigned", text="Face Aligned") + sub = split.column() + sub.prop(paint, "prox_falloff", text="Falloff") + if paint.prox_falloff == "RAMP": + col = layout.row().column() + col.label(text="Falloff Ramp:") + col.prop(paint, "prox_ramp_alpha", text="Only Use Alpha") + col.template_color_ramp(paint, "paint_ramp", expand=True) + +def register(): + bpy.utils.register_module(__name__) + + +def unregister(): + bpy.utils.register_module(__name__) + +if __name__ == "__main__": + register() -- cgit v1.2.3 From 3de22dec26606c2c526f7193db038fa5125f9b03 Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Thu, 16 Jun 2011 10:41:00 +0000 Subject: Dynamic Paint: Committed changes from previous weeks, biggest changes are: * Canvas can now have multiple "surfaces" that each can have specific format, type and settings. * Renewed UI to support this new system. * Aside from old "image sequence" output format, Dynamic Paint can now work on vertex level as well. Currently vertex paint and displace are supported. * Integrated vertex level painting with Point Cache. * Added viewport preview for Point Cache surfaces. Due to massive amount of changes, old Dynamic Paint saves are no longer supported. Also some features are temporarily missing or may not work properly. --- release/datafiles/blenderbuttons | Bin 210335 -> 195798 bytes .../startup/bl_ui/properties_physics_common.py | 10 +- .../bl_ui/properties_physics_dynamicpaint.py | 310 +++++++++++++-------- release/scripts/startup/bl_ui/space_time.py | 1 + 4 files changed, 194 insertions(+), 127 deletions(-) (limited to 'release') diff --git a/release/datafiles/blenderbuttons b/release/datafiles/blenderbuttons index 9872e53585e..74a6667624d 100644 Binary files a/release/datafiles/blenderbuttons and b/release/datafiles/blenderbuttons differ diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py index 0030abff71b..8ec9ffd0b83 100644 --- a/release/scripts/startup/bl_ui/properties_physics_common.py +++ b/release/scripts/startup/bl_ui/properties_physics_common.py @@ -64,7 +64,7 @@ class PHYSICS_PT_add(PhysicButtonsPanel, bpy.types.Panel): if(ob.type == 'MESH'): physics_add(self, col, context.collision, "Collision", 'COLLISION', 'MOD_PHYSICS', False) physics_add(self, col, context.cloth, "Cloth", 'CLOTH', 'MOD_CLOTH', True) - physics_add(self, col, context.dynamic_paint, "Dynamic Paint", 'DYNAMIC_PAINT', 'MOD_FLUIDSIM', True) + physics_add(self, col, context.dynamic_paint, "Dynamic Paint", 'DYNAMIC_PAINT', 'MOD_DYNAMICPAINT', True) col = split.column() @@ -106,7 +106,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype): layout.label(text=cache.info) else: - if cachetype == 'SMOKE': + if cachetype in {'SMOKE', 'DYNAMIC_PAINT'}: if not bpy.data.is_saved: layout.label(text="Cache is disabled until the file is saved") layout.enabled = False @@ -118,17 +118,17 @@ def point_cache_ui(self, context, cache, enabled, cachetype): row = layout.row(align=True) - if cachetype != 'PSYS': + if cachetype not in {'PSYS', 'DYNAMIC_PAINT'}: row.enabled = enabled row.prop(cache, "frame_start") row.prop(cache, "frame_end") - if cachetype not in {'SMOKE', 'CLOTH'}: + if cachetype not in {'SMOKE', 'CLOTH', 'DYNAMIC_PAINT'}: row.prop(cache, "frame_step") row.prop(cache, "use_quick_cache") if cachetype != 'SMOKE': layout.label(text=cache.info) - if cachetype != 'SMOKE': + if cachetype not in {'SMOKE', 'DYNAMIC_PAINT'}: split = layout.split() split.enabled = enabled and bpy.data.is_saved diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index a564704e80f..96f9b109839 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -19,6 +19,9 @@ # import bpy +from bl_ui.properties_physics_common import ( + point_cache_ui, + ) class PhysicButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -46,136 +49,175 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel): if md.dynamicpaint_type == 'CANVAS': canvas = md.canvas_settings + surface = canvas.active_surface + row = layout.row() + row.template_list(canvas, "canvas_surfaces", canvas, "active_index", rows=2) + + col = row.column(align=True) + col.operator("dpaint.surface_slot_add", icon='ZOOMIN', text="") + col.operator("dpaint.surface_slot_remove", icon='ZOOMOUT', text="") - layout.operator("dpaint.bake", text="Bake Dynamic Paint", icon='MOD_FLUIDSIM') - if len(canvas.ui_info) != 0: - layout.label(text=canvas.ui_info) - - col = layout.column() - col.label(text="Quality:") - col.prop(canvas, "resolution") - col.prop(canvas, "use_anti_aliasing") + if surface: + layout.prop(surface, "name") + layout.prop(surface, "surface_format", expand=False) + + if surface.surface_format != "VERTEX": + col = layout.column() + col.label(text="Quality:") + col.prop(surface, "image_resolution") + col.prop(surface, "use_anti_aliasing") - col = layout.column() - col.label(text="Frames:") - split = col.split() + col = layout.column() + col.label(text="Frames:") + split = col.split() - col = split.column(align=True) - col.prop(canvas, "start_frame", text="Start") - col.prop(canvas, "end_frame", text="End") + col = split.column(align=True) + col.prop(surface, "start_frame", text="Start") + col.prop(surface, "end_frame", text="End") - col = split.column() - col.prop(canvas, "substeps") + col = split.column() + col.prop(surface, "substeps") - elif md.dynamicpaint_type == 'PAINT': - paint = md.paint_settings + elif md.dynamicpaint_type == 'BRUSH': + brush = md.brush_settings - layout.prop(paint, "do_paint") + layout.prop(brush, "brush_settings_context", expand=True, icon_only=True) - split = layout.split() + if (brush.brush_settings_context == "GENERAL"): + split = layout.split() - col = split.column() - col.active = paint.do_paint - col.prop(paint, "absolute_alpha") - col.prop(paint, "paint_erase") - col.prop(paint, "paint_wetness", text="Wetness") + col = split.column() + col.prop(brush, "absolute_alpha") + col.prop(brush, "paint_erase") + col.prop(brush, "paint_wetness", text="Wetness") - col = split.column() - col.active = paint.do_paint - sub = col.column() - sub.active = (paint.paint_source != "PSYS"); - sub.prop(paint, "use_material") - if paint.use_material and paint.paint_source != "PSYS": - col.prop(paint, "material", text="") - else: - col.prop(paint, "paint_color", text="") - col.prop(paint, "paint_alpha", text="Alpha") + col = split.column() + sub = col.column() + sub.active = (brush.paint_source != "PSYS"); + sub.prop(brush, "use_material") + if brush.use_material and brush.paint_source != "PSYS": + col.prop(brush, "material", text="") + col.prop(brush, "paint_alpha", text="Alpha Factor") + else: + col.prop(brush, "paint_color", text="") + col.prop(brush, "paint_alpha", text="Alpha") - layout.label() - layout.prop(paint, "do_displace") + if (brush.brush_settings_context != "GENERAL"): + layout.label(text="-WIP-") -class PHYSICS_PT_dp_output(PhysicButtonsPanel, bpy.types.Panel): - bl_label = "Dynamic Paint: Output" - bl_options = {'DEFAULT_CLOSED'} +class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): + bl_label = "Dynamic Paint: Advanced" @classmethod def poll(cls, context): md = context.dynamic_paint - return md and (md.dynamicpaint_type == 'CANVAS') + return md and (md.dynamicpaint_type == 'CANVAS') and (context.dynamic_paint.canvas_settings.active_surface) def draw(self, context): layout = self.layout canvas = context.dynamic_paint.canvas_settings + surface = canvas.active_surface + ob = context.object - col = layout.column() - col.prop(canvas, "output_paint") - sub = col.column() - sub.active = canvas.output_paint - sub.prop(canvas, "paint_output_path", text="") - sub.prop(canvas, "premultiply", text="Premultiply alpha") - - layout.separator() + layout.prop(surface, "surface_type", expand=False) - col = layout.column() - col.prop(canvas, "output_wet") - sub = col.column() - sub.active = canvas.output_wet - sub.prop(canvas, "wet_output_path", text="") - - layout.separator() + if (surface.surface_type == "PAINT"): + layout.prop(surface, "initial_color", expand=False) + col = layout.split(percentage=0.33) + col.prop(surface, "use_dissolve", text="Dissolve:") + sub = col.column() + sub.active = surface.use_dissolve + sub.prop(surface, "dissolve_speed", text="Time") - col = layout.column() - col.prop(canvas, "output_disp") - sub = col.column() - sub.active = canvas.output_disp - sub.prop(canvas, "displace_output_path", text="") - sub.prop(canvas, "displacement", text="Strength") + if (surface.surface_type == "DISPLACE"): + col = layout.split(percentage=0.33) + col.prop(surface, "use_dissolve", text="Flatten:") + sub = col.column() + sub.active = surface.use_dissolve + sub.prop(surface, "dissolve_speed", text="Time") + + layout.label(text="Brush Group:") + layout.prop(surface, "brush_group", text="") - split = sub.split() - sub = split.column() - sub.prop(canvas, "disp_type", text="Type") - sub = split.column() - sub.prop(canvas, "disp_format", text="Format") - -class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): - bl_label = "Dynamic Paint: Advanced" +class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): + bl_label = "Dynamic Paint: Output" bl_options = {'DEFAULT_CLOSED'} @classmethod def poll(cls, context): md = context.dynamic_paint - return md and (md.dynamicpaint_type == 'CANVAS') + if ((not md) or (md.dynamicpaint_type != 'CANVAS')): + return 0 + surface = context.dynamic_paint.canvas_settings.active_surface + return (surface and (not (surface.surface_format=="VERTEX" and surface.surface_type=="DISPLACE") )) def draw(self, context): layout = self.layout canvas = context.dynamic_paint.canvas_settings + surface = canvas.active_surface ob = context.object - - col = layout.column() - split = col.split(percentage=0.7) - split.prop(canvas, "dry_speed", text="Dry Time") - split.prop(canvas, "use_dry_log", text="Slow") - - col = layout.column() - col.prop(canvas, "use_dissolve_paint") - sub = col.column() - sub.active = canvas.use_dissolve_paint - sub.prop(canvas, "dissolve_speed", text="Time") - - col = layout.column() - col.prop(canvas, "use_flatten_disp", text="Flatten Displace") - sub = col.column() - sub.active = canvas.use_flatten_disp - sub.prop(canvas, "flatten_speed", text="Time") - layout.separator() + # vertex format outputs + if (surface.surface_format == "VERTEX"): + if (surface.surface_type == "PAINT"): + row = layout.row() + row.prop_search(surface, "output_name", ob.data, "vertex_colors", text="Paintmap layer: ") + #col = row.column(align=True) + #col.operator("dpaint.output_add", icon='ZOOMIN', text="") + + row = layout.row() + row.prop_search(surface, "output_name2", ob.data, "vertex_colors", text="Wetmap layer: ") + #col = row.column(align=True) + #col.operator("dpaint.output_add", icon='ZOOMIN', text="") + + # image format outputs + if (surface.surface_format == "IMAGE"): + col = layout.column() + col.label(text="UV layer:") + col.prop_search(surface, "uv_layer", ob.data, "uv_textures", text="") + + col = layout.column() + col.prop(surface, "image_output_path", text="Output directory") + if (surface.surface_type == "PAINT"): + col.prop(surface, "output_name", text="Paintmap: ") + col.prop(surface, "premultiply", text="Premultiply alpha") + col.prop(surface, "output_name2", text="Wetmap: ") + if (surface.surface_type == "DISPLACE"): + col.prop(surface, "output_name", text="Filename: ") + + layout.separator() + layout.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT') + if len(canvas.ui_info) != 0: + layout.label(text=canvas.ui_info) +# +# layout.separator() +# +# col = layout.column() +# col.prop(surface, "output_wet") +# sub = col.column() +# sub.active = surface.output_wet +# sub.prop(surface, "wet_output_path", text="") +# +# layout.separator() +# +# col = layout.column() +# col.prop(surface, "output_disp") +# sub = col.column() +# sub.active = surface.output_disp +# sub.prop(surface, "displace_output_path", text="") +# sub.prop(surface, "displacement", text="Strength") +# +# split = sub.split() +# sub = split.column() +# sub.prop(surface, "disp_type", text="Type") +# sub = split.column() +# sub.prop(surface, "disp_format", text="Format") - layout.prop_search(canvas, "uv_layer", ob.data, "uv_textures") class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Dynamic Paint: Effects" @@ -184,74 +226,98 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel): @classmethod def poll(cls, context): md = context.dynamic_paint - return md and (md.dynamicpaint_type == 'CANVAS') + if ((not md) or (md.dynamicpaint_type != 'CANVAS')): + return False; + surface = context.dynamic_paint.canvas_settings.active_surface + return surface and (surface.surface_format != "VERTEX") def draw(self, context): layout = self.layout canvas = context.dynamic_paint.canvas_settings + surface = canvas.active_surface - layout.prop(canvas, "effect_ui", expand=True) + layout.prop(surface, "effect_ui", expand=True) - if canvas.effect_ui == "SPREAD": - layout.prop(canvas, "use_spread") + if surface.effect_ui == "SPREAD": + layout.prop(surface, "use_spread") col = layout.column() - col.active = canvas.use_spread - col.prop(canvas, "spread_speed") + col.active = surface.use_spread + col.prop(surface, "spread_speed") - elif canvas.effect_ui == "DRIP": - layout.prop(canvas, "use_drip") + elif surface.effect_ui == "DRIP": + layout.prop(surface, "use_drip") col = layout.column() - col.active = canvas.use_drip - col.prop(canvas, "drip_speed") + col.active = surface.use_drip + col.prop(surface, "drip_speed") - elif canvas.effect_ui == "SHRINK": - layout.prop(canvas, "use_shrink") + elif surface.effect_ui == "SHRINK": + layout.prop(surface, "use_shrink") col = layout.column() - col.active = canvas.use_shrink - col.prop(canvas, "shrink_speed") + col.active = surface.use_shrink + col.prop(surface, "shrink_speed") + + +class PHYSICS_PT_dp_cache(PhysicButtonsPanel, bpy.types.Panel): + bl_label = "Dynamic Paint: Cache" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + md = context.dynamic_paint + return md and (md.dynamicpaint_type == 'CANVAS') and \ + (md.canvas_settings.active_surface) and (md.canvas_settings.active_surface.uses_cache) + + def draw(self, context): + layout = self.layout + + surface = context.dynamic_paint.canvas_settings.active_surface + cache = surface.point_cache + + point_cache_ui(self, context, cache, (cache.is_baked is False), 'DYNAMIC_PAINT') + -class PHYSICS_PT_dp_advanced_paint(PhysicButtonsPanel, bpy.types.Panel): +class PHYSICS_PT_dp_advanced_brush(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Dynamic Paint: Advanced" bl_options = {'DEFAULT_CLOSED'} @classmethod def poll(cls, context): md = context.dynamic_paint - return md and (md.dynamicpaint_type == 'PAINT') + return md and (md.dynamicpaint_type == 'BRUSH') def draw(self, context): layout = self.layout - paint = context.dynamic_paint.paint_settings + brush = context.dynamic_paint.brush_settings ob = context.object split = layout.split() col = split.column() - col.prop(paint, "paint_source") + col.prop(brush, "paint_source") - if paint.paint_source == "PSYS": - col.prop_search(paint, "psys", ob, "particle_systems", text="") - if paint.psys: + if brush.paint_source == "PSYS": + col.prop_search(brush, "psys", ob, "particle_systems", text="") + if brush.psys: col.label(text="Particle effect:") sub = col.column() - sub.active = not paint.use_part_radius - sub.prop(paint, "solid_radius", text="Solid Radius") - col.prop(paint, "use_part_radius", text="Use Particle's Radius") - col.prop(paint, "smooth_radius", text="Smooth radius") + sub.active = not brush.use_part_radius + sub.prop(brush, "solid_radius", text="Solid Radius") + col.prop(brush, "use_part_radius", text="Use Particle's Radius") + col.prop(brush, "smooth_radius", text="Smooth radius") - elif paint.paint_source == "DISTANCE" or paint.paint_source == "VOLDIST": - col.prop(paint, "paint_distance", text="Paint Distance") + elif brush.paint_source == "DISTANCE" or brush.paint_source == "VOLDIST": + col.prop(brush, "paint_distance", text="Paint Distance") split = layout.row().split() sub = split.column() - sub.prop(paint, "prox_facealigned", text="Face Aligned") + sub.prop(brush, "prox_facealigned", text="Face Aligned") sub = split.column() - sub.prop(paint, "prox_falloff", text="Falloff") - if paint.prox_falloff == "RAMP": + sub.prop(brush, "prox_falloff", text="Falloff") + if brush.prox_falloff == "RAMP": col = layout.row().column() col.label(text="Falloff Ramp:") - col.prop(paint, "prox_ramp_alpha", text="Only Use Alpha") - col.template_color_ramp(paint, "paint_ramp", expand=True) + col.prop(brush, "prox_ramp_alpha", text="Only Use Alpha") + col.template_color_ramp(brush, "paint_ramp", expand=True) def register(): bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index 7e62465d1ee..d53a9c9a2a0 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -134,6 +134,7 @@ class TIME_MT_cache(bpy.types.Menu): col.prop(st, "cache_particles") col.prop(st, "cache_cloth") col.prop(st, "cache_smoke") + col.prop(st, "cache_dynamicpaint") class TIME_MT_frame(bpy.types.Menu): -- cgit v1.2.3 From 71211818be68b3bf810270e0c9c716f3274e1cf0 Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Fri, 17 Jun 2011 18:04:56 +0000 Subject: Dynamic Paint: * Image sequence anti-aliasing works again. * Vertex color viewport preview now works with GLSL and textured view modes too. * Added a new "inverse" setting for "volume + proximity" brush. With it brush only has effect within volume but effect is lower near the mesh surface. --- release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 96f9b109839..46edc6e4116 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -310,12 +310,15 @@ class PHYSICS_PT_dp_advanced_brush(PhysicButtonsPanel, bpy.types.Panel): col.prop(brush, "paint_distance", text="Paint Distance") split = layout.row().split() sub = split.column() - sub.prop(brush, "prox_facealigned", text="Face Aligned") + sub.prop(brush, "prox_facealigned") sub = split.column() sub.prop(brush, "prox_falloff", text="Falloff") + if brush.paint_source == "VOLDIST": + col = layout.row().column() + col.prop(brush, "prox_inverse") if brush.prox_falloff == "RAMP": col = layout.row().column() - col.label(text="Falloff Ramp:") + col.separator() col.prop(brush, "prox_ramp_alpha", text="Only Use Alpha") col.template_color_ramp(brush, "paint_ramp", expand=True) -- cgit v1.2.3 From 40d4f34e82338b98d05595175504120fd98ae680 Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Sat, 18 Jun 2011 18:41:20 +0000 Subject: Dynamic Paint: * Added vertex weight painting. * Added dissolve/fade setting for every surface type. * Restored image format and displace type selection for image sequences. * Fixed a possible crash when OpenMP enabled. * Attempt to fix surface rna paths. * Fixed compile warnings. --- .../bl_ui/properties_physics_dynamicpaint.py | 74 +++++++++------------- 1 file changed, 30 insertions(+), 44 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 46edc6e4116..9f3f5902ad3 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -49,9 +49,9 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel): if md.dynamicpaint_type == 'CANVAS': canvas = md.canvas_settings - surface = canvas.active_surface + surface = canvas.canvas_surfaces.active row = layout.row() - row.template_list(canvas, "canvas_surfaces", canvas, "active_index", rows=2) + row.template_list(canvas, "canvas_surfaces", canvas.canvas_surfaces, "active_index", rows=2) col = row.column(align=True) col.operator("dpaint.surface_slot_add", icon='ZOOMIN', text="") @@ -113,31 +113,35 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): @classmethod def poll(cls, context): md = context.dynamic_paint - return md and (md.dynamicpaint_type == 'CANVAS') and (context.dynamic_paint.canvas_settings.active_surface) + return md and (md.dynamicpaint_type == 'CANVAS') and (context.dynamic_paint.canvas_settings.canvas_surfaces.active) def draw(self, context): layout = self.layout canvas = context.dynamic_paint.canvas_settings - surface = canvas.active_surface + surface = canvas.canvas_surfaces.active ob = context.object layout.prop(surface, "surface_type", expand=False) if (surface.surface_type == "PAINT"): layout.prop(surface, "initial_color", expand=False) - col = layout.split(percentage=0.33) - col.prop(surface, "use_dissolve", text="Dissolve:") - sub = col.column() - sub.active = surface.use_dissolve - sub.prop(surface, "dissolve_speed", text="Time") - - if (surface.surface_type == "DISPLACE"): - col = layout.split(percentage=0.33) - col.prop(surface, "use_dissolve", text="Flatten:") - sub = col.column() + split = layout.split(percentage=0.8) + split.prop(surface, "dry_speed", text="Dry Time") + split.prop(surface, "use_dry_log", text="Slow") + + if (surface.surface_type != "IWAVE"): + if (surface.surface_type == "DISPLACE"): + layout.prop(surface, "use_dissolve", text="Dissolve:") + elif (surface.surface_type == "WEIGHT"): + layout.prop(surface, "use_dissolve", text="Fade:") + else: + layout.prop(surface, "use_dissolve", text="Dissolve:") + sub = layout.column() sub.active = surface.use_dissolve - sub.prop(surface, "dissolve_speed", text="Time") + split = sub.split(percentage=0.8) + split.prop(surface, "dissolve_speed", text="Time") + split.prop(surface, "use_dissolve_log", text="Slow") layout.label(text="Brush Group:") layout.prop(surface, "brush_group", text="") @@ -152,14 +156,14 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): md = context.dynamic_paint if ((not md) or (md.dynamicpaint_type != 'CANVAS')): return 0 - surface = context.dynamic_paint.canvas_settings.active_surface + surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active return (surface and (not (surface.surface_format=="VERTEX" and surface.surface_type=="DISPLACE") )) def draw(self, context): layout = self.layout canvas = context.dynamic_paint.canvas_settings - surface = canvas.active_surface + surface = canvas.canvas_surfaces.active ob = context.object # vertex format outputs @@ -174,6 +178,8 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): row.prop_search(surface, "output_name2", ob.data, "vertex_colors", text="Wetmap layer: ") #col = row.column(align=True) #col.operator("dpaint.output_add", icon='ZOOMIN', text="") + if (surface.surface_type == "WEIGHT"): + layout.prop_search(surface, "output_name", ob, "vertex_groups", text="Vertex Group: ") # image format outputs if (surface.surface_format == "IMAGE"): @@ -189,34 +195,14 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): col.prop(surface, "output_name2", text="Wetmap: ") if (surface.surface_type == "DISPLACE"): col.prop(surface, "output_name", text="Filename: ") + col.prop(surface, "disp_type", text="Displace Type") + + col.prop(surface, "image_fileformat", text="Image Format:") layout.separator() layout.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT') if len(canvas.ui_info) != 0: layout.label(text=canvas.ui_info) -# -# layout.separator() -# -# col = layout.column() -# col.prop(surface, "output_wet") -# sub = col.column() -# sub.active = surface.output_wet -# sub.prop(surface, "wet_output_path", text="") -# -# layout.separator() -# -# col = layout.column() -# col.prop(surface, "output_disp") -# sub = col.column() -# sub.active = surface.output_disp -# sub.prop(surface, "displace_output_path", text="") -# sub.prop(surface, "displacement", text="Strength") -# -# split = sub.split() -# sub = split.column() -# sub.prop(surface, "disp_type", text="Type") -# sub = split.column() -# sub.prop(surface, "disp_format", text="Format") class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel): @@ -228,14 +214,14 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel): md = context.dynamic_paint if ((not md) or (md.dynamicpaint_type != 'CANVAS')): return False; - surface = context.dynamic_paint.canvas_settings.active_surface + surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active return surface and (surface.surface_format != "VERTEX") def draw(self, context): layout = self.layout canvas = context.dynamic_paint.canvas_settings - surface = canvas.active_surface + surface = canvas.canvas_surfaces.active layout.prop(surface, "effect_ui", expand=True) @@ -266,12 +252,12 @@ class PHYSICS_PT_dp_cache(PhysicButtonsPanel, bpy.types.Panel): def poll(cls, context): md = context.dynamic_paint return md and (md.dynamicpaint_type == 'CANVAS') and \ - (md.canvas_settings.active_surface) and (md.canvas_settings.active_surface.uses_cache) + (md.canvas_settings.canvas_surfaces.active) and (md.canvas_settings.canvas_surfaces.active.uses_cache) def draw(self, context): layout = self.layout - surface = context.dynamic_paint.canvas_settings.active_surface + surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active cache = surface.point_cache point_cache_ui(self, context, cache, (cache.is_baked is False), 'DYNAMIC_PAINT') -- cgit v1.2.3 From cb12648656fc001e8c4c6d00df73e52d452f8787 Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Mon, 27 Jun 2011 07:30:58 +0000 Subject: Dynamic Paint: * Fixed memory leak when baking image sequences. * Fixed sub-steps when brush was controlled by a parent object. * Added option to select active outputs for paint surfaces. * Improved color mixing algorithm. * Improved memory allocation behavior. * Memory is now freed even in case of errors. * Removed "initial color" setting, as it's better to adjust color from material. * "Paint effects" system: ** Converted to use new data structures. ** Works now with any number of surrounding points. ** Re-implemented support for UV-image surfaces. ** Added support for vertex surfaces too. ** Improved color handling. ** Improved movement stability. ** "Drip" effect uses now Blender's force fields instead of just z-directional gravity like before. Now each surface point can have different force influence. --- .../bl_ui/properties_physics_dynamicpaint.py | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 9f3f5902ad3..52945ab7e11 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -21,6 +21,7 @@ import bpy from bl_ui.properties_physics_common import ( point_cache_ui, + effector_weights_ui, ) class PhysicButtonsPanel(): @@ -123,9 +124,9 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): ob = context.object layout.prop(surface, "surface_type", expand=False) + layout.separator() if (surface.surface_type == "PAINT"): - layout.prop(surface, "initial_color", expand=False) split = layout.split(percentage=0.8) split.prop(surface, "dry_speed", text="Dry Time") split.prop(surface, "use_dry_log", text="Slow") @@ -189,15 +190,21 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): col = layout.column() col.prop(surface, "image_output_path", text="Output directory") + col.prop(surface, "image_fileformat", text="Image Format:") if (surface.surface_type == "PAINT"): - col.prop(surface, "output_name", text="Paintmap: ") - col.prop(surface, "premultiply", text="Premultiply alpha") - col.prop(surface, "output_name2", text="Wetmap: ") + col.prop(surface, "do_output1", text="Output Paintmaps:") + sub = col.column() + sub.active = surface.do_output1 + sub.prop(surface, "output_name", text="Filename: ") + sub.prop(surface, "premultiply", text="Premultiply alpha") + + col.prop(surface, "do_output2", text="Output Wetmaps:") + sub = col.column() + sub.active = surface.do_output2 + sub.prop(surface, "output_name2", text="Filename: ") if (surface.surface_type == "DISPLACE"): col.prop(surface, "output_name", text="Filename: ") col.prop(surface, "disp_type", text="Displace Type") - - col.prop(surface, "image_fileformat", text="Image Format:") layout.separator() layout.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT') @@ -215,7 +222,7 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel): if ((not md) or (md.dynamicpaint_type != 'CANVAS')): return False; surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active - return surface and (surface.surface_format != "VERTEX") + return surface and (surface.surface_format != "PTEX") def draw(self, context): layout = self.layout @@ -235,7 +242,7 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel): layout.prop(surface, "use_drip") col = layout.column() col.active = surface.use_drip - col.prop(surface, "drip_speed") + effector_weights_ui(self, context, surface.effector_weights) elif surface.effect_ui == "SHRINK": layout.prop(surface, "use_shrink") -- cgit v1.2.3 From 9ae663154fd9f100c299afaab05a560b1a2a55a4 Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Sat, 2 Jul 2011 18:06:39 +0000 Subject: * Added a new surface type "Waves" that simulates simple 2D wave motion. * Optimized adjacency point searching for vertex surfaces. * Separated adjacency code from effect system. * Overall code cleaning and tweaking. --- .../bl_ui/properties_physics_dynamicpaint.py | 29 ++++++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 52945ab7e11..806256dd502 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -104,7 +104,12 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel): col.prop(brush, "paint_color", text="") col.prop(brush, "paint_alpha", text="Alpha") - if (brush.brush_settings_context != "GENERAL"): + elif (brush.brush_settings_context == "WAVE"): + layout.prop(brush, "wave_type") + if (brush.wave_type != "REFLECT"): + split = layout.split(percentage=0.6) + split.prop(brush, "wave_factor") + else: layout.label(text="-WIP-") @@ -131,7 +136,7 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): split.prop(surface, "dry_speed", text="Dry Time") split.prop(surface, "use_dry_log", text="Slow") - if (surface.surface_type != "IWAVE"): + if (surface.surface_type != "WAVE"): if (surface.surface_type == "DISPLACE"): layout.prop(surface, "use_dissolve", text="Dissolve:") elif (surface.surface_type == "WEIGHT"): @@ -144,6 +149,19 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): split.prop(surface, "dissolve_speed", text="Time") split.prop(surface, "use_dissolve_log", text="Slow") + if (surface.surface_type == "WAVE"): + layout.prop(surface, "wave_open_borders") + + split = layout.split() + + col = split.column(align=True) + col.prop(surface, "wave_timescale") + col.prop(surface, "wave_speed") + + col = split.column(align=True) + col.prop(surface, "wave_damping") + col.prop(surface, "wave_spring") + layout.label(text="Brush Group:") layout.prop(surface, "brush_group", text="") @@ -158,7 +176,7 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): if ((not md) or (md.dynamicpaint_type != 'CANVAS')): return 0 surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active - return (surface and (not (surface.surface_format=="VERTEX" and surface.surface_type=="DISPLACE") )) + return (surface and not (surface.surface_format=="VERTEX" and (surface.surface_type=="DISPLACE" or surface.surface_type=="WAVE"))) def draw(self, context): layout = self.layout @@ -202,9 +220,10 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): sub = col.column() sub.active = surface.do_output2 sub.prop(surface, "output_name2", text="Filename: ") - if (surface.surface_type == "DISPLACE"): + else: col.prop(surface, "output_name", text="Filename: ") - col.prop(surface, "disp_type", text="Displace Type") + if (surface.surface_type == "DISPLACE"): + col.prop(surface, "disp_type", text="Displace Type") layout.separator() layout.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT') -- cgit v1.2.3 From 901f24716b70e961a28fabc5820ced0983b025e0 Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Sun, 3 Jul 2011 14:01:57 +0000 Subject: Dynamic Paint: * Some ui and rna tweaking. * Effects ui panel is no longer visible for non-paint surfaces. --- .../startup/bl_ui/properties_physics_dynamicpaint.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 806256dd502..d93645d0c5c 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -132,6 +132,7 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): layout.separator() if (surface.surface_type == "PAINT"): + layout.label(text="Wetmap drying:") split = layout.split(percentage=0.8) split.prop(surface, "dry_speed", text="Dry Time") split.prop(surface, "use_dry_log", text="Slow") @@ -206,16 +207,23 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): col.label(text="UV layer:") col.prop_search(surface, "uv_layer", ob.data, "uv_textures", text="") + col.separator() col = layout.column() col.prop(surface, "image_output_path", text="Output directory") - col.prop(surface, "image_fileformat", text="Image Format:") + col.prop(surface, "image_fileformat", text="Image Format") + col.separator() if (surface.surface_type == "PAINT"): + split = col.split() + col = split.column() col.prop(surface, "do_output1", text="Output Paintmaps:") - sub = col.column() + sub = split.column() + sub.prop(surface, "premultiply", text="Premultiply alpha") + sub.active = surface.do_output1 + sub = layout.column() sub.active = surface.do_output1 sub.prop(surface, "output_name", text="Filename: ") - sub.prop(surface, "premultiply", text="Premultiply alpha") + col = layout.column() col.prop(surface, "do_output2", text="Output Wetmaps:") sub = col.column() sub.active = surface.do_output2 @@ -241,7 +249,7 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel): if ((not md) or (md.dynamicpaint_type != 'CANVAS')): return False; surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active - return surface and (surface.surface_format != "PTEX") + return surface and (surface.surface_type == "PAINT") def draw(self, context): layout = self.layout -- cgit v1.2.3 From f8f1cbd17f2b0c624d88ee7f7502e544472b4b6e Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Fri, 8 Jul 2011 11:03:37 +0000 Subject: Dynamic Paint: * Canvas and brush can be now enabled simultaneously. This way it's possible for two canvases to interact. * Added basic anti-aliasing support for vertex surfaces. * 3D-view color preview now works even when there's subsurf modifier after Dynamic Paint in modifier stack. * Added a new brush option to use proximity from object center. * Default surface frame range now use scene's start and end values. * Improved ray checks for volume brushes. * Added new "non-closed" option for volume brushes. This way it's possible to use planar meshes as "volume" brushes with predefined ray direction. * New carrot branch splash image by CGEffex. * Improved brush affection code. * Lots of smaller improvements. * Fixed: Weight paint didn't work with particles. * Fixed: Point cache didn't work for non-wave surfaces anymore since last commit. --- release/datafiles/splash.png | Bin 201866 -> 201051 bytes .../bl_ui/properties_physics_dynamicpaint.py | 145 ++++++++++++--------- 2 files changed, 82 insertions(+), 63 deletions(-) (limited to 'release') diff --git a/release/datafiles/splash.png b/release/datafiles/splash.png index d6ccdb5b733..6ef93bfb041 100644 Binary files a/release/datafiles/splash.png and b/release/datafiles/splash.png differ diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index d93645d0c5c..6aac537de12 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -46,71 +46,81 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel): ob = context.object if md: - layout.prop(md, "dynamicpaint_type", expand=True) + layout.prop(md, "ui_type", expand=True) - if md.dynamicpaint_type == 'CANVAS': + if (md.ui_type == "CANVAS"): canvas = md.canvas_settings - surface = canvas.canvas_surfaces.active - row = layout.row() - row.template_list(canvas, "canvas_surfaces", canvas.canvas_surfaces, "active_index", rows=2) - - col = row.column(align=True) - col.operator("dpaint.surface_slot_add", icon='ZOOMIN', text="") - col.operator("dpaint.surface_slot_remove", icon='ZOOMOUT', text="") - if surface: - layout.prop(surface, "name") - layout.prop(surface, "surface_format", expand=False) + if (not canvas): + layout.operator("dpaint.type_toggle", text="Add Canvas").type = 'CANVAS' + else: + layout.operator("dpaint.type_toggle", text="Remove Canvas", icon='X').type = 'CANVAS' + + surface = canvas.canvas_surfaces.active + row = layout.row() + row.template_list(canvas, "canvas_surfaces", canvas.canvas_surfaces, "active_index", rows=2) + + col = row.column(align=True) + col.operator("dpaint.surface_slot_add", icon='ZOOMIN', text="") + col.operator("dpaint.surface_slot_remove", icon='ZOOMOUT', text="") - if surface.surface_format != "VERTEX": + if surface: + layout.prop(surface, "name") + layout.prop(surface, "surface_format", expand=False) col = layout.column() - col.label(text="Quality:") - col.prop(surface, "image_resolution") + + if surface.surface_format != "VERTEX": + col.label(text="Quality:") + col.prop(surface, "image_resolution") col.prop(surface, "use_anti_aliasing") - - col = layout.column() - col.label(text="Frames:") - split = col.split() - - col = split.column(align=True) - col.prop(surface, "start_frame", text="Start") - col.prop(surface, "end_frame", text="End") - - col = split.column() - col.prop(surface, "substeps") - + + col = layout.column() + col.label(text="Frames:") + split = col.split() + + col = split.column(align=True) + col.prop(surface, "start_frame", text="Start") + col.prop(surface, "end_frame", text="End") + + col = split.column() + col.prop(surface, "substeps") - elif md.dynamicpaint_type == 'BRUSH': + elif (md.ui_type == "BRUSH"): brush = md.brush_settings - layout.prop(brush, "brush_settings_context", expand=True, icon_only=True) - - if (brush.brush_settings_context == "GENERAL"): - split = layout.split() + if (not brush): + layout.operator("dpaint.type_toggle", text="Add Brush").type = 'BRUSH' + else: + layout.operator("dpaint.type_toggle", text="Remove Brush", icon='X').type = 'BRUSH' + + layout.prop(brush, "brush_settings_context", expand=True, icon_only=True) + + if (brush.brush_settings_context == "GENERAL"): + split = layout.split() - col = split.column() - col.prop(brush, "absolute_alpha") - col.prop(brush, "paint_erase") - col.prop(brush, "paint_wetness", text="Wetness") - - col = split.column() - sub = col.column() - sub.active = (brush.paint_source != "PSYS"); - sub.prop(brush, "use_material") - if brush.use_material and brush.paint_source != "PSYS": - col.prop(brush, "material", text="") - col.prop(brush, "paint_alpha", text="Alpha Factor") + col = split.column() + col.prop(brush, "absolute_alpha") + col.prop(brush, "paint_erase") + col.prop(brush, "paint_wetness", text="Wetness") + + col = split.column() + sub = col.column() + sub.active = (brush.paint_source != "PSYS"); + sub.prop(brush, "use_material") + if brush.use_material and brush.paint_source != "PSYS": + col.prop(brush, "material", text="") + col.prop(brush, "paint_alpha", text="Alpha Factor") + else: + col.prop(brush, "paint_color", text="") + col.prop(brush, "paint_alpha", text="Alpha") + + elif (brush.brush_settings_context == "WAVE"): + layout.prop(brush, "wave_type") + if (brush.wave_type != "REFLECT"): + split = layout.split(percentage=0.6) + split.prop(brush, "wave_factor") else: - col.prop(brush, "paint_color", text="") - col.prop(brush, "paint_alpha", text="Alpha") - - elif (brush.brush_settings_context == "WAVE"): - layout.prop(brush, "wave_type") - if (brush.wave_type != "REFLECT"): - split = layout.split(percentage=0.6) - split.prop(brush, "wave_factor") - else: - layout.label(text="-WIP-") + layout.label(text="-WIP-") class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): @@ -119,7 +129,7 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): @classmethod def poll(cls, context): md = context.dynamic_paint - return md and (md.dynamicpaint_type == 'CANVAS') and (context.dynamic_paint.canvas_settings.canvas_surfaces.active) + return md and (md.ui_type == "CANVAS") and (md.canvas_settings) and (md.canvas_settings.canvas_surfaces.active) def draw(self, context): layout = self.layout @@ -174,7 +184,7 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): @classmethod def poll(cls, context): md = context.dynamic_paint - if ((not md) or (md.dynamicpaint_type != 'CANVAS')): + if (not (md and (md.ui_type == "CANVAS") and (md.canvas_settings))): return 0 surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active return (surface and not (surface.surface_format=="VERTEX" and (surface.surface_type=="DISPLACE" or surface.surface_type=="WAVE"))) @@ -246,7 +256,7 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel): @classmethod def poll(cls, context): md = context.dynamic_paint - if ((not md) or (md.dynamicpaint_type != 'CANVAS')): + if (not (md and (md.ui_type == "CANVAS") and (md.canvas_settings))): return False; surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active return surface and (surface.surface_type == "PAINT") @@ -285,7 +295,7 @@ class PHYSICS_PT_dp_cache(PhysicButtonsPanel, bpy.types.Panel): @classmethod def poll(cls, context): md = context.dynamic_paint - return md and (md.dynamicpaint_type == 'CANVAS') and \ + return md and (md.ui_type == "CANVAS") and (md.canvas_settings) and \ (md.canvas_settings.canvas_surfaces.active) and (md.canvas_settings.canvas_surfaces.active.uses_cache) def draw(self, context): @@ -304,7 +314,7 @@ class PHYSICS_PT_dp_advanced_brush(PhysicButtonsPanel, bpy.types.Panel): @classmethod def poll(cls, context): md = context.dynamic_paint - return md and (md.dynamicpaint_type == 'BRUSH') + return md and (md.ui_type == "BRUSH") and (md.brush_settings) def draw(self, context): layout = self.layout @@ -325,12 +335,21 @@ class PHYSICS_PT_dp_advanced_brush(PhysicButtonsPanel, bpy.types.Panel): sub.prop(brush, "solid_radius", text="Solid Radius") col.prop(brush, "use_part_radius", text="Use Particle's Radius") col.prop(brush, "smooth_radius", text="Smooth radius") - - elif brush.paint_source == "DISTANCE" or brush.paint_source == "VOLDIST": + elif brush.paint_source in {'VOLUME', 'VOLDIST'}: + split = layout.row().split(percentage=0.4) + sub = split.column() + sub.prop(brush, "accept_nonclosed") + if brush.accept_nonclosed: + sub = split.column() + sub.prop(brush, "ray_dir") + + + if brush.paint_source in {'DISTANCE', 'VOLDIST', 'POINT'}: col.prop(brush, "paint_distance", text="Paint Distance") - split = layout.row().split() + split = layout.row().split(percentage=0.4) sub = split.column() - sub.prop(brush, "prox_facealigned") + if (brush.paint_source != 'POINT'): + sub.prop(brush, "prox_facealigned") sub = split.column() sub.prop(brush, "prox_falloff", text="Falloff") if brush.paint_source == "VOLDIST": -- cgit v1.2.3 From 8394f65d4a6019ae623fe32268a769463a189b9e Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Wed, 3 Aug 2011 18:31:48 +0000 Subject: Dynamic Paint: * Object velocity can now be used to determine brush influence and color. * Brushes can now be set to "smudge" existing paint. * Added new operators to easily add and remove surface output mesh data layers from Dynamic Paint ui. * Fixed drip effect algorithm to work properly on forces pointing towards surface. * Adjusted drip effect speed. * Drip effect can now use canvas velocity and acceleration to influence drip direction. * Fixed texture mapping for material enabled brushes. * "Object Center" type brushes can now use "material color" as well. * Improved surface partitioning grid generation algorithm. * Fixed possible invalid brush collision detection when OpenMP enabled. * Fixed incorrect random sized particle displace/wave influence. * Fixed "Object Center" brush color ramp falloff. * Fixed invalid zero alpha sampling when rendering vertex colors. * Lots of smaller tweaking. --- .../bl_ui/properties_physics_dynamicpaint.py | 45 +++++++++++++++++++--- 1 file changed, 40 insertions(+), 5 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 6aac537de12..15326b51172 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -119,6 +119,19 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel): if (brush.wave_type != "REFLECT"): split = layout.split(percentage=0.6) split.prop(brush, "wave_factor") + elif (brush.brush_settings_context == "VELOCITY"): + col = layout.row().column() + col.prop(brush, "velocity_alpha") + col.prop(brush, "velocity_color") + col.prop(brush, "velocity_depth") + col = layout.row().column() + sub = col.column() + sub.active = (brush.velocity_alpha or brush.velocity_color) + sub.prop(brush, "max_velocity") + sub.template_color_ramp(brush, "velocity_ramp", expand=True) + layout.separator() + layout.prop(brush, "do_smudge") + layout.prop(brush, "smudge_strength") else: layout.label(text="-WIP-") @@ -199,17 +212,31 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): # vertex format outputs if (surface.surface_format == "VERTEX"): if (surface.surface_type == "PAINT"): + # paintmap output row = layout.row() row.prop_search(surface, "output_name", ob.data, "vertex_colors", text="Paintmap layer: ") - #col = row.column(align=True) - #col.operator("dpaint.output_add", icon='ZOOMIN', text="") + ic = 'ZOOMIN' + if (surface.output_exists(object=ob, index=0)): + ic = 'ZOOMOUT' + col = row.column(align=True) + col.operator("dpaint.output_toggle", icon=ic, text="").index = 0 + # wetmap output row = layout.row() row.prop_search(surface, "output_name2", ob.data, "vertex_colors", text="Wetmap layer: ") - #col = row.column(align=True) - #col.operator("dpaint.output_add", icon='ZOOMIN', text="") + ic = 'ZOOMIN' + if (surface.output_exists(object=ob, index=1)): + ic = 'ZOOMOUT' + col = row.column(align=True) + col.operator("dpaint.output_toggle", icon=ic, text="").index = 1 if (surface.surface_type == "WEIGHT"): - layout.prop_search(surface, "output_name", ob, "vertex_groups", text="Vertex Group: ") + row = layout.row() + row.prop_search(surface, "output_name", ob, "vertex_groups", text="Vertex Group: ") + ic = 'ZOOMIN' + if (surface.output_exists(object=ob, index=0)): + ic = 'ZOOMOUT' + col = row.column(align=True) + col.operator("dpaint.output_toggle", icon=ic, text="").index = 0 # image format outputs if (surface.surface_format == "IMAGE"): @@ -280,6 +307,14 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel): col = layout.column() col.active = surface.use_drip effector_weights_ui(self, context, surface.effector_weights) + split = layout.split() + + layout.label(text="Surface Movement:") + split = layout.split() + col = split.column() + col.prop(surface, "drip_velocity", slider=True) + col = split.column() + col.prop(surface, "drip_acceleration", slider=True) elif surface.effect_ui == "SHRINK": layout.prop(surface, "use_shrink") -- cgit v1.2.3 From f4c93eb580ede4863ab200b557fba7a8e1308b82 Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Thu, 4 Aug 2011 07:09:21 +0000 Subject: Dynamic Paint: * Smudge now works properly with substeps. * Velocity brush speed clamping now works for all brush types. * Small tweaking on velocity brush ui. --- .../scripts/startup/bl_ui/properties_physics_dynamicpaint.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 15326b51172..711c26b9033 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -121,15 +121,19 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel): split.prop(brush, "wave_factor") elif (brush.brush_settings_context == "VELOCITY"): col = layout.row().column() + col.label(text="Velocity Settings:") + split = layout.split() + col = split.column() col.prop(brush, "velocity_alpha") col.prop(brush, "velocity_color") + col = split.column() col.prop(brush, "velocity_depth") - col = layout.row().column() - sub = col.column() - sub.active = (brush.velocity_alpha or brush.velocity_color) + sub = layout.row().column() + sub.active = (brush.velocity_alpha or brush.velocity_color or brush.velocity_depth) sub.prop(brush, "max_velocity") sub.template_color_ramp(brush, "velocity_ramp", expand=True) layout.separator() + layout.label(text="Smudge:") layout.prop(brush, "do_smudge") layout.prop(brush, "smudge_strength") else: -- cgit v1.2.3 From 5467df14cac09a05081db0aa2166306e0f35cbe4 Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Fri, 5 Aug 2011 09:31:35 +0000 Subject: Dynamic Paint: * Added a new "color spread" slider for "spread" effect to adjust how much colors get mixed. * Improved smudge behavior on "wet" paint. * Displace can now be set "incremental". This way it's added on top of previous displace. * Added "displace clamp" setting. You can use it to limit maximum amount of displace. * Fix: velocity data wasn't always initialized, this could lead to no effect at all or crash. * Fix: Vertex color rendering near zero alpha values was still incorrect. --- .../scripts/startup/bl_ui/properties_physics_dynamicpaint.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 711c26b9033..1560019e2ac 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -158,6 +158,7 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): layout.prop(surface, "surface_type", expand=False) layout.separator() + # dissolve if (surface.surface_type == "PAINT"): layout.label(text="Wetmap drying:") split = layout.split(percentage=0.8) @@ -176,6 +177,11 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): split = sub.split(percentage=0.8) split.prop(surface, "dissolve_speed", text="Time") split.prop(surface, "use_dissolve_log", text="Slow") + + # per type settings + if (surface.surface_type == "DISPLACE"): + layout.prop(surface, "disp_clamp") + layout.prop(surface, "incremental_disp") if (surface.surface_type == "WAVE"): layout.prop(surface, "wave_open_borders") @@ -304,7 +310,11 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel): layout.prop(surface, "use_spread") col = layout.column() col.active = surface.use_spread - col.prop(surface, "spread_speed") + split = col.split() + sub = split.column() + sub.prop(surface, "spread_speed") + sub = split.column() + sub.prop(surface, "color_spread_speed") elif surface.effect_ui == "DRIP": layout.prop(surface, "use_drip") -- cgit v1.2.3 From 5b7133448439a510e779209c35aebd4cf38ff637 Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Sun, 21 Aug 2011 19:03:47 +0000 Subject: Dynamic Paint: * Bake calculation memory is now freed if surface is deactivated or baked. * Fixed possibly incorrect brush influence when using "Non-Closed" brush setting. * Added new rna property descriptions. * Added some comments and general code cleanup. --- release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 1560019e2ac..25de00f64ea 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -400,7 +400,7 @@ class PHYSICS_PT_dp_advanced_brush(PhysicButtonsPanel, bpy.types.Panel): if (brush.paint_source != 'POINT'): sub.prop(brush, "prox_facealigned") sub = split.column() - sub.prop(brush, "prox_falloff", text="Falloff") + sub.prop(brush, "prox_falloff") if brush.paint_source == "VOLDIST": col = layout.row().column() col.prop(brush, "prox_inverse") -- cgit v1.2.3 From 0bb7ddad97fccc7f746a744760f281125482603a Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Sun, 28 Aug 2011 16:36:47 +0000 Subject: Dynamic Paint: * Added option to preview surface wetmap instead of paint. * Changed default paint color to blue for better visibility. * Fix: Random sized particles didn't work anymore. * Fix: Particle initial velocity issues when using canvas substeps and a particle brush. --- release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 25de00f64ea..7d02765297d 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -222,6 +222,9 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): # vertex format outputs if (surface.surface_format == "VERTEX"): if (surface.surface_type == "PAINT"): + # toggle active preview + layout.prop(surface, "preview_id") + # paintmap output row = layout.row() row.prop_search(surface, "output_name", ob.data, "vertex_colors", text="Paintmap layer: ") -- cgit v1.2.3 From 79ef35889f850aa7173800bcf67918c14f3b1291 Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Mon, 5 Sep 2011 16:04:15 +0000 Subject: Dynamic Paint: * Added "Initial Color" setting for surfaces. You can for example set color from UV mapped texture or from vertex colors. * Added clamping option for "wave" brushes. * Merged smudge and drip adjacency search code. This fixes some issues with drip effect and makes code easier to maintain. * Some adjustments to the bounding box generation code. * OpenMP is now completely disabled if no compile flag is set. * Wetness values are now properly clamped on vertex surfaces. No more black dots on >1.0 wetness. * Textured brushes now use same function calls as internal renderer, instead of modified duplicates. * Moved operator code to editors/physics/. * Re-enabled some particle brush optimizations. * Fixed sometimes incorrect volume brush influence. * Fixed possible crash when using a brush that uses "Voxel Data" texture simultaneously with material preview or render. * Fixed texture mapping issues for "Object Center" brush. * Fixed possible crash/corruption when duplicating brush object that uses color ramps. * Other tweaking and code cleanup. --- .../bl_ui/properties_physics_dynamicpaint.py | 40 ++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 7d02765297d..88cfc2afbda 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -117,8 +117,11 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel): elif (brush.brush_settings_context == "WAVE"): layout.prop(brush, "wave_type") if (brush.wave_type != "REFLECT"): - split = layout.split(percentage=0.6) - split.prop(brush, "wave_factor") + split = layout.split(percentage=0.5) + col = split.column() + col.prop(brush, "wave_factor") + col = split.column() + col.prop(brush, "wave_clamp") elif (brush.brush_settings_context == "VELOCITY"): col = layout.row().column() col.label(text="Velocity Settings:") @@ -199,6 +202,39 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): layout.label(text="Brush Group:") layout.prop(surface, "brush_group", text="") +class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, bpy.types.Panel): + bl_label = "Dynamic Paint: Initial Color" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + md = context.dynamic_paint + if (not (md and (md.ui_type == "CANVAS") and (md.canvas_settings))): + return 0 + surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active + return (surface and surface.surface_type=="PAINT") + + def draw(self, context): + layout = self.layout + + canvas = context.dynamic_paint.canvas_settings + surface = canvas.canvas_surfaces.active + ob = context.object + + layout.prop(surface, "init_color_type", expand=False) + layout.separator() + + # dissolve + if (surface.init_color_type == "COLOR"): + layout.prop(surface, "init_color") + + if (surface.init_color_type == "TEXTURE"): + layout.prop(surface, "init_texture") + layout.prop_search(surface, "init_layername", ob.data, "uv_textures", text="UV Layer:") + + if (surface.init_color_type == "VERTEXCOLOR"): + layout.prop_search(surface, "init_layername", ob.data, "vertex_colors", text="Color Layer: ") + class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Dynamic Paint: Output" -- cgit v1.2.3 From 9de082dbf4130b48d59e673ed276a046d97cc1e4 Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Sat, 10 Sep 2011 08:55:44 +0000 Subject: Dynamic Paint: * Enabled modifier "Apply" button since it can now be used to apply displacement or output layers to the mesh. * Default surface output names are now unique in case canvas has multiple surfaces of same type. * Merged "face aligned" and "non-closed" brush options to a single "Project" toggle, available for "Proximity" brushes. * Added more icons to user interface selections. * Increased default proximity distance. * Set proximity falloff ramp to only affect alpha by default. * Removed some no longer required render ext. functions. * Fix: geometry node vertex alpha didn't work unless "Vertex Color Paint/Light" was enabled from material. --- .../bl_ui/properties_physics_dynamicpaint.py | 84 +++++++++++----------- 1 file changed, 43 insertions(+), 41 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 88cfc2afbda..9847c7f5c4b 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -202,40 +202,6 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): layout.label(text="Brush Group:") layout.prop(surface, "brush_group", text="") -class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, bpy.types.Panel): - bl_label = "Dynamic Paint: Initial Color" - bl_options = {'DEFAULT_CLOSED'} - - @classmethod - def poll(cls, context): - md = context.dynamic_paint - if (not (md and (md.ui_type == "CANVAS") and (md.canvas_settings))): - return 0 - surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active - return (surface and surface.surface_type=="PAINT") - - def draw(self, context): - layout = self.layout - - canvas = context.dynamic_paint.canvas_settings - surface = canvas.canvas_surfaces.active - ob = context.object - - layout.prop(surface, "init_color_type", expand=False) - layout.separator() - - # dissolve - if (surface.init_color_type == "COLOR"): - layout.prop(surface, "init_color") - - if (surface.init_color_type == "TEXTURE"): - layout.prop(surface, "init_texture") - layout.prop_search(surface, "init_layername", ob.data, "uv_textures", text="UV Layer:") - - if (surface.init_color_type == "VERTEXCOLOR"): - layout.prop_search(surface, "init_layername", ob.data, "vertex_colors", text="Color Layer: ") - - class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Dynamic Paint: Output" bl_options = {'DEFAULT_CLOSED'} @@ -323,7 +289,39 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): layout.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT') if len(canvas.ui_info) != 0: layout.label(text=canvas.ui_info) - + +class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, bpy.types.Panel): + bl_label = "Dynamic Paint: Initial Color" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + md = context.dynamic_paint + if (not (md and (md.ui_type == "CANVAS") and (md.canvas_settings))): + return 0 + surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active + return (surface and surface.surface_type=="PAINT") + + def draw(self, context): + layout = self.layout + + canvas = context.dynamic_paint.canvas_settings + surface = canvas.canvas_surfaces.active + ob = context.object + + layout.prop(surface, "init_color_type", expand=False) + layout.separator() + + # dissolve + if (surface.init_color_type == "COLOR"): + layout.prop(surface, "init_color") + + if (surface.init_color_type == "TEXTURE"): + layout.prop(surface, "init_texture") + layout.prop_search(surface, "init_layername", ob.data, "uv_textures", text="UV Layer:") + + if (surface.init_color_type == "VERTEXCOLOR"): + layout.prop_search(surface, "init_layername", ob.data, "vertex_colors", text="Color Layer: ") class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Dynamic Paint: Effects" @@ -427,7 +425,7 @@ class PHYSICS_PT_dp_advanced_brush(PhysicButtonsPanel, bpy.types.Panel): split = layout.row().split(percentage=0.4) sub = split.column() sub.prop(brush, "accept_nonclosed") - if brush.accept_nonclosed: + if brush.prox_project: sub = split.column() sub.prop(brush, "ray_dir") @@ -436,13 +434,17 @@ class PHYSICS_PT_dp_advanced_brush(PhysicButtonsPanel, bpy.types.Panel): col.prop(brush, "paint_distance", text="Paint Distance") split = layout.row().split(percentage=0.4) sub = split.column() - if (brush.paint_source != 'POINT'): - sub.prop(brush, "prox_facealigned") + if brush.paint_source == 'DISTANCE': + sub.prop(brush, "prox_project") + if brush.paint_source == "VOLDIST": + sub.prop(brush, "prox_inverse") + sub = split.column() + if brush.paint_source == 'DISTANCE': + column = sub.column() + column.active = brush.prox_project + column.prop(brush, "ray_dir") sub.prop(brush, "prox_falloff") - if brush.paint_source == "VOLDIST": - col = layout.row().column() - col.prop(brush, "prox_inverse") if brush.prox_falloff == "RAMP": col = layout.row().column() col.separator() -- cgit v1.2.3 From 8bf78d7f5676520bf6f4241afb88fba506e342f4 Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Thu, 13 Oct 2011 20:00:22 +0000 Subject: Dynamic Paint: * Fix: Wave "timescale" also changed simulation behavior. Now different timescale values will lead to nearly identical results, just slower or faster. * Added "Displace Factor" setting for vertex displace surfaces. You can use it to adjust final displace strength or use negative values to paint bumps. * Added clamp/map value to wave image sequence output settings. * RNA description tweaking. * General code tweaking. --- .../scripts/startup/bl_ui/properties_physics_dynamicpaint.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 21f220b27f6..4c59ed85639 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -183,8 +183,13 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): # per type settings if (surface.surface_type == "DISPLACE"): - layout.prop(surface, "disp_clamp") layout.prop(surface, "incremental_disp") + if (surface.surface_format == "VERTEX"): + split = layout.split() + col = split.column() + col.prop(surface, "depth_clamp") + col = split.column() + col.prop(surface, "disp_factor") if (surface.surface_type == "WAVE"): layout.prop(surface, "wave_open_borders") @@ -284,6 +289,9 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): col.prop(surface, "output_name", text="Filename: ") if (surface.surface_type == "DISPLACE"): col.prop(surface, "disp_type", text="Displace Type") + col.prop(surface, "depth_clamp") + if (surface.surface_type == "WAVE"): + col.prop(surface, "depth_clamp", text="Wave Clamp") layout.separator() layout.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT') -- cgit v1.2.3 From 30cba27987362054d16b10e73ddf2601af93be68 Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Sat, 22 Oct 2011 16:16:14 +0000 Subject: Dynamic Paint: * Some changes and cleanup pointed on the codereview. --- .../bl_ui/properties_physics_dynamicpaint.py | 133 ++++++++++++--------- 1 file changed, 78 insertions(+), 55 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 4c59ed85639..4a116707d0e 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -92,59 +92,28 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel): layout.operator("dpaint.type_toggle", text="Add Brush").type = 'BRUSH' else: layout.operator("dpaint.type_toggle", text="Remove Brush", icon='X').type = 'BRUSH' - - layout.prop(brush, "brush_settings_context", expand=True, icon_only=True) - - if (brush.brush_settings_context == "GENERAL"): - split = layout.split() - col = split.column() - col.prop(brush, "absolute_alpha") - col.prop(brush, "paint_erase") - col.prop(brush, "paint_wetness", text="Wetness") - - col = split.column() - sub = col.column() - sub.active = (brush.paint_source != "PSYS"); - sub.prop(brush, "use_material") - if brush.use_material and brush.paint_source != "PSYS": - col.prop(brush, "material", text="") - col.prop(brush, "paint_alpha", text="Alpha Factor") - else: - col.prop(brush, "paint_color", text="") - col.prop(brush, "paint_alpha", text="Alpha") - - elif (brush.brush_settings_context == "WAVE"): - layout.prop(brush, "wave_type") - if (brush.wave_type != "REFLECT"): - split = layout.split(percentage=0.5) - col = split.column() - col.prop(brush, "wave_factor") - col = split.column() - col.prop(brush, "wave_clamp") - elif (brush.brush_settings_context == "VELOCITY"): - col = layout.row().column() - col.label(text="Velocity Settings:") - split = layout.split() - col = split.column() - col.prop(brush, "velocity_alpha") - col.prop(brush, "velocity_color") - col = split.column() - col.prop(brush, "velocity_depth") - sub = layout.row().column() - sub.active = (brush.velocity_alpha or brush.velocity_color or brush.velocity_depth) - sub.prop(brush, "max_velocity") - sub.template_color_ramp(brush, "velocity_ramp", expand=True) - layout.separator() - layout.label(text="Smudge:") - layout.prop(brush, "do_smudge") - layout.prop(brush, "smudge_strength") + split = layout.split() + + col = split.column() + col.prop(brush, "absolute_alpha") + col.prop(brush, "paint_erase") + col.prop(brush, "paint_wetness", text="Wetness") + + col = split.column() + sub = col.column() + sub.active = (brush.paint_source != "PSYS"); + sub.prop(brush, "use_material") + if brush.use_material and brush.paint_source != "PSYS": + col.prop(brush, "material", text="") + col.prop(brush, "paint_alpha", text="Alpha Factor") else: - layout.label(text="-WIP-") + col.prop(brush, "paint_color", text="") + col.prop(brush, "paint_alpha", text="Alpha") class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): - bl_label = "Dynamic Paint: Advanced" + bl_label = "Dynamic Paint Advanced" @classmethod def poll(cls, context): @@ -208,7 +177,7 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): layout.prop(surface, "brush_group", text="") class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): - bl_label = "Dynamic Paint: Output" + bl_label = "Dynamic Paint Output" bl_options = {'DEFAULT_CLOSED'} @classmethod @@ -299,7 +268,7 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): layout.label(text=canvas.ui_info) class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, bpy.types.Panel): - bl_label = "Dynamic Paint: Initial Color" + bl_label = "Dynamic Paint Initial Color" bl_options = {'DEFAULT_CLOSED'} @classmethod @@ -332,7 +301,7 @@ class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, bpy.types.Panel): layout.prop_search(surface, "init_layername", ob.data, "vertex_colors", text="Color Layer: ") class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel): - bl_label = "Dynamic Paint: Effects" + bl_label = "Dynamic Paint Effects" bl_options = {'DEFAULT_CLOSED'} @classmethod @@ -383,7 +352,7 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel): class PHYSICS_PT_dp_cache(PhysicButtonsPanel, bpy.types.Panel): - bl_label = "Dynamic Paint: Cache" + bl_label = "Dynamic Paint Cache" bl_options = {'DEFAULT_CLOSED'} @classmethod @@ -401,9 +370,8 @@ class PHYSICS_PT_dp_cache(PhysicButtonsPanel, bpy.types.Panel): point_cache_ui(self, context, cache, (cache.is_baked is False), 'DYNAMIC_PAINT') -class PHYSICS_PT_dp_advanced_brush(PhysicButtonsPanel, bpy.types.Panel): - bl_label = "Dynamic Paint: Advanced" - bl_options = {'DEFAULT_CLOSED'} +class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, bpy.types.Panel): + bl_label = "Dynamic Paint Source" @classmethod def poll(cls, context): @@ -450,6 +418,61 @@ class PHYSICS_PT_dp_advanced_brush(PhysicButtonsPanel, bpy.types.Panel): col.separator() col.prop(brush, "prox_ramp_alpha", text="Only Use Alpha") col.template_color_ramp(brush, "paint_ramp", expand=True) + +class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, bpy.types.Panel): + bl_label = "Dynamic Paint Velocity" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + md = context.dynamic_paint + return md and (md.ui_type == "BRUSH") and (md.brush_settings) + + def draw(self, context): + layout = self.layout + + brush = context.dynamic_paint.brush_settings + ob = context.object + + col = layout.row().column() + col.label(text="Brush Velocity Settings:") + split = layout.split() + col = split.column() + col.prop(brush, "velocity_alpha") + col.prop(brush, "velocity_color") + col = split.column() + col.prop(brush, "velocity_depth") + sub = layout.row().column() + sub.active = (brush.velocity_alpha or brush.velocity_color or brush.velocity_depth) + sub.prop(brush, "max_velocity") + sub.template_color_ramp(brush, "velocity_ramp", expand=True) + layout.separator() + layout.label(text="Smudge:") + layout.prop(brush, "do_smudge") + layout.prop(brush, "smudge_strength") + +class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, bpy.types.Panel): + bl_label = "Dynamic Paint Wave" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + md = context.dynamic_paint + return md and (md.ui_type == "BRUSH") and (md.brush_settings) + + def draw(self, context): + layout = self.layout + + brush = context.dynamic_paint.brush_settings + ob = context.object + + layout.prop(brush, "wave_type") + if (brush.wave_type != "REFLECT"): + split = layout.split(percentage=0.5) + col = split.column() + col.prop(brush, "wave_factor") + col = split.column() + col.prop(brush, "wave_clamp") def register(): bpy.utils.register_module(__name__) -- cgit v1.2.3 From fae903e263fd11d788a4e55900ff25f4fc8b26db Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Fri, 28 Oct 2011 14:46:09 +0000 Subject: Dynamic Paint: * More code changes pointed by Brecht in codereview. * Some user interface improvements. * Updating brush settings now also updates canvas preview. --- .../bl_ui/properties_physics_dynamicpaint.py | 132 +++++++++++---------- 1 file changed, 71 insertions(+), 61 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 4a116707d0e..75b4719bf20 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -72,18 +72,18 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel): if surface.surface_format != "VERTEX": col.label(text="Quality:") col.prop(surface, "image_resolution") - col.prop(surface, "use_anti_aliasing") + col.prop(surface, "use_antialiasing") col = layout.column() col.label(text="Frames:") split = col.split() col = split.column(align=True) - col.prop(surface, "start_frame", text="Start") - col.prop(surface, "end_frame", text="End") + col.prop(surface, "frame_start", text="Start") + col.prop(surface, "frame_end", text="End") col = split.column() - col.prop(surface, "substeps") + col.prop(surface, "frame_substeps") elif (md.ui_type == "BRUSH"): brush = md.brush_settings @@ -102,9 +102,9 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel): col = split.column() sub = col.column() - sub.active = (brush.paint_source != "PSYS"); + sub.active = (brush.paint_source != "PARTICLE_SYSTEM"); sub.prop(brush, "use_material") - if brush.use_material and brush.paint_source != "PSYS": + if brush.use_material and brush.paint_source != "PARTICLE_SYSTEM": col.prop(brush, "material", text="") col.prop(brush, "paint_alpha", text="Alpha Factor") else: @@ -132,33 +132,42 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): # dissolve if (surface.surface_type == "PAINT"): - layout.label(text="Wetmap drying:") - split = layout.split(percentage=0.8) - split.prop(surface, "dry_speed", text="Dry Time") - split.prop(surface, "use_dry_log", text="Slow") + split = layout.split(percentage=0.35) + col = split.column() + col.label(text="Wetmap drying:") + col = split.column() + split = col.split(percentage=0.7) + col = split.column() + col.prop(surface, "dry_speed", text="Time") + col = split.column() + col.prop(surface, "use_dry_log", text="Slow") if (surface.surface_type != "WAVE"): + split = layout.split(percentage=0.35) + col = split.column() if (surface.surface_type == "DISPLACE"): - layout.prop(surface, "use_dissolve", text="Dissolve:") + col.prop(surface, "use_dissolve", text="Dissolve:") elif (surface.surface_type == "WEIGHT"): - layout.prop(surface, "use_dissolve", text="Fade:") + col.prop(surface, "use_dissolve", text="Fade:") else: - layout.prop(surface, "use_dissolve", text="Dissolve:") - sub = layout.column() - sub.active = surface.use_dissolve - split = sub.split(percentage=0.8) - split.prop(surface, "dissolve_speed", text="Time") - split.prop(surface, "use_dissolve_log", text="Slow") + col.prop(surface, "use_dissolve", text="Dissolve:") + col = split.column() + col.active = surface.use_dissolve + split = col.split(percentage=0.7) + col = split.column() + col.prop(surface, "dissolve_speed", text="Time") + col = split.column() + col.prop(surface, "use_dissolve_log", text="Slow") # per type settings if (surface.surface_type == "DISPLACE"): - layout.prop(surface, "incremental_disp") + layout.prop(surface, "use_incremental_displace") if (surface.surface_format == "VERTEX"): split = layout.split() col = split.column() col.prop(surface, "depth_clamp") col = split.column() - col.prop(surface, "disp_factor") + col.prop(surface, "displace_factor") if (surface.surface_type == "WAVE"): layout.prop(surface, "wave_open_borders") @@ -173,8 +182,8 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel): col.prop(surface, "wave_damping") col.prop(surface, "wave_spring") - layout.label(text="Brush Group:") - layout.prop(surface, "brush_group", text="") + layout.separator() + layout.prop(surface, "brush_group", text="Brush Group") class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Dynamic Paint Output" @@ -230,42 +239,42 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel): # image format outputs if (surface.surface_format == "IMAGE"): col = layout.column() - col.label(text="UV layer:") - col.prop_search(surface, "uv_layer", ob.data, "uv_textures", text="") + col.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT') + col.prop_search(surface, "uv_layer", ob.data, "uv_textures", text="UV layer:") + layout.separator() col.separator() col = layout.column() - col.prop(surface, "image_output_path", text="Output directory") - col.prop(surface, "image_fileformat", text="Image Format") + col.prop(surface, "image_output_path", text="") + split = layout.split() + col = split.column() + col.prop(surface, "image_fileformat", text="") + col = split.column() + col.prop(surface, "premultiply", text="Premultiply alpha") col.separator() + if (surface.surface_type == "PAINT"): - split = col.split() + split = layout.split(percentage=0.4) col = split.column() - col.prop(surface, "do_output1", text="Output Paintmaps:") + col.prop(surface, "do_output1", text="Paintmaps:") sub = split.column() - sub.prop(surface, "premultiply", text="Premultiply alpha") - sub.active = surface.do_output1 - sub = layout.column() sub.active = surface.do_output1 - sub.prop(surface, "output_name", text="Filename: ") + sub.prop(surface, "output_name", text="") - col = layout.column() - col.prop(surface, "do_output2", text="Output Wetmaps:") - sub = col.column() + split = layout.split(percentage=0.4) + col = split.column() + col.prop(surface, "do_output2", text="Wetmaps:") + sub = split.column() sub.active = surface.do_output2 - sub.prop(surface, "output_name2", text="Filename: ") + sub.prop(surface, "output_name2", text="") else: + col = layout.column() col.prop(surface, "output_name", text="Filename: ") if (surface.surface_type == "DISPLACE"): - col.prop(surface, "disp_type", text="Displace Type") + col.prop(surface, "displace_type", text="Displace Type") col.prop(surface, "depth_clamp") if (surface.surface_type == "WAVE"): col.prop(surface, "depth_clamp", text="Wave Clamp") - - layout.separator() - layout.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT') - if len(canvas.ui_info) != 0: - layout.label(text=canvas.ui_info) class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Dynamic Paint Initial Color" @@ -297,7 +306,7 @@ class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, bpy.types.Panel): layout.prop(surface, "init_texture") layout.prop_search(surface, "init_layername", ob.data, "uv_textures", text="UV Layer:") - if (surface.init_color_type == "VERTEXCOLOR"): + if (surface.init_color_type == "VERTEX_COLOR"): layout.prop_search(surface, "init_layername", ob.data, "vertex_colors", text="Color Layer: ") class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel): @@ -388,35 +397,35 @@ class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, bpy.types.Panel): col = split.column() col.prop(brush, "paint_source") - if brush.paint_source == "PSYS": - col.prop_search(brush, "psys", ob, "particle_systems", text="") - if brush.psys: + if brush.paint_source == "PARTICLE_SYSTEM": + col.prop_search(brush, "particle_system", ob, "particle_systems", text="") + if brush.particle_system: col.label(text="Particle effect:") sub = col.column() sub.active = not brush.use_part_radius sub.prop(brush, "solid_radius", text="Solid Radius") - col.prop(brush, "use_part_radius", text="Use Particle's Radius") + col.prop(brush, "use_particle_radius", text="Use Particle's Radius") col.prop(brush, "smooth_radius", text="Smooth radius") - if brush.paint_source in {'DISTANCE', 'VOLDIST', 'POINT'}: + if brush.paint_source in {'DISTANCE', 'VOLUME_DISTANCE', 'POINT'}: col.prop(brush, "paint_distance", text="Paint Distance") split = layout.row().split(percentage=0.4) sub = split.column() if brush.paint_source == 'DISTANCE': - sub.prop(brush, "prox_project") - if brush.paint_source == "VOLDIST": - sub.prop(brush, "prox_inverse") + sub.prop(brush, "proximity_project") + if brush.paint_source == "VOLUME_DISTANCE": + sub.prop(brush, "proximity_inverse") sub = split.column() if brush.paint_source == 'DISTANCE': column = sub.column() - column.active = brush.prox_project - column.prop(brush, "ray_dir") - sub.prop(brush, "prox_falloff") - if brush.prox_falloff == "RAMP": + column.active = brush.proximity_project + column.prop(brush, "ray_direction") + sub.prop(brush, "proximity_falloff") + if brush.proximity_falloff == "RAMP": col = layout.row().column() col.separator() - col.prop(brush, "prox_ramp_alpha", text="Only Use Alpha") + col.prop(brush, "proximity_ramp_alpha", text="Only Use Alpha") col.template_color_ramp(brush, "paint_ramp", expand=True) class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, bpy.types.Panel): @@ -434,8 +443,6 @@ class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, bpy.types.Panel): brush = context.dynamic_paint.brush_settings ob = context.object - col = layout.row().column() - col.label(text="Brush Velocity Settings:") split = layout.split() col = split.column() col.prop(brush, "velocity_alpha") @@ -447,9 +454,12 @@ class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, bpy.types.Panel): sub.prop(brush, "max_velocity") sub.template_color_ramp(brush, "velocity_ramp", expand=True) layout.separator() - layout.label(text="Smudge:") - layout.prop(brush, "do_smudge") - layout.prop(brush, "smudge_strength") + split = layout.split() + col = split.column() + col.prop(brush, "do_smudge") + col = split.column() + col.active = brush.do_smudge + col.prop(brush, "smudge_strength") class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Dynamic Paint Wave" -- cgit v1.2.3 From 0a37e6ab976344818483df899b4fc44aedb30613 Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Mon, 31 Oct 2011 13:01:06 +0000 Subject: Dynamic Paint: * Redesigned alpha blending and paint drying algorithms. Now it gives much better results when using low brush alpha or when surface has initial color set. * Fix: "Slow" dissolve/dry was scaled incorrect when using substeps. Also adjusted time to better match non-"slow" setting. * Fixed possible issues when using image textured brush. * Fix: particle brush panel was no longer visible since last commit. * Adjusted default surface values. * Some more code cleanup. --- release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 75b4719bf20..0263b0b52dd 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -402,7 +402,7 @@ class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, bpy.types.Panel): if brush.particle_system: col.label(text="Particle effect:") sub = col.column() - sub.active = not brush.use_part_radius + sub.active = not brush.use_particle_radius sub.prop(brush, "solid_radius", text="Solid Radius") col.prop(brush, "use_particle_radius", text="Use Particle's Radius") col.prop(brush, "smooth_radius", text="Smooth radius") @@ -462,7 +462,7 @@ class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, bpy.types.Panel): col.prop(brush, "smudge_strength") class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, bpy.types.Panel): - bl_label = "Dynamic Paint Wave" + bl_label = "Dynamic Paint Waves" bl_options = {'DEFAULT_CLOSED'} @classmethod -- cgit v1.2.3