Use COMPAT_ENGINES instead of RenderEngine.use_game_engine for panel poll methods
authorMitchell Stokes <mogurijin@gmail.com>
Tue, 5 Jul 2016 05:05:32 +0000 (22:05 -0700)
committerMitchell Stokes <mogurijin@gmail.com>
Thu, 28 Jul 2016 02:00:35 +0000 (19:00 -0700)
This mostly affects physics panels. Any engines relying on
RenderEngine.use_game_engine flag to show/hide panels will need to be
updated. The COMPAT_ENGINES technique is how we usually deal with this.
One issue with use_game_engine is that I cannot find a way to set it; it
appears only the BGE can set it. This means (without this commit)
external RenderEngines cannot get rid of the default physics panels.

The RE_GAME flag (the C flag behind use_game_engine) is pretty hacky
and we should look into removing its usage where possible.

release/scripts/startup/bl_ui/properties_game.py
release/scripts/startup/bl_ui/properties_physics_cloth.py
release/scripts/startup/bl_ui/properties_physics_common.py
release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
release/scripts/startup/bl_ui/properties_physics_field.py
release/scripts/startup/bl_ui/properties_physics_fluid.py
release/scripts/startup/bl_ui/properties_physics_rigidbody.py
release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py
release/scripts/startup/bl_ui/properties_physics_smoke.py
release/scripts/startup/bl_ui/properties_physics_softbody.py
release/scripts/startup/bl_ui/properties_world.py

index 300be7080496f9dd44fbf31c06aaa8763d2e6737..386ad2548926213ef7c5b459ff1a8067df027fdd 100644 (file)
@@ -568,7 +568,7 @@ class WORLD_PT_game_context_world(WorldButtonsPanel, Panel):
     @classmethod
     def poll(cls, context):
         rd = context.scene.render
     @classmethod
     def poll(cls, context):
         rd = context.scene.render
-        return (context.scene) and (rd.use_game_engine)
+        return (context.scene) and (rd.engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
index a5cbffb2e2c509d3eca9ff0c5f0c5975c8d1f3b4..2f1798ebd54a945444555d6cb09c94026f3fd8e8 100644 (file)
@@ -46,11 +46,12 @@ class PhysicButtonsPanel:
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
-        return (ob and ob.type == 'MESH') and (not rd.use_game_engine) and (context.cloth)
+        return (ob and ob.type == 'MESH') and (rd.engine in cls.COMPAT_ENGINES) and (context.cloth)
 
 
 class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel):
     bl_label = "Cloth"
 
 
 class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel):
     bl_label = "Cloth"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -113,6 +114,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, Panel):
     bl_label = "Cloth Cache"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, Panel):
     bl_label = "Cloth Cache"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         md = context.cloth
 
     def draw(self, context):
         md = context.cloth
@@ -122,6 +124,7 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel):
     bl_label = "Cloth Collision"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel):
     bl_label = "Cloth Collision"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw_header(self, context):
         cloth = context.cloth.collision_settings
 
     def draw_header(self, context):
         cloth = context.cloth.collision_settings
@@ -161,6 +164,7 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel):
     bl_label = "Cloth Stiffness Scaling"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel):
     bl_label = "Cloth Stiffness Scaling"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw_header(self, context):
         cloth = context.cloth.settings
 
     def draw_header(self, context):
         cloth = context.cloth.settings
@@ -193,6 +197,7 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_cloth_sewing(PhysicButtonsPanel, Panel):
     bl_label = "Cloth Sewing Springs"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_cloth_sewing(PhysicButtonsPanel, Panel):
     bl_label = "Cloth Sewing Springs"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw_header(self, context):
         cloth = context.cloth.settings
 
     def draw_header(self, context):
         cloth = context.cloth.settings
@@ -226,6 +231,7 @@ class PHYSICS_PT_cloth_sewing(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel):
     bl_label = "Cloth Field Weights"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel):
     bl_label = "Cloth Field Weights"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         cloth = context.cloth.settings
 
     def draw(self, context):
         cloth = context.cloth.settings
