[Bf-blender-cvs] [e49f6bb2088] blender2.8: UI: Smoke panels as sub-panels
Pablo Vazquez
noreply at git.blender.org
Tue Jun 19 16:01:37 CEST 2018
Commit: e49f6bb2088cfe8c80ff32f88b3aec1d217f6899
Author: Pablo Vazquez
Date: Tue Jun 19 16:01:29 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBe49f6bb2088cfe8c80ff32f88b3aec1d217f6899
UI: Smoke panels as sub-panels
Remove suffix from name since they are sub-panels now.
Display Settings -> Viewport Display, and two sub-panels as well for less used settings.
===================================================================
M release/scripts/startup/bl_ui/properties_physics_smoke.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py
index ddb898c7881..acbaecbda4c 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -135,7 +135,8 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel):
- bl_label = "Smoke Flow Advanced"
+ bl_label = "Advanced"
+ bl_parent_id = 'PHYSICS_PT_smoke'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@@ -170,7 +171,8 @@ class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel):
class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel):
- bl_label = "Smoke Flames"
+ bl_label = "Flames"
+ bl_parent_id = 'PHYSICS_PT_smoke'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@@ -200,7 +202,8 @@ class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel):
class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
- bl_label = "Smoke Adaptive Domain"
+ bl_label = "Adaptive Domain"
+ bl_parent_id = 'PHYSICS_PT_smoke'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@@ -234,7 +237,8 @@ class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
- bl_label = "Smoke High Resolution"
+ bl_label = "High Resolution"
+ bl_parent_id = 'PHYSICS_PT_smoke'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@@ -273,7 +277,8 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
- bl_label = "Smoke Groups"
+ bl_label = "Groups"
+ bl_parent_id = 'PHYSICS_PT_smoke'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@@ -301,7 +306,8 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
- bl_label = "Smoke Cache"
+ bl_label = "Cache"
+ bl_parent_id = 'PHYSICS_PT_smoke'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@@ -337,7 +343,8 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, Panel):
- bl_label = "Smoke Field Weights"
+ bl_label = "Field Weights"
+ bl_parent_id = 'PHYSICS_PT_smoke'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@@ -351,8 +358,9 @@ class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, Panel):
effector_weights_ui(self, context, domain.effector_weights, 'SMOKE')
-class PHYSICS_PT_smoke_display_settings(PhysicButtonsPanel, Panel):
- bl_label = "Smoke Display Settings"
+class PHYSICS_PT_smoke_viewport_display(PhysicButtonsPanel, Panel):
+ bl_label = "Viewport Display"
+ bl_parent_id = 'PHYSICS_PT_smoke'
bl_options = {'DEFAULT_CLOSED'}
@classmethod
@@ -389,23 +397,53 @@ class PHYSICS_PT_smoke_display_settings(PhysicButtonsPanel, Panel):
row.enabled = do_full_slicing or not do_axis_slicing
row.prop(domain, "slice_per_voxel")
- layout.separator()
- layout.label(text="Debug:")
- layout.prop(domain, "draw_velocity")
- col = layout.column()
- col.enabled = domain.draw_velocity
- col.prop(domain, "vector_draw_type")
- col.prop(domain, "vector_scale")
- layout.separator()
- layout.label(text="Color Mapping:")
- layout.prop(domain, "use_color_ramp")
+class PHYSICS_PT_smoke_viewport_display_color(PhysicButtonsPanel, Panel):
+ bl_label = "Color Mapping"
+ bl_parent_id = 'PHYSICS_PT_smoke_viewport_display'
+ bl_options = {'DEFAULT_CLOSED'}
+
+ @classmethod
+ def poll(cls, context):
+ md = context.smoke
+ return md and (md.smoke_type == 'DOMAIN')
+
+ def draw_header(self, context):
+ md = context.smoke.domain_settings
+
+ self.layout.prop(md, "use_color_ramp", text="")
+
+ def draw(self, context):
+ domain = context.smoke.domain_settings
+ layout = self.layout
+
col = layout.column()
col.enabled = domain.use_color_ramp
col.prop(domain, "coba_field")
col.template_color_ramp(domain, "color_ramp", expand=True)
+class PHYSICS_PT_smoke_viewport_display_debug(PhysicButtonsPanel, Panel):
+ bl_label = "Debug"
+ bl_parent_id = 'PHYSICS_PT_smoke_viewport_display'
+ bl_options = {'DEFAULT_CLOSED'}
+
+ @classmethod
+ def poll(cls, context):
+ md = context.smoke
+ return md and (md.smoke_type == 'DOMAIN')
+
+ def draw(self, context):
+ domain = context.smoke.domain_settings
+ layout = self.layout
+
+ layout.prop(domain, "draw_velocity")
+ col = layout.column()
+ col.enabled = domain.draw_velocity
+ col.prop(domain, "vector_draw_type")
+ col.prop(domain, "vector_scale")
+
+
classes = (
PHYSICS_PT_smoke,
PHYSICS_PT_smoke_flow_advanced,
@@ -415,7 +453,9 @@ classes = (
PHYSICS_PT_smoke_groups,
PHYSICS_PT_smoke_cache,
PHYSICS_PT_smoke_field_weights,
- PHYSICS_PT_smoke_display_settings,
+ PHYSICS_PT_smoke_viewport_display,
+ PHYSICS_PT_smoke_viewport_display_color,
+ PHYSICS_PT_smoke_viewport_display_debug,
)
if __name__ == "__main__": # only for live edit.
More information about the Bf-blender-cvs
mailing list