[Bf-blender-cvs] [55b465f976a] master: UI: Fluid: Use updated preset UI
Aaron Carlisle
noreply at git.blender.org
Wed Mar 4 23:43:25 CET 2020
Commit: 55b465f976a0535553f30fa830b2a1f7fa755469
Author: Aaron Carlisle
Date: Wed Mar 4 16:13:10 2020 -0500
Branches: master
https://developer.blender.org/rB55b465f976a0535553f30fa830b2a1f7fa755469
UI: Fluid: Use updated preset UI
Part of T73617
===================================================================
M release/scripts/startup/bl_ui/properties_physics_fluid.py
===================================================================
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)
More information about the Bf-blender-cvs
mailing list