index 82eecf0fb5a9dd84039213cf798f4496d796964a..277b59d187de1734c71ff5f67b7422baec4b1bfc 100644 (file)
@@ -31,7 +31,7 @@ class PhysicButtonsPanel:
     @classmethod
     def poll(cls, context):
         rd = context.scene.render
     @classmethod
     def poll(cls, context):
         rd = context.scene.render
-        return (context.object) and (not rd.use_game_engine)
+        return (context.object) and rd.engine in cls.COMPAT_ENGINES
 
 
 def physics_add(self, layout, md, name, type, typeicon, toggles):
 
 
 def physics_add(self, layout, md, name, type, typeicon, toggles):
@@ -57,6 +57,7 @@ def physics_add_special(self, layout, data, name, addop, removeop, typeicon):
 class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
     bl_label = ""
     bl_options = {'HIDE_HEADER'}
 class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
     bl_label = ""
     bl_options = {'HIDE_HEADER'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         obj = context.object
 
     def draw(self, context):
         obj = context.object
index 269ffa6d371e878dc580e784ab7de4cfad64d768..6c3a3246cf6988216df9800e3fab03ffc47deca8 100644 (file)
@@ -56,11 +56,12 @@ class PhysicButtonsPanel:
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
-        return (ob and ob.type == 'MESH') and (not rd.use_game_engine) and context.dynamic_paint
+        return (ob and ob.type == 'MESH') and rd.engine in cls.COMPAT_ENGINES and context.dynamic_paint
 
 
 class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint"
 
 
 class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -137,12 +138,13 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel):
 
 class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Advanced"
 
 class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Advanced"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
         rd = context.scene.render
 
     @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 (not rd.use_game_engine)
+        return md and md.ui_type == 'CANVAS' and md.canvas_settings and md.canvas_settings.canvas_surfaces.active and rd.engine in cls.COMPAT_ENGINES
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -213,6 +215,7 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Output"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Output"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
 
     @classmethod
     def poll(cls, context):
@@ -223,7 +226,7 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel):
         surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
         return (surface and
                 (not (surface.surface_format == 'VERTEX' and (surface.surface_type in {'DISPLACE', 'WAVE'}))) and
         surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
         return (surface and
                 (not (surface.surface_format == 'VERTEX' and (surface.surface_type in {'DISPLACE', 'WAVE'}))) and
-                (not rd.use_game_engine))
+                (rd.engine in cls.COMPAT_ENGINES))
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -306,6 +309,7 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Initial Color"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Initial Color"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
 
     @classmethod
     def poll(cls, context):
@@ -314,7 +318,7 @@ class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel):
         if not (md and md.ui_type == 'CANVAS' and md.canvas_settings):
             return 0
         surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
         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') and (not rd.use_game_engine)
+        return (surface and surface.surface_type == 'PAINT') and (rd.engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -342,6 +346,7 @@ class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Effects"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Effects"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
 
     @classmethod
     def poll(cls, context):
@@ -350,7 +355,7 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel):
         if not (md and md.ui_type == 'CANVAS' and md.canvas_settings):
             return False
         surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
         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') and (not rd.use_game_engine)
+        return (surface and surface.surface_type == 'PAINT') and (rd.engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -391,6 +396,7 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Cache"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Cache"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
 
     @classmethod
     def poll(cls, context):
@@ -401,7 +407,7 @@ class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel):
                 md.canvas_settings and
                 md.canvas_settings.canvas_surfaces.active and
                 md.canvas_settings.canvas_surfaces.active.is_cache_user and
                 md.canvas_settings and
                 md.canvas_settings.canvas_surfaces.active and
                 md.canvas_settings.canvas_surfaces.active.is_cache_user and
-                (not rd.use_game_engine))
+                (rd.engine in cls.COMPAT_ENGINES))
 
     def draw(self, context):
         surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
 
     def draw(self, context):
         surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
@@ -412,12 +418,13 @@ class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel):
 
 class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Source"
 
 class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Source"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
         rd = context.scene.render
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
         rd = context.scene.render
