| 
									
										
										
										
											2009-11-01 15:21:20 +00:00
										 |  |  | # ##### BEGIN GPL LICENSE BLOCK ##### | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | #  This program is free software; you can redistribute it and/or | 
					
						
							|  |  |  | #  modify it under the terms of the GNU General Public License | 
					
						
							|  |  |  | #  as published by the Free Software Foundation; either version 2 | 
					
						
							|  |  |  | #  of the License, or (at your option) any later version. | 
					
						
							| 
									
										
										
										
											2009-11-03 07:23:02 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2009-11-01 15:21:20 +00:00
										 |  |  | #  This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  | #  but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  | #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  | #  GNU General Public License for more details. | 
					
						
							| 
									
										
										
										
											2009-11-03 07:23:02 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2009-11-01 15:21:20 +00:00
										 |  |  | #  You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  | #  along with this program; if not, write to the Free Software Foundation, | 
					
						
							| 
									
										
										
										
											2010-02-12 13:34:04 +00:00
										 |  |  | #  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 
					
						
							| 
									
										
										
										
											2009-11-01 15:21:20 +00:00
										 |  |  | # | 
					
						
							|  |  |  | # ##### END GPL LICENSE BLOCK ##### | 
					
						
							| 
									
										
										
										
											2009-10-31 20:16:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | # <pep8 compliant> | 
					
						
							| 
									
										
										
										
											2009-07-02 19:41:31 +00:00
										 |  |  | import bpy | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  | class PhysicButtonsPanel(): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_space_type = 'PROPERTIES' | 
					
						
							|  |  |  |     bl_region_type = 'WINDOW' | 
					
						
							|  |  |  |     bl_context = "physics" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-09 01:37:09 +00:00
										 |  |  |     @classmethod | 
					
						
							|  |  |  |     def poll(cls, context): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         ob = context.object | 
					
						
							| 
									
										
										
										
											2010-02-23 12:48:35 +00:00
										 |  |  |         rd = context.scene.render | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         return (ob and ob.type == 'MESH') and (not rd.use_game_engine) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  | class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Fluid" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         md = context.fluid | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-16 10:21:00 +00:00
										 |  |  |         split = layout.split() | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         if md: | 
					
						
							|  |  |  |             # remove modifier + settings | 
					
						
							|  |  |  |             split.set_context_pointer("modifier", md) | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             split.operator("object.modifier_remove", text="Remove") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |             row = split.row(align=True) | 
					
						
							| 
									
										
										
										
											2010-08-19 12:51:31 +00:00
										 |  |  |             row.prop(md, "show_render", text="") | 
					
						
							| 
									
										
										
										
											2010-08-17 17:03:52 +00:00
										 |  |  |             row.prop(md, "show_viewport", text="") | 
					
						
							| 
									
										
										
										
											2010-04-04 14:52:15 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |             fluid = md.settings | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             # add modifier | 
					
						
							| 
									
										
										
										
											2009-11-23 11:43:38 +00:00
										 |  |  |             split.operator("object.modifier_add", text="Add").type = 'FLUID_SIMULATION' | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |             split.label() | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |             fluid = None | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if fluid: | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |             row = layout.row() | 
					
						
							|  |  |  |             row.prop(fluid, "type") | 
					
						
							|  |  |  |             if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'): | 
					
						
							| 
									
										
										
										
											2010-08-18 07:14:10 +00:00
										 |  |  |                 row.prop(fluid, "use", text="") | 
					
						
							| 
									
										
										
										
											2010-04-04 14:52:15 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-25 06:27:25 +00:00
										 |  |  |             layout = layout.column() | 
					
						
							|  |  |  |             if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'): | 
					
						
							| 
									
										
										
										
											2010-08-19 10:16:30 +00:00
										 |  |  |                 layout.active = fluid.use | 
					
						
							| 
									
										
										
										
											2010-04-04 14:52:15 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |             if fluid.type == 'DOMAIN': | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |                 layout.operator("fluid.bake", text="Bake Fluid Simulation", icon='MOD_FLUIDSIM') | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |                 split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Resolution:") | 
					
						
							|  |  |  |                 col.prop(fluid, "resolution", text="Final") | 
					
						
							|  |  |  |                 col.label(text="Render Display:") | 
					
						
							|  |  |  |                 col.prop(fluid, "render_display_mode", text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Required Memory: " + fluid.memory_estimate) | 
					
						
							|  |  |  |                 col.prop(fluid, "preview_resolution", text="Preview") | 
					
						
							|  |  |  |                 col.label(text="Viewport Display:") | 
					
						
							|  |  |  |                 col.prop(fluid, "viewport_display_mode", text="") | 
					
						
							| 
									
										
										
										
											2009-11-19 12:58:19 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |                 split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Time:") | 
					
						
							| 
									
										
										
										
											2009-11-19 12:58:19 +00:00
										 |  |  |                 sub = col.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 sub.prop(fluid, "start_time", text="Start") | 
					
						
							|  |  |  |                 sub.prop(fluid, "end_time", text="End") | 
					
						
							| 
									
										
										
										
											2009-11-19 12:58:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |                 col = split.column() | 
					
						
							|  |  |  |                 col.label() | 
					
						
							| 
									
										
										
										
											2010-08-20 06:09:58 +00:00
										 |  |  |                 col.prop(fluid, "use_speed_vectors") | 
					
						
							|  |  |  |                 col.prop(fluid, "use_reverse_frames") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-19 15:49:30 +00:00
										 |  |  |                 layout.prop(fluid, "filepath", text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |             elif fluid.type == 'FLUID': | 
					
						
							|  |  |  |                 split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Volume Initialization:") | 
					
						
							|  |  |  |                 col.prop(fluid, "volume_initialization", text="") | 
					
						
							| 
									
										
										
										
											2010-08-20 06:09:58 +00:00
										 |  |  |                 col.prop(fluid, "use_animated_mesh") | 
					
						
							| 
									
										
										
										
											2009-11-21 00:05:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Initial Velocity:") | 
					
						
							|  |  |  |                 col.prop(fluid, "initial_velocity", text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |             elif fluid.type == 'OBSTACLE': | 
					
						
							|  |  |  |                 split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Volume Initialization:") | 
					
						
							|  |  |  |                 col.prop(fluid, "volume_initialization", text="") | 
					
						
							| 
									
										
										
										
											2010-08-20 06:09:58 +00:00
										 |  |  |                 col.prop(fluid, "use_animated_mesh") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Slip Type:") | 
					
						
							|  |  |  |                 col.prop(fluid, "slip_type", text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |                 if fluid.slip_type == 'PARTIALSLIP': | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                     col.prop(fluid, "partial_slip_factor", slider=True, text="Amount") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Impact:") | 
					
						
							|  |  |  |                 col.prop(fluid, "impact_factor", text="Factor") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |             elif fluid.type == 'INFLOW': | 
					
						
							|  |  |  |                 split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Volume Initialization:") | 
					
						
							|  |  |  |                 col.prop(fluid, "volume_initialization", text="") | 
					
						
							| 
									
										
										
										
											2010-08-20 06:09:58 +00:00
										 |  |  |                 col.prop(fluid, "use_animated_mesh") | 
					
						
							|  |  |  |                 col.prop(fluid, "use_local_coords") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Inflow Velocity:") | 
					
						
							|  |  |  |                 col.prop(fluid, "inflow_velocity", text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |             elif fluid.type == 'OUTFLOW': | 
					
						
							|  |  |  |                 split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Volume Initialization:") | 
					
						
							|  |  |  |                 col.prop(fluid, "volume_initialization", text="") | 
					
						
							| 
									
										
										
										
											2010-08-20 06:09:58 +00:00
										 |  |  |                 col.prop(fluid, "use_animated_mesh") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |                 split.column() | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |             elif fluid.type == 'PARTICLE': | 
					
						
							| 
									
										
										
										
											2009-11-19 12:58:19 +00:00
										 |  |  |                 split = layout.split() | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Influence:") | 
					
						
							|  |  |  |                 col.prop(fluid, "particle_influence", text="Size") | 
					
						
							|  |  |  |                 col.prop(fluid, "alpha_influence", text="Alpha") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Type:") | 
					
						
							| 
									
										
										
										
											2010-08-20 06:09:58 +00:00
										 |  |  |                 col.prop(fluid, "use_drops") | 
					
						
							|  |  |  |                 col.prop(fluid, "use_floats") | 
					
						
							| 
									
										
										
										
											2010-08-17 17:03:52 +00:00
										 |  |  |                 col.prop(fluid, "show_tracer") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-19 15:49:30 +00:00
										 |  |  |                 layout.prop(fluid, "filepath", text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |             elif fluid.type == 'CONTROL': | 
					
						
							|  |  |  |                 split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="") | 
					
						
							|  |  |  |                 col.prop(fluid, "quality", slider=True) | 
					
						
							| 
									
										
										
										
											2010-08-20 06:09:58 +00:00
										 |  |  |                 col.prop(fluid, "use_reverse_frames") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Time:") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |                 sub = col.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 sub.prop(fluid, "start_time", text="Start") | 
					
						
							|  |  |  |                 sub.prop(fluid, "end_time", text="End") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |                 split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Attraction Force:") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |                 sub = col.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 sub.prop(fluid, "attraction_strength", text="Strength") | 
					
						
							|  |  |  |                 sub.prop(fluid, "attraction_radius", text="Radius") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.label(text="Velocity Force:") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |                 sub = col.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 sub.prop(fluid, "velocity_strength", text="Strength") | 
					
						
							|  |  |  |                 sub.prop(fluid, "velocity_radius", text="Radius") | 
					
						
							| 
									
										
										
										
											2009-07-02 19:41:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  | class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, bpy.types.Panel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Domain World" | 
					
						
							|  |  |  |     bl_default_closed = True | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-09 01:37:09 +00:00
										 |  |  |     @classmethod | 
					
						
							|  |  |  |     def poll(cls, context): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         md = context.fluid | 
					
						
							| 
									
										
										
										
											2010-08-05 16:05:30 +00:00
										 |  |  |         return md and md.settings and (md.settings.type == 'DOMAIN') | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         fluid = context.fluid.settings | 
					
						
							| 
									
										
										
										
											2010-03-25 06:27:25 +00:00
										 |  |  |         scene = context.scene | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = split.column() | 
					
						
							| 
									
										
										
										
											2010-03-25 06:27:25 +00:00
										 |  |  |         if scene.use_gravity: | 
					
						
							|  |  |  |             col.label(text="Using Scene Gravity", icon="SCENE_DATA") | 
					
						
							|  |  |  |             sub = col.column() | 
					
						
							|  |  |  |             sub.enabled = False | 
					
						
							|  |  |  |             sub.prop(fluid, "gravity", text="") | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             col.label(text="Gravity:") | 
					
						
							|  |  |  |             col.prop(fluid, "gravity", text="") | 
					
						
							| 
									
										
										
										
											2010-04-04 14:52:15 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-25 06:27:25 +00:00
										 |  |  |         if scene.unit_settings.system != 'NONE': | 
					
						
							|  |  |  |             col.label(text="Using Scene Size Units", icon="SCENE_DATA") | 
					
						
							|  |  |  |             sub = col.column() | 
					
						
							|  |  |  |             sub.enabled = False | 
					
						
							| 
									
										
										
										
											2010-08-20 06:09:58 +00:00
										 |  |  |             sub.prop(fluid, "simulation_scale", text="Metres") | 
					
						
							| 
									
										
										
										
											2010-03-25 06:27:25 +00:00
										 |  |  |         else: | 
					
						
							|  |  |  |             col.label(text="Real World Size:") | 
					
						
							| 
									
										
										
										
											2010-08-20 06:09:58 +00:00
										 |  |  |             col.prop(fluid, "simulation_scale", text="Metres") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.label(text="Viscosity Presets:") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         sub = col.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         sub.prop(fluid, "viscosity_preset", text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         if fluid.viscosity_preset == 'MANUAL': | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             sub.prop(fluid, "viscosity_base", text="Base") | 
					
						
							|  |  |  |             sub.prop(fluid, "viscosity_exponent", text="Exponent", slider=True) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.label(text="Optimization:") | 
					
						
							|  |  |  |         col.prop(fluid, "grid_levels", slider=True) | 
					
						
							|  |  |  |         col.prop(fluid, "compressibility", slider=True) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  | class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, bpy.types.Panel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Domain Boundary" | 
					
						
							|  |  |  |     bl_default_closed = True | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-09 01:37:09 +00:00
										 |  |  |     @classmethod | 
					
						
							|  |  |  |     def poll(cls, context): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         md = context.fluid | 
					
						
							| 
									
										
										
										
											2010-08-05 16:05:30 +00:00
										 |  |  |         return md and md.settings and (md.settings.type == 'DOMAIN') | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         fluid = context.fluid.settings | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.label(text="Slip Type:") | 
					
						
							|  |  |  |         col.prop(fluid, "slip_type", text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         if fluid.slip_type == 'PARTIALSLIP': | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             col.prop(fluid, "partial_slip_factor", slider=True, text="Amount") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.label(text="Surface:") | 
					
						
							| 
									
										
										
										
											2010-08-20 06:09:58 +00:00
										 |  |  |         col.prop(fluid, "surface_smooth", text="Smoothing") | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.prop(fluid, "surface_subdivisions", text="Subdivisions") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  | class PHYSICS_PT_domain_particles(PhysicButtonsPanel, bpy.types.Panel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Domain Particles" | 
					
						
							|  |  |  |     bl_default_closed = True | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-09 01:37:09 +00:00
										 |  |  |     @classmethod | 
					
						
							|  |  |  |     def poll(cls, context): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         md = context.fluid | 
					
						
							| 
									
										
										
										
											2010-08-05 16:05:30 +00:00
										 |  |  |         return md and md.settings and (md.settings.type == 'DOMAIN') | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         fluid = context.fluid.settings | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = layout.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.prop(fluid, "tracer_particles") | 
					
						
							|  |  |  |         col.prop(fluid, "generate_particles") | 
					
						
							| 
									
										
										
										
											2009-07-03 19:12:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-14 11:21:21 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | def register(): | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  |     pass | 
					
						
							| 
									
										
										
										
											2010-02-14 11:21:21 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-22 23:32:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-14 11:21:21 +00:00
										 |  |  | def unregister(): | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  |     pass | 
					
						
							| 
									
										
										
										
											2010-02-16 09:55:07 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | if __name__ == "__main__": | 
					
						
							|  |  |  |     register() |