Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastián Barschkis <sebbas@sebbas.org>2020-09-14 19:58:37 +0300
committerSebastián Barschkis <sebbas@sebbas.org>2020-09-14 19:58:37 +0300
commit59a9cf46b485a00e42fcf93851ff3ed0ba6fe24d (patch)
tree16883b526d7b320b1e80e1e38bea735571d56e49 /release/scripts/startup
parent177759d8182f64c9aa3680e70b7ef0e27c4c387f (diff)
Fluid: Cleanup bake info string for modular cache
This commit adds a label on top of the bake operator in modular bake mode. This way users will immediately see if their current settings will allow them to bake noise, meshes or particles after baking the simulation base.
Diffstat (limited to 'release/scripts/startup')
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_fluid.py51
1 files changed, 35 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 427f8c2c85f..f959d10a809 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fluid.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py
@@ -200,14 +200,28 @@ class PHYSICS_PT_settings(PhysicButtonsPanel, Panel):
if domain.cache_type == 'MODULAR':
col.separator()
+ label = ""
# Deactivate bake operator if guides are enabled but not baked yet.
note_flag = True
- if self.check_domain_has_unbaked_guide(domain) and domain.cache_type == 'MODULAR':
- note = layout.split()
+ if self.check_domain_has_unbaked_guide(domain):
note_flag = False
+ label = "Unbaked Guides: Bake Guides or disable them"
+ elif not domain.cache_resumable and not label:
+ label = "Non Resumable Cache: Baking "
+ if PhysicButtonsPanel.poll_liquid_domain(context):
+ label += "mesh or particles will not be possible"
+ elif PhysicButtonsPanel.poll_gas_domain(context):
+ label += "noise will not be possible"
+ else:
+ label = ""
+
+ if label:
+ info = layout.split()
+ note = info.row()
note.enabled = note_flag
- note.label(icon='INFO', text="Unbaked Guides: Bake Guides or disable them")
+ note.alignment = 'RIGHT'
+ note.label(icon='INFO', text=label)
split = layout.split()
split.enabled = note_flag and ob.mode == 'OBJECT'
@@ -731,17 +745,19 @@ class PHYSICS_PT_noise(PhysicButtonsPanel, Panel):
# Deactivate bake operator if data has not been baked yet.
note_flag = True
- if domain.use_noise and domain.cache_type == 'MODULAR':
+ if domain.use_noise:
label = ""
- if not domain.has_cache_baked_data:
- label = "Unbaked Data: Bake Data first"
if not domain.cache_resumable:
label = "Non Resumable Cache: Enable resumable option first"
+ elif not domain.has_cache_baked_data:
+ label = "Unbaked Data: Bake Data first"
if label:
- note = layout.split()
+ info = layout.split()
+ note = info.row()
note_flag = False
note.enabled = note_flag
+ note.alignment = 'RIGHT'
note.label(icon='INFO', text=label)
split = layout.split()
@@ -824,17 +840,19 @@ class PHYSICS_PT_mesh(PhysicButtonsPanel, Panel):
# Deactivate bake operator if data has not been baked yet.
note_flag = True
- if domain.use_mesh and domain.cache_type == 'MODULAR':
+ if domain.use_mesh:
label = ""
- if not domain.has_cache_baked_data:
- label = "Unbaked Data: Bake Data first"
if not domain.cache_resumable:
label = "Non Resumable Cache: Enable resumable option first"
+ elif not domain.has_cache_baked_data:
+ label = "Unbaked Data: Bake Data first"
if label:
- note = layout.split()
+ info = layout.split()
+ note = info.row()
note_flag = False
note.enabled = note_flag
+ note.alignment = 'RIGHT'
note.label(icon='INFO', text=label)
split = layout.split()
@@ -945,17 +963,19 @@ class PHYSICS_PT_particles(PhysicButtonsPanel, Panel):
# Deactivate bake operator if data has not been baked yet.
note_flag = True
- if using_particles and domain.cache_type == 'MODULAR':
+ if using_particles:
label = ""
- if not domain.has_cache_baked_data:
- label = "Unbaked Data: Bake Data first"
if not domain.cache_resumable:
label = "Non Resumable Cache: Enable resumable option first"
+ elif not domain.has_cache_baked_data:
+ label = "Unbaked Data: Bake Data first"
if label:
- note = layout.split()
+ info = layout.split()
+ note = info.row()
note_flag = False
note.enabled = note_flag
+ note.alignment = 'RIGHT'
note.label(icon='INFO', text=label)
split = layout.split()
@@ -1184,7 +1204,6 @@ class PHYSICS_PT_cache(PhysicButtonsPanel, Panel):
row.prop(domain, "cache_mesh_format", text="Meshes")
if domain.cache_type == 'ALL':
-
col.separator()
split = layout.split()
split.enabled = ob.mode == 'OBJECT'