-        return md and md.ui_type == 'BRUSH' and md.brush_settings and (not rd.use_game_engine)
+        return md and md.ui_type == 'BRUSH' and md.brush_settings and (rd.engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -465,12 +472,13 @@ class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Velocity"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Velocity"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
         rd = context.scene.render
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
         rd = context.scene.render
-        return md and md.ui_type == 'BRUSH' and md.brush_settings and (not rd.use_game_engine)
+        return md and md.ui_type == 'BRUSH' and md.brush_settings and (rd.engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -501,12 +509,13 @@ class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Waves"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Waves"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
         rd = context.scene.render
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
         rd = context.scene.render
-        return md and md.ui_type == 'BRUSH' and md.brush_settings and (not rd.use_game_engine)
+        return md and md.ui_type == 'BRUSH' and md.brush_settings and (rd.engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
index 348f66da1451b1929facc6ebfcc58e81c45ec1e3..1cebc0496b05c18346cd973b404b3a0694540f92 100644 (file)
@@ -34,17 +34,18 @@ class PhysicButtonsPanel:
     @classmethod
     def poll(cls, context):
         rd = context.scene.render
     @classmethod
     def poll(cls, context):
         rd = context.scene.render
-        return (context.object) and (not rd.use_game_engine)
+        return (context.object) and (rd.engine in cls.COMPAT_ENGINES)
 
 
 class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
     bl_label = "Force Fields"
 
 
 class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
     bl_label = "Force Fields"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
 
     @classmethod
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
-        return (not rd.use_game_engine) and (ob.field) and (ob.field.type != 'NONE')
+        return (rd.engine in cls.COMPAT_ENGINES) and (ob.field) and (ob.field.type != 'NONE')
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -176,12 +177,13 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
 
 class PHYSICS_PT_collision(PhysicButtonsPanel, Panel):
     bl_label = "Collision"
 
 class PHYSICS_PT_collision(PhysicButtonsPanel, Panel):
     bl_label = "Collision"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
 
     @classmethod
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
-        return (ob and ob.type == 'MESH') and (not rd.use_game_engine) and (context.collision)
+        return (ob and ob.type == 'MESH') and (rd.engine in cls.COMPAT_ENGINES) and (context.collision)
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
index d6fd8f3792c640b2cfc3bffb36b6d1193d989b8f..5d7034c2e685f30d433b849071f139f7cb339bd8 100644 (file)
@@ -38,11 +38,12 @@ class PhysicButtonsPanel:
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
-        return (ob and ob.type == 'MESH') and (not rd.use_game_engine) and (context.fluid)
+        return (ob and ob.type == 'MESH') and rd.engine in cls.COMPAT_ENGINES and (context.fluid)
 
 
 class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
     bl_label = "Fluid"
 
 
 class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
     bl_label = "Fluid"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -205,12 +206,13 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel):
     bl_label = "Fluid World"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel):
     bl_label = "Fluid World"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         md = context.fluid
         rd = context.scene.render
 
     @classmethod
     def poll(cls, context):
         md = context.fluid
         rd = context.scene.render
-        return md and md.settings and (md.settings.type == 'DOMAIN') and (not rd.use_game_engine)
+        return md and md.settings and (md.settings.type == 'DOMAIN') and rd.engine in cls.COMPAT_ENGINES
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -258,12 +260,13 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel):
     bl_label = "Fluid Boundary"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel):
     bl_label = "Fluid Boundary"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         md = context.fluid
         rd = context.scene.render
 
     @classmethod
     def poll(cls, context):
         md = context.fluid
         rd = context.scene.render
-        return md and md.settings and (md.settings.type == 'DOMAIN') and (not rd.use_game_engine)
+        return md and md.settings and (md.settings.type == 'DOMAIN') and rd.engine in cls.COMPAT_ENGINES
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -288,12 +291,13 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_domain_particles(PhysicButtonsPanel, Panel):
     bl_label = "Fluid Particles"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_domain_particles(PhysicButtonsPanel, Panel):
     bl_label = "Fluid Particles"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         md = context.fluid
         rd = context.scene.render
 
     @classmethod
     def poll(cls, context):
         md = context.fluid
         rd = context.scene.render
