Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
| Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
| class PhysicButtonsPanel: | class PhysicButtonsPanel: | ||||
| bl_space_type = 'PROPERTIES' | bl_space_type = 'PROPERTIES' | ||||
| bl_region_type = 'WINDOW' | bl_region_type = 'WINDOW' | ||||
| bl_context = "physics" | bl_context = "physics" | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| ob = context.object | ob = context.object | ||||
| rd = context.scene.render | view_render = context.scene.view_render | ||||
| return (ob and ob.type == 'MESH') and rd.engine in cls.COMPAT_ENGINES and context.dynamic_paint | return (ob and ob.type == 'MESH') and view_render.engine in cls.COMPAT_ENGINES and context.dynamic_paint | ||||
| class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel): | class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Dynamic Paint" | bl_label = "Dynamic Paint" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 36 Lines | def draw(self, context): | ||||
| col = split.column(align=True) | col = split.column(align=True) | ||||
| col.prop(surface, "frame_start", text="Start") | col.prop(surface, "frame_start", text="Start") | ||||
| col.prop(surface, "frame_end", text="End") | col.prop(surface, "frame_end", text="End") | ||||
| split.prop(surface, "frame_substeps") | split.prop(surface, "frame_substeps") | ||||
| elif md.ui_type == 'BRUSH': | elif md.ui_type == 'BRUSH': | ||||
| brush = md.brush_settings | brush = md.brush_settings | ||||
| use_shading_nodes = context.scene.render.use_shading_nodes | use_shading_nodes = context.view_render.use_shading_nodes | ||||
| if brush is None: | if brush is None: | ||||
| layout.operator("dpaint.type_toggle", text="Add Brush").type = 'BRUSH' | layout.operator("dpaint.type_toggle", text="Add Brush").type = 'BRUSH' | ||||
| else: | else: | ||||
| layout.operator("dpaint.type_toggle", text="Remove Brush", icon='X').type = 'BRUSH' | layout.operator("dpaint.type_toggle", text="Remove Brush", icon='X').type = 'BRUSH' | ||||
| split = layout.split() | split = layout.split() | ||||
| Show All 17 Lines | |||||
| class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel): | class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Dynamic Paint Advanced" | bl_label = "Dynamic Paint Advanced" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| md = context.dynamic_paint | md = context.dynamic_paint | ||||
| rd = context.scene.render | view_render = context.scene.view_render | ||||
| return md and md.ui_type == 'CANVAS' and md.canvas_settings and md.canvas_settings.canvas_surfaces.active and rd.engine in cls.COMPAT_ENGINES | return md and md.ui_type == 'CANVAS' and md.canvas_settings and md.canvas_settings.canvas_surfaces.active and view_render.engine in cls.COMPAT_ENGINES | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| canvas = context.dynamic_paint.canvas_settings | canvas = context.dynamic_paint.canvas_settings | ||||
| surface = canvas.canvas_surfaces.active | surface = canvas.canvas_surfaces.active | ||||
| surface_type = surface.surface_type | surface_type = surface.surface_type | ||||
| ▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | |||||
| class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel): | class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Dynamic Paint Output" | bl_label = "Dynamic Paint Output" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| md = context.dynamic_paint | md = context.dynamic_paint | ||||
| rd = context.scene.render | view_render = context.scene.view_render | ||||
| if not (md and md.ui_type == 'CANVAS' and md.canvas_settings): | if not (md and md.ui_type == 'CANVAS' and md.canvas_settings): | ||||
| return 0 | return 0 | ||||
| surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active | surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active | ||||
| return (surface and | return (surface and | ||||
| (not (surface.surface_format == 'VERTEX' and (surface.surface_type in {'DISPLACE', 'WAVE'}))) and | (not (surface.surface_format == 'VERTEX' and (surface.surface_type in {'DISPLACE', 'WAVE'}))) and | ||||
| (rd.engine in cls.COMPAT_ENGINES)) | (view_render.engine in cls.COMPAT_ENGINES)) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| canvas = context.dynamic_paint.canvas_settings | canvas = context.dynamic_paint.canvas_settings | ||||
| surface = canvas.canvas_surfaces.active | surface = canvas.canvas_surfaces.active | ||||
| ob = context.object | ob = context.object | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
| class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel): | class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Dynamic Paint Initial Color" | bl_label = "Dynamic Paint Initial Color" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| md = context.dynamic_paint | md = context.dynamic_paint | ||||
| rd = context.scene.render | view_render = context.scene.view_render | ||||
| if not (md and md.ui_type == 'CANVAS' and md.canvas_settings): | if not (md and md.ui_type == 'CANVAS' and md.canvas_settings): | ||||
| return 0 | return 0 | ||||
| surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active | surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active | ||||
| return (surface and surface.surface_type == 'PAINT') and (rd.engine in cls.COMPAT_ENGINES) | return (surface and surface.surface_type == 'PAINT') and (view_render.engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| canvas = context.dynamic_paint.canvas_settings | canvas = context.dynamic_paint.canvas_settings | ||||
| surface = canvas.canvas_surfaces.active | surface = canvas.canvas_surfaces.active | ||||
| ob = context.object | ob = context.object | ||||
| Show All 16 Lines | |||||
| class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel): | class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Dynamic Paint Effects" | bl_label = "Dynamic Paint Effects" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| md = context.dynamic_paint | md = context.dynamic_paint | ||||
| rd = context.scene.render | view_render = context.scene.view_render | ||||
| if not (md and md.ui_type == 'CANVAS' and md.canvas_settings): | if not (md and md.ui_type == 'CANVAS' and md.canvas_settings): | ||||
| return False | return False | ||||
| surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active | surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active | ||||
| return (surface and surface.surface_type == 'PAINT') and (rd.engine in cls.COMPAT_ENGINES) | return (surface and surface.surface_type == 'PAINT') and (view_render.engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| canvas = context.dynamic_paint.canvas_settings | canvas = context.dynamic_paint.canvas_settings | ||||
| surface = canvas.canvas_surfaces.active | surface = canvas.canvas_surfaces.active | ||||
| layout.row().prop(surface, "effect_ui", expand=True) | layout.row().prop(surface, "effect_ui", expand=True) | ||||
| Show All 29 Lines | |||||
| class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel): | class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Dynamic Paint Cache" | bl_label = "Dynamic Paint Cache" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| md = context.dynamic_paint | md = context.dynamic_paint | ||||
| rd = context.scene.render | view_render = context.scene.view_render | ||||
| return (md and | return (md and | ||||
| md.ui_type == 'CANVAS' and | md.ui_type == 'CANVAS' and | ||||
| md.canvas_settings and | md.canvas_settings and | ||||
| md.canvas_settings.canvas_surfaces.active and | md.canvas_settings.canvas_surfaces.active and | ||||
| md.canvas_settings.canvas_surfaces.active.is_cache_user and | md.canvas_settings.canvas_surfaces.active.is_cache_user and | ||||
| (rd.engine in cls.COMPAT_ENGINES)) | (view_render.engine in cls.COMPAT_ENGINES)) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active | surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active | ||||
| cache = surface.point_cache | cache = surface.point_cache | ||||
| point_cache_ui(self, context, cache, (cache.is_baked is False), 'DYNAMIC_PAINT') | point_cache_ui(self, context, cache, (cache.is_baked is False), 'DYNAMIC_PAINT') | ||||
| class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, Panel): | class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Dynamic Paint Source" | bl_label = "Dynamic Paint Source" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| md = context.dynamic_paint | md = context.dynamic_paint | ||||
| rd = context.scene.render | view_render = context.scene.view_render | ||||
| return md and md.ui_type == 'BRUSH' and md.brush_settings and (rd.engine in cls.COMPAT_ENGINES) | return md and md.ui_type == 'BRUSH' and md.brush_settings and (view_render.engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| brush = context.dynamic_paint.brush_settings | brush = context.dynamic_paint.brush_settings | ||||
| ob = context.object | ob = context.object | ||||
| split = layout.split() | split = layout.split() | ||||
| Show All 36 Lines | |||||
| class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, Panel): | class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Dynamic Paint Velocity" | bl_label = "Dynamic Paint Velocity" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| md = context.dynamic_paint | md = context.dynamic_paint | ||||
| rd = context.scene.render | view_render = context.scene.view_render | ||||
| return md and md.ui_type == 'BRUSH' and md.brush_settings and (rd.engine in cls.COMPAT_ENGINES) | return md and md.ui_type == 'BRUSH' and md.brush_settings and (view_render.engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| brush = context.dynamic_paint.brush_settings | brush = context.dynamic_paint.brush_settings | ||||
| split = layout.split() | split = layout.split() | ||||
| Show All 19 Lines | |||||
| class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, Panel): | class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Dynamic Paint Waves" | bl_label = "Dynamic Paint Waves" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| md = context.dynamic_paint | md = context.dynamic_paint | ||||
| rd = context.scene.render | view_render = context.scene.view_render | ||||
| return md and md.ui_type == 'BRUSH' and md.brush_settings and (rd.engine in cls.COMPAT_ENGINES) | return md and md.ui_type == 'BRUSH' and md.brush_settings and (view_render.engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| brush = context.dynamic_paint.brush_settings | brush = context.dynamic_paint.brush_settings | ||||
| layout.prop(brush, "wave_type") | layout.prop(brush, "wave_type") | ||||
| if brush.wave_type != 'REFLECT': | if brush.wave_type != 'REFLECT': | ||||
| Show All 22 Lines | |||||