From 221a7878223e983372ba830e4ca1a17067abf2ba Mon Sep 17 00:00:00 2001 From: Sergej Reich Date: Fri, 8 Jun 2012 15:24:28 +0000 Subject: [PATCH] Don't show physics properties in game engine conext Also rename fluid panels to be more consistent with other simulations --- .../startup/bl_ui/properties_physics_cloth.py | 16 ----------- .../bl_ui/properties_physics_dynamicpaint.py | 27 +++++++++++++------ .../startup/bl_ui/properties_physics_fluid.py | 15 ++++++----- .../startup/bl_ui/properties_physics_smoke.py | 14 ++++++---- .../bl_ui/properties_physics_softbody.py | 24 ----------------- 5 files changed, 37 insertions(+), 59 deletions(-) diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py index 0240335c98f..33b977b5f04 100644 --- a/release/scripts/startup/bl_ui/properties_physics_cloth.py +++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py @@ -117,10 +117,6 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, Panel): bl_label = "Cloth Cache" bl_options = {'DEFAULT_CLOSED'} - @classmethod - def poll(cls, context): - return context.cloth - def draw(self, context): md = context.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_options = {'DEFAULT_CLOSED'} - @classmethod - def poll(cls, context): - return context.cloth - def draw_header(self, context): cloth = context.cloth.collision_settings @@ -173,10 +165,6 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel): bl_label = "Cloth Stiffness Scaling" bl_options = {'DEFAULT_CLOSED'} - @classmethod - def poll(cls, context): - return context.cloth - def draw_header(self, context): cloth = context.cloth.settings @@ -209,10 +197,6 @@ class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel): bl_label = "Cloth Field Weights" bl_options = {'DEFAULT_CLOSED'} - @classmethod - def poll(cls, context): - return (context.cloth) - def draw(self, context): cloth = context.cloth.settings effector_weights_ui(self, context, cloth.effector_weights) diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 04696c793a6..db0794d8a8a 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -120,7 +120,8 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): 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): layout = self.layout @@ -194,10 +195,13 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.dynamic_paint + rd = context.scene.render if not (md and md.ui_type == 'CANVAS' and md.canvas_settings): return 0 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): layout = self.layout @@ -284,10 +288,11 @@ class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.dynamic_paint + rd = context.scene.render if not (md and md.ui_type == 'CANVAS' and md.canvas_settings): return 0 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): layout = self.layout @@ -318,10 +323,11 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.dynamic_paint + rd = context.scene.render if not (md and md.ui_type == 'CANVAS' and md.canvas_settings): return False 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): layout = self.layout @@ -366,11 +372,13 @@ class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.dynamic_paint + rd = context.scene.render return (md and md.ui_type == 'CANVAS' and md.canvas_settings 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): surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active @@ -385,7 +393,8 @@ class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): 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): layout = self.layout @@ -437,7 +446,8 @@ class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): 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): layout = self.layout @@ -472,7 +482,8 @@ class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): 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): layout = self.layout diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py index beb525bbd07..751f3e18acc 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py @@ -192,13 +192,14 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel): class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel): - bl_label = "Domain World" + bl_label = "Fluid World" bl_options = {'DEFAULT_CLOSED'} @classmethod def poll(cls, context): 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): layout = self.layout @@ -244,13 +245,14 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel): class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel): - bl_label = "Domain Boundary" + bl_label = "Fluid Boundary" bl_options = {'DEFAULT_CLOSED'} @classmethod def poll(cls, context): 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): layout = self.layout @@ -273,13 +275,14 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel): class PHYSICS_PT_domain_particles(PhysicButtonsPanel, Panel): - bl_label = "Domain Particles" + bl_label = "Fluid Particles" bl_options = {'DEFAULT_CLOSED'} @classmethod def poll(cls, context): 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): layout = self.layout diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py index 012aefebb6e..1b333f1e505 100644 --- a/release/scripts/startup/bl_ui/properties_physics_smoke.py +++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py @@ -117,7 +117,8 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): 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): layout = self.layout @@ -145,7 +146,8 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): 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): md = context.smoke.domain_settings @@ -182,7 +184,8 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): 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): layout = self.layout @@ -202,8 +205,9 @@ class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): - smoke = context.smoke - return (smoke and smoke.smoke_type == 'DOMAIN') + md = context.smoke + rd = context.scene.render + return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine) def draw(self, context): domain = context.smoke.domain_settings diff --git a/release/scripts/startup/bl_ui/properties_physics_softbody.py b/release/scripts/startup/bl_ui/properties_physics_softbody.py index ea4180c891f..b043c1f9b68 100644 --- a/release/scripts/startup/bl_ui/properties_physics_softbody.py +++ b/release/scripts/startup/bl_ui/properties_physics_softbody.py @@ -72,10 +72,6 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel, Panel): bl_label = "Soft Body Cache" bl_options = {'DEFAULT_CLOSED'} - @classmethod - def poll(cls, context): - return context.soft_body - def draw(self, context): md = context.soft_body 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_options = {'DEFAULT_CLOSED'} - @classmethod - def poll(cls, context): - return context.soft_body - def draw_header(self, context): softbody = context.soft_body.settings @@ -128,10 +120,6 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel): bl_label = "Soft Body Edges" bl_options = {'DEFAULT_CLOSED'} - @classmethod - def poll(cls, context): - return context.soft_body - def draw_header(self, context): softbody = context.soft_body.settings @@ -181,10 +169,6 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, Panel): bl_label = "Soft Body Self Collision" bl_options = {'DEFAULT_CLOSED'} - @classmethod - def poll(cls, context): - return context.soft_body - def draw_header(self, context): softbody = context.soft_body.settings @@ -213,10 +197,6 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, Panel): bl_label = "Soft Body Solver" bl_options = {'DEFAULT_CLOSED'} - @classmethod - def poll(cls, context): - return context.soft_body - def draw(self, context): layout = self.layout @@ -249,10 +229,6 @@ class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel, Panel): bl_label = "Soft Body Field Weights" bl_options = {'DEFAULT_CLOSED'} - @classmethod - def poll(cls, context): - return (context.soft_body) - def draw(self, context): md = context.soft_body softbody = md.settings