-        return md and md.settings and (md.settings.type == 'DOMAIN') and (not rd.use_game_engine)
+        return md and md.settings and (md.settings.type == 'DOMAIN') and rd.engine in cls.COMPAT_ENGINES
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
index e7225d73e419dc6ed5221269b42e42172ac0b00b..eeb21c046bfcdc1ee346d22319cb4a0aa14bd4bc 100644 (file)
@@ -29,12 +29,13 @@ class PHYSICS_PT_rigidbody_panel:
 
 class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel):
     bl_label = "Rigid Body"
 
 class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel):
     bl_label = "Rigid Body"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         obj = context.object
         return (obj and obj.rigid_body and
 
     @classmethod
     def poll(cls, context):
         obj = context.object
         return (obj and obj.rigid_body and
-                (not context.scene.render.use_game_engine))
+                (context.scene.render.engine in cls.COMPAT_ENGINES))
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -55,12 +56,13 @@ class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel):
 
 class PHYSICS_PT_rigid_body_collisions(PHYSICS_PT_rigidbody_panel, Panel):
     bl_label = "Rigid Body Collisions"
 
 class PHYSICS_PT_rigid_body_collisions(PHYSICS_PT_rigidbody_panel, Panel):
     bl_label = "Rigid Body Collisions"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         obj = context.object
         return (obj and obj.rigid_body and
 
     @classmethod
     def poll(cls, context):
         obj = context.object
         return (obj and obj.rigid_body and
-                (not context.scene.render.use_game_engine))
+                (context.scene.render.engine in cls.COMPAT_ENGINES))
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -99,13 +101,14 @@ class PHYSICS_PT_rigid_body_collisions(PHYSICS_PT_rigidbody_panel, Panel):
 class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel):
     bl_label = "Rigid Body Dynamics"
     bl_default_closed = True
 class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel):
     bl_label = "Rigid Body Dynamics"
     bl_default_closed = True
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         obj = context.object
         return (obj and obj.rigid_body and
                 obj.rigid_body.type == 'ACTIVE' and
 
     @classmethod
     def poll(cls, context):
         obj = context.object
         return (obj and obj.rigid_body and
                 obj.rigid_body.type == 'ACTIVE' and
-                (not context.scene.render.use_game_engine))
+                (context.scene.render.engine in cls.COMPAT_ENGINES))
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
index 3f5e0f1fc9bc34949bd80e3ca8d1b4258ce24f0d..38c97746f4af4475c9196929faf0a31788fac5af 100644 (file)
@@ -29,12 +29,13 @@ class PHYSICS_PT_rigidbody_constraint_panel:
 
 class PHYSICS_PT_rigid_body_constraint(PHYSICS_PT_rigidbody_constraint_panel, Panel):
     bl_label = "Rigid Body Constraint"
 
 class PHYSICS_PT_rigid_body_constraint(PHYSICS_PT_rigidbody_constraint_panel, Panel):
     bl_label = "Rigid Body Constraint"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
 
     @classmethod
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
-        return (ob and ob.rigid_body_constraint and (not rd.use_game_engine))
+        return (ob and ob.rigid_body_constraint and rd.engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
index ef7d25e0a421b9509e650378f3fdd474b5ef3939..99aa54a958af0ebc93648ec62f54b280cfe07733 100644 (file)
@@ -35,11 +35,12 @@ class PhysicButtonsPanel:
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
-        return (ob and ob.type == 'MESH') and (not rd.use_game_engine) and (context.smoke)
+        return (ob and ob.type == 'MESH') and (rd.engine in cls.COMPAT_ENGINES) and (context.smoke)
 
 
 class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
     bl_label = "Smoke"
 
 
 class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
     bl_label = "Smoke"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -131,6 +132,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Flow Advanced"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Flow Advanced"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
 
     @classmethod
     def poll(cls, context):
@@ -165,6 +167,7 @@ class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Flames"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Flames"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
 
     @classmethod
     def poll(cls, context):
@@ -194,6 +197,7 @@ class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Adaptive Domain"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Adaptive Domain"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
 
     @classmethod
     def poll(cls, context):
@@ -227,12 +231,13 @@ class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
     bl_label = "Smoke High Resolution"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
     bl_label = "Smoke High Resolution"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         md = context.smoke
         rd = context.scene.render
 
     @classmethod
     def poll(cls, context):
         md = context.smoke
         rd = context.scene.render
-        return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine)
+        return md and (md.smoke_type == 'DOMAIN') and (rd.engine in cls.COMPAT_ENGINES)
 
     def draw_header(self, context):
         md = context.smoke.domain_settings
 
     def draw_header(self, context):
         md = context.smoke.domain_settings
