[Bf-blender-cvs] [8b119a55244] master: Fix T76996: Don't allow baking when domain is not in object mode

Jacques Lucke noreply at git.blender.org
Fri Jun 26 13:32:10 CEST 2020


Commit: 8b119a55244560485bdcc5f4f5323ea79457a24c
Author: Jacques Lucke
Date:   Fri Jun 26 13:28:36 2020 +0200
Branches: master
https://developer.blender.org/rB8b119a55244560485bdcc5f4f5323ea79457a24c

Fix T76996: Don't allow baking when domain is not in object mode

This does not work, because the fluid modifier is not called when the
object is e.g. in edit mode. Another possible fix would be to switch
to object mode when baking starts automatically. However, I think it
is reasonable to simply not allow baking while the domain is in edit mode.

Reviewers: sebbas

Differential Revision: https://developer.blender.org/D7848

===================================================================

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 1727771637d..0bfa70b008b 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fluid.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py
@@ -210,7 +210,7 @@ class PHYSICS_PT_settings(PhysicButtonsPanel, Panel):
                     note.label(icon='INFO', text="Unbaked Guides: Bake Guides or disable them")
 
                 split = layout.split()
-                split.enabled = note_flag
+                split.enabled = note_flag and ob.mode == 'OBJECT'
 
                 bake_incomplete = (domain.cache_frame_pause_data < domain.cache_frame_end)
                 if domain.cache_resumable and domain.has_cache_baked_data and not domain.is_cache_baking_data and bake_incomplete:
@@ -705,6 +705,7 @@ class PHYSICS_PT_noise(PhysicButtonsPanel, Panel):
         layout = self.layout
         layout.use_property_split = True
 
+        ob = context.object
         domain = context.fluid.domain_settings
         layout.active = domain.use_noise
 
@@ -736,7 +737,7 @@ class PHYSICS_PT_noise(PhysicButtonsPanel, Panel):
                 note.label(icon='INFO', text="Unbaked Data: Bake Data first")
 
             split = layout.split()
-            split.enabled = domain.has_cache_baked_data and note_flag
+            split.enabled = domain.has_cache_baked_data and note_flag and ob.mode == 'OBJECT'
 
             bake_incomplete = (domain.cache_frame_pause_noise < domain.cache_frame_end)
             if domain.has_cache_baked_noise and not domain.is_cache_baking_noise and bake_incomplete:
@@ -777,6 +778,7 @@ class PHYSICS_PT_mesh(PhysicButtonsPanel, Panel):
         layout = self.layout
         layout.use_property_split = True
 
+        ob = context.object
         domain = context.fluid.domain_settings
         layout.active = domain.use_mesh
 
@@ -821,7 +823,7 @@ class PHYSICS_PT_mesh(PhysicButtonsPanel, Panel):
                 note.label(icon='INFO', text="Unbaked Data: Bake Data first")
 
             split = layout.split()
-            split.enabled = domain.has_cache_baked_data and note_flag
+            split.enabled = domain.has_cache_baked_data and note_flag and ob.mode == 'OBJECT'
 
             bake_incomplete = (domain.cache_frame_pause_mesh < domain.cache_frame_end)
             if domain.has_cache_baked_mesh and not domain.is_cache_baking_mesh and bake_incomplete:
@@ -855,6 +857,7 @@ class PHYSICS_PT_particles(PhysicButtonsPanel, Panel):
         layout = self.layout
         layout.use_property_split = True
 
+        ob = context.object
         domain = context.fluid.domain_settings
 
         is_baking_any = domain.is_cache_baking_any
@@ -936,6 +939,7 @@ class PHYSICS_PT_particles(PhysicButtonsPanel, Panel):
             split = layout.split()
             split.enabled = (
                 note_flag and
+                ob.mode == 'OBJECT' and
                 domain.has_cache_baked_data and
                 (domain.use_spray_particles or
                  domain.use_bubble_particles or
@@ -1114,6 +1118,7 @@ class PHYSICS_PT_cache(PhysicButtonsPanel, Panel):
     def draw(self, context):
         layout = self.layout
 
+        ob = context.object
         md = context.fluid
         domain = context.fluid.domain_settings
 
@@ -1160,6 +1165,7 @@ class PHYSICS_PT_cache(PhysicButtonsPanel, Panel):
 
             col.separator()
             split = layout.split()
+            split.enabled = ob.mode == 'OBJECT'
 
             bake_incomplete = (domain.cache_frame_pause_data < domain.cache_frame_end)
             if domain.cache_resumable and domain.has_cache_baked_data and not domain.is_cache_baking_data and bake_incomplete:



More information about the Bf-blender-cvs mailing list