Don't show physics properties in game engine conext

Also rename fluid panels to be more consistent with other simulations
This commit is contained in:
Sergej Reich 2012-06-08 15:24:28 +00:00
parent 909752a3da
commit 221a787822
5 changed files with 37 additions and 59 deletions

@ -117,10 +117,6 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, Panel):
bl_label = "Cloth Cache" bl_label = "Cloth Cache"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return context.cloth
def draw(self, context): def draw(self, context):
md = context.cloth md = context.cloth
point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 'CLOTH') point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 'CLOTH')
@ -130,10 +126,6 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel):
bl_label = "Cloth Collision" bl_label = "Cloth Collision"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return context.cloth
def draw_header(self, context): def draw_header(self, context):
cloth = context.cloth.collision_settings cloth = context.cloth.collision_settings
@ -173,10 +165,6 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel):
bl_label = "Cloth Stiffness Scaling" bl_label = "Cloth Stiffness Scaling"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return context.cloth
def draw_header(self, context): def draw_header(self, context):
cloth = context.cloth.settings cloth = context.cloth.settings
@ -209,10 +197,6 @@ class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel):
bl_label = "Cloth Field Weights" bl_label = "Cloth Field Weights"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return (context.cloth)
def draw(self, context): def draw(self, context):
cloth = context.cloth.settings cloth = context.cloth.settings
effector_weights_ui(self, context, cloth.effector_weights) effector_weights_ui(self, context, cloth.effector_weights)

@ -120,7 +120,8 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
md = context.dynamic_paint md = context.dynamic_paint
return md and md.ui_type == 'CANVAS' and md.canvas_settings and md.canvas_settings.canvas_surfaces.active rd = context.scene.render
return md and md.ui_type == 'CANVAS' and md.canvas_settings and md.canvas_settings.canvas_surfaces.active and (not rd.use_game_engine)
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@ -194,10 +195,13 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
md = context.dynamic_paint md = context.dynamic_paint
rd = context.scene.render
if not (md and md.ui_type == 'CANVAS' and md.canvas_settings): if not (md and md.ui_type == 'CANVAS' and md.canvas_settings):
return 0 return 0
surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
return surface and not (surface.surface_format == 'VERTEX' and (surface.surface_type in {'DISPLACE', 'WAVE'})) return (surface and
(not (surface.surface_format == 'VERTEX' and (surface.surface_type in {'DISPLACE', 'WAVE'}))) and
(not rd.use_game_engine))
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@ -284,10 +288,11 @@ class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
md = context.dynamic_paint md = context.dynamic_paint
rd = context.scene.render
if not (md and md.ui_type == 'CANVAS' and md.canvas_settings): if not (md and md.ui_type == 'CANVAS' and md.canvas_settings):
return 0 return 0
surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
return (surface and surface.surface_type == 'PAINT') return (surface and surface.surface_type == 'PAINT') and (not rd.use_game_engine)
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@ -318,10 +323,11 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
md = context.dynamic_paint md = context.dynamic_paint
rd = context.scene.render
if not (md and md.ui_type == 'CANVAS' and md.canvas_settings): if not (md and md.ui_type == 'CANVAS' and md.canvas_settings):
return False return False
surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
return (surface and surface.surface_type == 'PAINT') return (surface and surface.surface_type == 'PAINT') and (not rd.use_game_engine)
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@ -366,11 +372,13 @@ class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
md = context.dynamic_paint md = context.dynamic_paint
rd = context.scene.render
return (md and return (md and
md.ui_type == 'CANVAS' and md.ui_type == 'CANVAS' and
md.canvas_settings and md.canvas_settings and
md.canvas_settings.canvas_surfaces.active and md.canvas_settings.canvas_surfaces.active and
md.canvas_settings.canvas_surfaces.active.is_cache_user) md.canvas_settings.canvas_surfaces.active.is_cache_user and
(not rd.use_game_engine))
def draw(self, context): def draw(self, context):
surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
@ -385,7 +393,8 @@ class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, Panel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
md = context.dynamic_paint md = context.dynamic_paint
return md and md.ui_type == 'BRUSH' and md.brush_settings rd = context.scene.render
return md and md.ui_type == 'BRUSH' and md.brush_settings and (not rd.use_game_engine)
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@ -437,7 +446,8 @@ class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, Panel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
md = context.dynamic_paint md = context.dynamic_paint
return md and md.ui_type == 'BRUSH' and md.brush_settings rd = context.scene.render
return md and md.ui_type == 'BRUSH' and md.brush_settings and (not rd.use_game_engine)
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@ -472,7 +482,8 @@ class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, Panel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
md = context.dynamic_paint md = context.dynamic_paint
return md and md.ui_type == 'BRUSH' and md.brush_settings rd = context.scene.render
return md and md.ui_type == 'BRUSH' and md.brush_settings and (not rd.use_game_engine)
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout

