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
This commit is contained in:
parent
da2e71be2f
commit
8b119a5524
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user