diff options
author | Aaron Carlisle <carlisle.b3d@gmail.com> | 2020-03-05 00:13:10 +0300 |
---|---|---|
committer | Aaron Carlisle <carlisle.b3d@gmail.com> | 2020-03-05 01:41:41 +0300 |
commit | 55b465f976a0535553f30fa830b2a1f7fa755469 (patch) | |
tree | 677939212d7a360a87757a0cdc89b697e8ef22e9 /release/scripts/startup/bl_ui/properties_physics_fluid.py | |
parent | 1d18a2a5ec2b782c3496c05843350f114871865a (diff) |
UI: Fluid: Use updated preset UI
Part of T73617
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_physics_fluid.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_physics_fluid.py | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py index 04297fc725b..98faabeb728 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py @@ -19,20 +19,18 @@ # <pep8 compliant> import bpy -from bpy.types import ( - Panel, - Menu, -) +from bpy.types import Menu, Panel +from bl_ui.utils import PresetPanel from .properties_physics_common import ( effector_weights_ui, ) -class FLUID_MT_presets(Menu): +class FLUID_MT_presets(PresetPanel, Panel): bl_label = "Fluid Presets" preset_subdir = "fluid" preset_operator = "script.execute_preset" - draw = Menu.draw_preset + preset_add_operator = "fluid.preset_add" class PhysicButtonsPanel: @@ -962,6 +960,9 @@ class PHYSICS_PT_diffusion(PhysicButtonsPanel, Panel): return (context.engine in cls.COMPAT_ENGINES) + def draw_header_preset(self, _context): + FLUID_MT_presets.draw_panel_header(self.layout) + def draw(self, context): layout = self.layout layout.use_property_split = True @@ -975,16 +976,6 @@ class PHYSICS_PT_diffusion(PhysicButtonsPanel, Panel): flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) flow.enabled = not is_baking_any and not has_baked_any and not has_baked_data - row = flow.row() - - col = row.column() - col.label(text="Viscosity Presets:") - col.menu("FLUID_MT_presets", text=bpy.types.FLUID_MT_presets.bl_label) - - col = row.column(align=True) - col.operator("fluid.preset_add", text="", icon='ADD') - col.operator("fluid.preset_add", text="", icon='REMOVE').remove_active = True - col = flow.column(align=True) col.prop(domain, "viscosity_base", text="Base") col.prop(domain, "viscosity_exponent", text="Exponent", slider=True) |