@@ -266,12 +271,13 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Groups"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Groups"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         md = context.smoke
         rd = context.scene.render
 
     @classmethod
     def poll(cls, context):
         md = context.smoke
         rd = context.scene.render
-        return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine)
+        return md and (md.smoke_type == 'DOMAIN') and (rd.engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -294,12 +300,13 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Cache"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Cache"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         md = context.smoke
         rd = context.scene.render
 
     @classmethod
     def poll(cls, context):
         md = context.smoke
         rd = context.scene.render
-        return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine)
+        return md and (md.smoke_type == 'DOMAIN') and (rd.engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -330,12 +337,13 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Field Weights"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Field Weights"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         md = context.smoke
         rd = context.scene.render
 
     @classmethod
     def poll(cls, context):
         md = context.smoke
         rd = context.scene.render
-        return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine)
+        return md and (md.smoke_type == 'DOMAIN') and (rd.engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         domain = context.smoke.domain_settings
 
     def draw(self, context):
         domain = context.smoke.domain_settings
index e74cac3d06bb2a02d6dc4b589ce0f5291aeac5b2..c96f455a10581fe277f4ccfe7ffed4f498d2d2b9 100644 (file)
@@ -39,11 +39,12 @@ class PhysicButtonsPanel:
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
-        return (ob and (ob.type == 'MESH' or ob.type == 'LATTICE'or ob.type == 'CURVE')) and (not rd.use_game_engine) and (context.soft_body)
+        return (ob and (ob.type == 'MESH' or ob.type == 'LATTICE'or ob.type == 'CURVE')) and (rd.engine in cls.COMPAT_ENGINES) and (context.soft_body)
 
 
 class PHYSICS_PT_softbody(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body"
 
 
 class PHYSICS_PT_softbody(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -71,6 +72,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_softbody_cache(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Cache"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_softbody_cache(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Cache"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         md = context.soft_body
 
     def draw(self, context):
         md = context.soft_body
@@ -80,6 +82,7 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Goal"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Goal"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw_header(self, context):
         softbody = context.soft_body.settings
 
     def draw_header(self, context):
         softbody = context.soft_body.settings
@@ -119,6 +122,7 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Edges"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Edges"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw_header(self, context):
         softbody = context.soft_body.settings
 
     def draw_header(self, context):
         softbody = context.soft_body.settings
@@ -168,6 +172,7 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Self Collision"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Self Collision"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw_header(self, context):
         softbody = context.soft_body.settings
 
     def draw_header(self, context):
         softbody = context.soft_body.settings
@@ -196,6 +201,7 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Solver"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Solver"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -228,6 +234,7 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Field Weights"
     bl_options = {'DEFAULT_CLOSED'}
 class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Field Weights"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         md = context.soft_body
 
     def draw(self, context):
         md = context.soft_body
index 2c8a6fac967d23b03d41d5921e06939405b272eb..e07349a99eed27606de69479cd192f08c0702afa 100644 (file)
@@ -41,7 +41,7 @@ class WORLD_PT_context_world(WorldButtonsPanel, Panel):
     @classmethod
     def poll(cls, context):
         rd = context.scene.render
     @classmethod
     def poll(cls, context):
         rd = context.scene.render
-        return (not rd.use_game_engine) and (rd.engine in cls.COMPAT_ENGINES)
+        return rd.engine in cls.COMPAT_ENGINES
 
     def draw(self, context):
         layout = self.layout
 
     def draw(self, context):
         layout = self.layout
@@ -69,7 +69,7 @@ class WORLD_PT_preview(WorldButtonsPanel, Panel):
     @classmethod
     def poll(cls, context):
         rd = context.scene.render
     @classmethod
     def poll(cls, context):
         rd = context.scene.render
-        return (context.world) and (not rd.use_game_engine) and (rd.engine in cls.COMPAT_ENGINES)
+        return (context.world) and (rd.engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         self.layout.template_preview(context.world)
 
     def draw(self, context):
         self.layout.template_preview(context.world)