@ -192,13 +192,14 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel): class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel):
bl_label = "Domain World" bl_label = "Fluid World"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
md = context.fluid md = context.fluid
return md and md.settings and (md.settings.type == 'DOMAIN') rd = context.scene.render
return md and md.settings and (md.settings.type == 'DOMAIN') and (not rd.use_game_engine)
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@ -244,13 +245,14 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel):
class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel): class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel):
bl_label = "Domain Boundary" bl_label = "Fluid Boundary"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
md = context.fluid md = context.fluid
return md and md.settings and (md.settings.type == 'DOMAIN') rd = context.scene.render
return md and md.settings and (md.settings.type == 'DOMAIN') and (not rd.use_game_engine)
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@ -273,13 +275,14 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel):
class PHYSICS_PT_domain_particles(PhysicButtonsPanel, Panel): class PHYSICS_PT_domain_particles(PhysicButtonsPanel, Panel):
bl_label = "Domain Particles" bl_label = "Fluid Particles"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
md = context.fluid md = context.fluid
return md and md.settings and (md.settings.type == 'DOMAIN') rd = context.scene.render
return md and md.settings and (md.settings.type == 'DOMAIN') and (not rd.use_game_engine)
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout

@ -117,7 +117,8 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
md = context.smoke md = context.smoke
return md and (md.smoke_type == 'DOMAIN') rd = context.scene.render
return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine)
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@ -145,7 +146,8 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
md = context.smoke md = context.smoke
return md and (md.smoke_type == 'DOMAIN') rd = context.scene.render
return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine)
def draw_header(self, context): def draw_header(self, context):
md = context.smoke.domain_settings md = context.smoke.domain_settings
@ -182,7 +184,8 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
md = context.smoke md = context.smoke
return md and (md.smoke_type == 'DOMAIN') rd = context.scene.render
return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine)
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@ -202,8 +205,9 @@ class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, Panel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
smoke = context.smoke md = context.smoke
return (smoke and smoke.smoke_type == 'DOMAIN') rd = context.scene.render
return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine)
def draw(self, context): def draw(self, context):
domain = context.smoke.domain_settings domain = context.smoke.domain_settings

@ -72,10 +72,6 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel, Panel):
bl_label = "Soft Body Cache" bl_label = "Soft Body Cache"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return context.soft_body
def draw(self, context): def draw(self, context):
md = context.soft_body md = context.soft_body
point_cache_ui(self, context, md.point_cache, softbody_panel_enabled(md), 'SOFTBODY') point_cache_ui(self, context, md.point_cache, softbody_panel_enabled(md), 'SOFTBODY')
@ -85,10 +81,6 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, Panel):
bl_label = "Soft Body Goal" bl_label = "Soft Body Goal"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return context.soft_body
def draw_header(self, context): def draw_header(self, context):
softbody = context.soft_body.settings softbody = context.soft_body.settings
@ -128,10 +120,6 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel):
bl_label = "Soft Body Edges" bl_label = "Soft Body Edges"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return context.soft_body
def draw_header(self, context): def draw_header(self, context):
softbody = context.soft_body.settings softbody = context.soft_body.settings
@ -181,10 +169,6 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, Panel):
bl_label = "Soft Body Self Collision" bl_label = "Soft Body Self Collision"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return context.soft_body
def draw_header(self, context): def draw_header(self, context):
softbody = context.soft_body.settings softbody = context.soft_body.settings
@ -213,10 +197,6 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, Panel):
bl_label = "Soft Body Solver" bl_label = "Soft Body Solver"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return context.soft_body
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@ -249,10 +229,6 @@ class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel, Panel):
bl_label = "Soft Body Field Weights" bl_label = "Soft Body Field Weights"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return (context.soft_body)
def draw(self, context): def draw(self, context):
md = context.soft_body md = context.soft_body
softbody = md.settings softbody = md.settings