diff options
author | Miika Hamalainen <blender@miikah.org> | 2011-07-08 15:03:37 +0400 |
---|---|---|
committer | Miika Hamalainen <blender@miikah.org> | 2011-07-08 15:03:37 +0400 |
commit | f8f1cbd17f2b0c624d88ee7f7502e544472b4b6e (patch) | |
tree | 498fa319d91816109a7bd08f10ebfe7dc1c2c984 /release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py | |
parent | 901f24716b70e961a28fabc5820ced0983b025e0 (diff) |
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.
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py | 145 |
1 files changed, 82 insertions, 63 deletions
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": |