Skip to content

Commit

Permalink
UPBGE: Make game specific options available in more engines
Browse files Browse the repository at this point in the history
Note that all options can not be working in some engines.
  • Loading branch information
youle31 committed Jul 6, 2023
1 parent f98f7ed commit 17c8370
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 14 deletions.
7 changes: 6 additions & 1 deletion scripts/startup/bl_ui/properties_data_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ def draw(self, context):
class DATA_PT_game_camera_settings(CameraButtonsPanel, Panel):
bl_label = "Game Camera Settings"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
COMPAT_ENGINES = {
'BLENDER_RENDER',
'BLENDER_EEVEE',
'BLENDER_EEVEE_NEXT',
'BLENDER_WORKBENCH',
'BLENDER_WORKBENCH_NEXT'}

def draw(self, context):
layout = self.layout
Expand Down
70 changes: 60 additions & 10 deletions scripts/startup/bl_ui/properties_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ class PhysicsButtonsPanel:

class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
bl_label = "Game Physics"
COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
COMPAT_ENGINES = {
'BLENDER_RENDER',
'BLENDER_EEVEE',
'BLENDER_EEVEE_NEXT',
'BLENDER_WORKBENCH',
'BLENDER_WORKBENCH_NEXT'}

@classmethod
def poll(cls, context):
Expand Down Expand Up @@ -453,7 +458,12 @@ def draw(self, context):

class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel):
bl_label = "Collision Bounds"
COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
COMPAT_ENGINES = {
'BLENDER_RENDER',
'BLENDER_EEVEE',
'BLENDER_EEVEE_NEXT',
'BLENDER_WORKBENCH',
'BLENDER_WORKBENCH_NEXT'}

@classmethod
def poll(cls, context):
Expand Down Expand Up @@ -493,7 +503,12 @@ def draw(self, context):

class PHYSICS_PT_game_obstacles(PhysicsButtonsPanel, Panel):
bl_label = "Create Obstacle"
COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
COMPAT_ENGINES = {
'BLENDER_RENDER',
'BLENDER_EEVEE',
'BLENDER_EEVEE_NEXT',
'BLENDER_WORKBENCH',
'BLENDER_WORKBENCH_NEXT'}

@classmethod
def poll(cls, context):
Expand Down Expand Up @@ -536,7 +551,12 @@ class SceneButtonsPanel:

class SCENE_PT_game_physics(SceneButtonsPanel, Panel):
bl_label = "Game Physics"
COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
COMPAT_ENGINES = {
'BLENDER_RENDER',
'BLENDER_EEVEE',
'BLENDER_EEVEE_NEXT',
'BLENDER_WORKBENCH',
'BLENDER_WORKBENCH_NEXT'}

@classmethod
def poll(cls, context):
Expand Down Expand Up @@ -603,7 +623,12 @@ def draw(self, context):
class SCENE_PT_game_physics_obstacles(SceneButtonsPanel, Panel):
bl_label = "Obstacle Simulation"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
COMPAT_ENGINES = {
'BLENDER_RENDER',
'BLENDER_EEVEE',
'BLENDER_EEVEE_NEXT',
'BLENDER_WORKBENCH',
'BLENDER_WORKBENCH_NEXT'}

@classmethod
def poll(cls, context):
Expand All @@ -624,7 +649,12 @@ def draw(self, context):
class SCENE_PT_game_navmesh(SceneButtonsPanel, Panel):
bl_label = "Navigation Mesh"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
COMPAT_ENGINES = {
'BLENDER_RENDER',
'BLENDER_EEVEE',
'BLENDER_EEVEE_NEXT',
'BLENDER_WORKBENCH',
'BLENDER_WORKBENCH_NEXT'}

@classmethod
def poll(cls, context):
Expand Down Expand Up @@ -685,7 +715,12 @@ def draw(self, context):

class SCENE_PT_game_hysteresis(SceneButtonsPanel, Panel):
bl_label = "Level of Detail"
COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
COMPAT_ENGINES = {
'BLENDER_RENDER',
'BLENDER_EEVEE',
'BLENDER_EEVEE_NEXT',
'BLENDER_WORKBENCH',
'BLENDER_WORKBENCH_NEXT'}

@classmethod
def poll(cls, context):
Expand All @@ -705,7 +740,12 @@ def draw(self, context):
class SCENE_PT_game_console(SceneButtonsPanel, Panel):
bl_label = "Game Python Console"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_EEVEE'}
COMPAT_ENGINES = {
'BLENDER_RENDER',
'BLENDER_EEVEE',
'BLENDER_EEVEE_NEXT',
'BLENDER_WORKBENCH',
'BLENDER_WORKBENCH_NEXT'}

@classmethod
def poll(cls, context):
Expand Down Expand Up @@ -742,7 +782,12 @@ class ObjectButtonsPanel:

class OBJECT_PT_activity_culling(ObjectButtonsPanel, Panel):
bl_label = "Activity Culling"
COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
COMPAT_ENGINES = {
'BLENDER_RENDER',
'BLENDER_EEVEE',
'BLENDER_EEVEE_NEXT',
'BLENDER_WORKBENCH',
'BLENDER_WORKBENCH_NEXT'}

@classmethod
def poll(cls, context):
Expand Down Expand Up @@ -780,7 +825,12 @@ def draw(self, context):

class OBJECT_PT_levels_of_detail(ObjectButtonsPanel, Panel):
bl_label = "Levels of Detail"
COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
COMPAT_ENGINES = {
'BLENDER_RENDER',
'BLENDER_EEVEE',
'BLENDER_EEVEE_NEXT',
'BLENDER_WORKBENCH',
'BLENDER_WORKBENCH_NEXT'}

@classmethod
def poll(cls, context):
Expand Down
2 changes: 1 addition & 1 deletion scripts/startup/bl_ui/properties_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, Panel):
classes = (
OBJECT_PT_context_object,
OBJECT_PT_transform,
OBJECT_PT_transform_game, # Game engine transition
OBJECT_PT_transform_game, # UPBGE
OBJECT_PT_delta_transform,
OBJECT_PT_relations,
COLLECTION_MT_context_menu,
Expand Down
14 changes: 12 additions & 2 deletions scripts/startup/bl_ui/properties_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ def draw(self, context):

class RENDER_PT_game_resolution(RenderButtonsPanel, Panel):
bl_label = "Game Resolution"
COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH', 'BLENDER_EEVEE_NEXT'}
COMPAT_ENGINES = {
'BLENDER_RENDER',
'BLENDER_EEVEE',
'BLENDER_EEVEE_NEXT',
'BLENDER_WORKBENCH',
'BLENDER_WORKBENCH_NEXT'}

def draw(self, context):
import sys
Expand Down Expand Up @@ -89,7 +94,12 @@ def draw(self, context):

class RENDER_PT_game_debug(RenderButtonsPanel, Panel):
bl_label = "Game Debug"
COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH', 'BLENDER_EEVEE_NEXT'}
COMPAT_ENGINES = {
'BLENDER_RENDER',
'BLENDER_EEVEE',
'BLENDER_EEVEE_NEXT',
'BLENDER_WORKBENCH',
'BLENDER_WORKBENCH_NEXT'}

def draw(self, context):
layout = self.layout
Expand Down

0 comments on commit 17c8370

Please sign in to comment.