2.5 Physic Buttons:
authorThomas Dinges <blender@dingto.org>
Fri, 3 Jul 2009 19:12:59 +0000 (19:12 +0000)
committerThomas Dinges <blender@dingto.org>
Fri, 3 Jul 2009 19:12:59 +0000 (19:12 +0000)
* Added Fluid Buttons.

release/ui/buttons_physics_fluid.py

index 57e3d910f30ecf0083801574f3abfe910210f474..2ab33b4a4160ed5cff52fff1170443d54106ce0e 100644 (file)
@@ -49,14 +49,175 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
                        row.item_enumR(fluid, "type", "PARTICLE")
                        row.item_enumR(fluid, "type", "CONTROL")
 
-                       if fluid.type == "DOMAIN":
+                       if fluid.type == 'DOMAIN':
                                layout.itemO("FLUID_OT_bake", text="BAKE")
+                               layout.itemL(text="Required Memory: " + fluid.memory_estimate)
+                               
+                               layout.itemL(text="Resolution:")
+                               
+                               split = layout.split()
+                               
+                               col = split.column()
+                               colsub = col.column(align=True)
+                               colsub.itemR(fluid, "resolution", text="Final")
+                               colsub.itemR(fluid, "render_display_mode", text="")
+                               colsub = col.column(align=True)
+                               colsub.itemL(text="Time:")
+                               colsub.itemR(fluid, "start_time", text="Start")
+                               colsub.itemR(fluid, "end_time", text="End")
+                               
+                               col = split.column()
+                               colsub = col.column(align=True)
+                               colsub.itemR(fluid, "preview_resolution", text="Preview", slider=True)
+                               colsub.itemR(fluid, "viewport_display_mode", text="")
+                               colsub = col.column()
+                               colsub.itemR(fluid, "reverse_frames")
+                               colsub.itemR(fluid, "generate_speed_vectors")
+                               colsub.itemR(fluid, "path", text="")
+                               
+                       if fluid.type in ('FLUID', 'OBSTACLE', 'INFLOW', 'OUTFLOW'):
+                               layout.itemR(fluid, "volume_initialization")
+                               
+                       if fluid.type == 'FLUID':
+                               row = layout.row()
+                               row.column().itemR(fluid, "initial_velocity")
+                               row.itemR(fluid, "export_animated_mesh")
+                               
+                       if fluid.type == 'OBSTACLE':
+                               row = layout.row()
+                               row.itemL()
+                               row.itemR(fluid, "export_animated_mesh")
+                               layout.itemR(fluid, "slip_type", expand=True)
+                               if fluid.slip_type == 'PARTIALSLIP':
+                                       layout.itemR(fluid, "partial_slip_amount", text="Amount")
+                                       
+                               layout.itemR(fluid, "impact_factor")
+                               
+                       if fluid.type == 'INFLOW':
+                               row = layout.row()
+                               row.column().itemR(fluid, "inflow_velocity")
+                               row.itemR(fluid, "export_animated_mesh")
+                               layout.itemR(fluid, "local_coordinates")
+                               
+                       if fluid.type == 'OUTFLOW':
+                               row = layout.row()
+                               row.itemL()
+                               row.itemR(fluid, "export_animated_mesh")
+                               
+                       if fluid.type == 'PARTICLE':
+                               split = layout.split()
+                               
+                               col = split.column()
+                               col.itemL(text="Type:")
+                               col.itemR(fluid, "drops")
+                               col.itemR(fluid, "floats")
+                               col.itemR(fluid, "tracer")
+                               
+                               col = split.column()
+                               col.itemL(text="Influence:")
+                               col.itemR(fluid, "particle_influence", text="Particle")
+                               col.itemR(fluid, "alpha_influence", text="Alpha")
+                               
+                               layout.itemR(fluid, "path")
+                               
+                       if fluid.type == 'CONTROL':
+                               split = layout.split()
+                               
+                               col = split.column()
+                               col.itemL(text="Time:")
+                               col.itemR(fluid, "start_time", text="Start")
+                               col.itemR(fluid, "end_time", text="End")
+                               
+                               col = split.column()
+                               col.itemR(fluid, "quality", slider=True)
+                               col.itemR(fluid, "reverse_frames")
+                               
+                               split = layout.split()
+                               
+                               col = split.column()
+                               col.itemL(text="Attraction:")
+                               col.itemR(fluid, "attraction_strength", text="Strength")
+                               col.itemR(fluid, "attraction_radius", text="Radius")
+                               
+                               col = split.column()
+                               col.itemL(text="Velocity:")
+                               col.itemR(fluid, "velocity_strength", text="Strength")
+                               col.itemR(fluid, "velocity_radius", text="Radius")
 
-                               col = layout.column(align=True)
+class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
+       __idname__ = "PHYSICS_PT_domain_gravity"
+       __label__ = "Domain World/Gravity"
+       __default_closed__ = True
+       
+       def poll(self, context):
+               md = context.fluid
+               if md:
+                       return (md.settings.type == 'DOMAIN')
 
-                               col.itemL(text="Req. Mem.: " + fluid.memory_estimate)
-                               col.itemR(fluid, "resolution")
-                               col.itemR(fluid, "preview_resolution")
+       def draw(self, context):
+               layout = self.layout
+               fluid = context.fluid.settings
+               
+               split = layout.split()
+               
+               col = split.column()
+               col.itemR(fluid, "gravity")
+               
+               col = split.column(align=True)
+               col.itemL(text="Viscosity:")
+               col.itemR(fluid, "viscosity_preset", text="")
+               if fluid.viscosity_preset == 'MANUAL':
+                       col.itemR(fluid, "viscosity_base", text="Base")
+                       col.itemR(fluid, "viscosity_exponent", text="Exponent")
                        
-bpy.types.register(PHYSICS_PT_fluid)
+               col = layout.column_flow()
+               col.itemR(fluid, "real_world_size")
+               col.itemR(fluid, "grid_levels")
+               col.itemR(fluid, "compressibility")
+       
+class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
+       __idname__ = "PHYSICS_PT_domain_boundary"
+       __label__ = "Domain Boundary"
+       __default_closed__ = True
+       
+       def poll(self, context):
+               md = context.fluid
+               if md:
+                       return (md.settings.type == 'DOMAIN')
+
+       def draw(self, context):
+               layout = self.layout
+               fluid = context.fluid.settings
+               
+               layout.itemL(text="Slip:")
+               
+               layout.itemR(fluid, "slip_type", expand=True)
+               if fluid.slip_type == 'PARTIALSLIP':
+                       layout.itemR(fluid, "partial_slip_amount", text="Amount")
+               
+               layout.itemL(text="Surface:")
+               row = layout.row()
+               row.itemR(fluid, "surface_smoothing", text="Smoothing")
+               row.itemR(fluid, "surface_subdivisions", text="Subdivisions")
+               
+class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
+       __idname__ = "PHYSICS_PT_domain_particles"
+       __label__ = "Domain Particles"
+       __default_closed__ = True
+       
+       def poll(self, context):
+               md = context.fluid
+               if md:
+                       return (md.settings.type == 'DOMAIN')
 
+       def draw(self, context):
+               layout = self.layout
+               fluid = context.fluid.settings
+               
+               layout.itemR(fluid, "tracer_particles")
+               layout.itemR(fluid, "generate_particles")
+
+bpy.types.register(PHYSICS_PT_fluid)
+bpy.types.register(PHYSICS_PT_domain_gravity)
+bpy.types.register(PHYSICS_PT_domain_boundary)
+bpy.types.register(PHYSICS_PT_domain_particles)