Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_physics_fluid.py
| Show First 20 Lines • Show All 204 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| note_flag = True | note_flag = True | ||||
| if self.check_domain_has_unbaked_guide(domain) and domain.cache_type == 'MODULAR': | if self.check_domain_has_unbaked_guide(domain) and domain.cache_type == 'MODULAR': | ||||
| note = layout.split() | note = layout.split() | ||||
| note_flag = False | note_flag = False | ||||
| note.enabled = note_flag | note.enabled = note_flag | ||||
| note.label(icon='INFO', text="Unbaked Guides: Bake Guides or disable them") | note.label(icon='INFO', text="Unbaked Guides: Bake Guides or disable them") | ||||
| split = layout.split() | 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) | 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: | if domain.cache_resumable and domain.has_cache_baked_data and not domain.is_cache_baking_data and bake_incomplete: | ||||
| col = split.column() | col = split.column() | ||||
| col.operator("fluid.bake_data", text="Resume") | col.operator("fluid.bake_data", text="Resume") | ||||
| col = split.column() | col = split.column() | ||||
| col.operator("fluid.free_data", text="Free") | col.operator("fluid.free_data", text="Free") | ||||
| elif domain.is_cache_baking_data and not domain.has_cache_baked_data: | elif domain.is_cache_baking_data and not domain.has_cache_baked_data: | ||||
| ▲ Show 20 Lines • Show All 478 Lines • ▼ Show 20 Lines | def draw_header(self, context): | ||||
| is_baking_any = domain.is_cache_baking_any | is_baking_any = domain.is_cache_baking_any | ||||
| self.layout.enabled = not is_baking_any | self.layout.enabled = not is_baking_any | ||||
| self.layout.prop(md, "use_noise", text="") | self.layout.prop(md, "use_noise", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| ob = context.object | |||||
| domain = context.fluid.domain_settings | domain = context.fluid.domain_settings | ||||
| layout.active = domain.use_noise | layout.active = domain.use_noise | ||||
| is_baking_any = domain.is_cache_baking_any | is_baking_any = domain.is_cache_baking_any | ||||
| has_baked_noise = domain.has_cache_baked_noise | has_baked_noise = domain.has_cache_baked_noise | ||||
| flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) | 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_noise | flow.enabled = not is_baking_any and not has_baked_noise | ||||
| Show All 15 Lines | def draw(self, context): | ||||
| note_flag = True | note_flag = True | ||||
| if domain.use_noise and not domain.has_cache_baked_data and domain.cache_type == 'MODULAR': | if domain.use_noise and not domain.has_cache_baked_data and domain.cache_type == 'MODULAR': | ||||
| note = layout.split() | note = layout.split() | ||||
| note_flag = False | note_flag = False | ||||
| note.enabled = note_flag | note.enabled = note_flag | ||||
| note.label(icon='INFO', text="Unbaked Data: Bake Data first") | note.label(icon='INFO', text="Unbaked Data: Bake Data first") | ||||
| split = layout.split() | 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) | 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: | if domain.has_cache_baked_noise and not domain.is_cache_baking_noise and bake_incomplete: | ||||
| col = split.column() | col = split.column() | ||||
| col.operator("fluid.bake_noise", text="Resume") | col.operator("fluid.bake_noise", text="Resume") | ||||
| col = split.column() | col = split.column() | ||||
| col.operator("fluid.free_noise", text="Free") | col.operator("fluid.free_noise", text="Free") | ||||
| elif not domain.has_cache_baked_noise and domain.is_cache_baking_noise: | elif not domain.has_cache_baked_noise and domain.is_cache_baking_noise: | ||||
| Show All 24 Lines | def draw_header(self, context): | ||||
| is_baking_any = domain.is_cache_baking_any | is_baking_any = domain.is_cache_baking_any | ||||
| self.layout.enabled = not is_baking_any | self.layout.enabled = not is_baking_any | ||||
| self.layout.prop(md, "use_mesh", text="") | self.layout.prop(md, "use_mesh", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| ob = context.object | |||||
| domain = context.fluid.domain_settings | domain = context.fluid.domain_settings | ||||
| layout.active = domain.use_mesh | layout.active = domain.use_mesh | ||||
| is_baking_any = domain.is_cache_baking_any | is_baking_any = domain.is_cache_baking_any | ||||
| has_baked_mesh = domain.has_cache_baked_mesh | has_baked_mesh = domain.has_cache_baked_mesh | ||||
| flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) | 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_mesh | flow.enabled = not is_baking_any and not has_baked_mesh | ||||
| Show All 28 Lines | def draw(self, context): | ||||
| note_flag = True | note_flag = True | ||||
| if domain.use_mesh and not domain.has_cache_baked_data and domain.cache_type == 'MODULAR': | if domain.use_mesh and not domain.has_cache_baked_data and domain.cache_type == 'MODULAR': | ||||
| note = layout.split() | note = layout.split() | ||||
| note_flag = False | note_flag = False | ||||
| note.enabled = note_flag | note.enabled = note_flag | ||||
| note.label(icon='INFO', text="Unbaked Data: Bake Data first") | note.label(icon='INFO', text="Unbaked Data: Bake Data first") | ||||
| split = layout.split() | 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) | 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: | if domain.has_cache_baked_mesh and not domain.is_cache_baking_mesh and bake_incomplete: | ||||
| col = split.column() | col = split.column() | ||||
| col.operator("fluid.bake_mesh", text="Resume") | col.operator("fluid.bake_mesh", text="Resume") | ||||
| col = split.column() | col = split.column() | ||||
| col.operator("fluid.free_mesh", text="Free") | col.operator("fluid.free_mesh", text="Free") | ||||
| elif not domain.has_cache_baked_mesh and domain.is_cache_baking_mesh: | elif not domain.has_cache_baked_mesh and domain.is_cache_baking_mesh: | ||||
| Show All 17 Lines | def poll(cls, context): | ||||
| return False | return False | ||||
| return (context.engine in cls.COMPAT_ENGINES) | return (context.engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| ob = context.object | |||||
| domain = context.fluid.domain_settings | domain = context.fluid.domain_settings | ||||
| is_baking_any = domain.is_cache_baking_any | is_baking_any = domain.is_cache_baking_any | ||||
| has_baked_particles = domain.has_cache_baked_particles | has_baked_particles = domain.has_cache_baked_particles | ||||
| using_particles = domain.use_spray_particles or domain.use_foam_particles or domain.use_bubble_particles | using_particles = domain.use_spray_particles or domain.use_foam_particles or domain.use_bubble_particles | ||||
| flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) | flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) | ||||
| flow.enabled = not is_baking_any | flow.enabled = not is_baking_any | ||||
| ▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| note = layout.split() | note = layout.split() | ||||
| note_flag = False | note_flag = False | ||||
| note.enabled = note_flag | note.enabled = note_flag | ||||
| note.label(icon='INFO', text="Unbaked Data: Bake Data first") | note.label(icon='INFO', text="Unbaked Data: Bake Data first") | ||||
| split = layout.split() | split = layout.split() | ||||
| split.enabled = ( | split.enabled = ( | ||||
| note_flag and | note_flag and | ||||
| ob.mode == 'OBJECT' and | |||||
| domain.has_cache_baked_data and | domain.has_cache_baked_data and | ||||
| (domain.use_spray_particles or | (domain.use_spray_particles or | ||||
| domain.use_bubble_particles or | domain.use_bubble_particles or | ||||
| domain.use_foam_particles or | domain.use_foam_particles or | ||||
| domain.use_tracer_particles) | domain.use_tracer_particles) | ||||
| ) | ) | ||||
| bake_incomplete = (domain.cache_frame_pause_particles < domain.cache_frame_end) | bake_incomplete = (domain.cache_frame_pause_particles < domain.cache_frame_end) | ||||
| ▲ Show 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | def poll(cls, context): | ||||
| if not PhysicButtonsPanel.poll_fluid_domain(context): | if not PhysicButtonsPanel.poll_fluid_domain(context): | ||||
| return False | return False | ||||
| return (context.engine in cls.COMPAT_ENGINES) | return (context.engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ob = context.object | |||||
| md = context.fluid | md = context.fluid | ||||
| domain = context.fluid.domain_settings | domain = context.fluid.domain_settings | ||||
| is_baking_any = domain.is_cache_baking_any | is_baking_any = domain.is_cache_baking_any | ||||
| has_baked_data = domain.has_cache_baked_data | has_baked_data = domain.has_cache_baked_data | ||||
| has_baked_mesh = domain.has_cache_baked_mesh | has_baked_mesh = domain.has_cache_baked_mesh | ||||
| col = layout.column() | col = layout.column() | ||||
| Show All 30 Lines | def draw(self, context): | ||||
| row = col.row() | row = col.row() | ||||
| row.enabled = not is_baking_any and not has_baked_mesh | row.enabled = not is_baking_any and not has_baked_mesh | ||||
| row.prop(domain, "cache_mesh_format", text="Meshes") | row.prop(domain, "cache_mesh_format", text="Meshes") | ||||
| if domain.cache_type == 'ALL': | if domain.cache_type == 'ALL': | ||||
| col.separator() | col.separator() | ||||
| split = layout.split() | split = layout.split() | ||||
| split.enabled = ob.mode == 'OBJECT' | |||||
| bake_incomplete = (domain.cache_frame_pause_data < domain.cache_frame_end) | 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: | if domain.cache_resumable and domain.has_cache_baked_data and not domain.is_cache_baking_data and bake_incomplete: | ||||
| col = split.column() | col = split.column() | ||||
| col.operator("fluid.bake_all", text="Resume") | col.operator("fluid.bake_all", text="Resume") | ||||
| col = split.column() | col = split.column() | ||||
| col.operator("fluid.free_all", text="Free") | col.operator("fluid.free_all", text="Free") | ||||
| elif domain.is_cache_baking_data and not domain.has_cache_baked_data: | elif domain.is_cache_baking_data and not domain.has_cache_baked_data: | ||||
| ▲ Show 20 Lines • Show All 198 Lines • Show Last 20 Lines | |||||