Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game Debug UI #1204

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 76 additions & 26 deletions release/scripts/startup/bl_ui/properties_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,15 @@ def draw_header(self, context):

def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False

game = context.active_object.game

layout.active = game.use_obstacle_create

row = layout.row()
row.prop(game, "obstacle_radius", text="Radius")
row.label()


class RenderButtonsPanel:
Expand Down Expand Up @@ -425,49 +426,93 @@ def draw(self, context):

layout.operator("mesh.navmesh_make", text="Build Navigation Mesh")

col = layout.column()
col.label(text="Rasterization:")
row = col.row()
row.prop(rd, "cell_size")
row.prop(rd, "cell_height")
class SCENE_PT_rasterization(SceneButtonsPanel, Panel):
bl_label = "Rasterization"
bl_parent_id = "SCENE_PT_game_navmesh"
COMPAT_ENGINES = {'BLENDER_GAME', 'BLENDER_EEVEE'}

def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False

rd = context.scene.game_settings.recast_data

col = layout.column()
col.label(text="Agent:")
split = col.split()
col.prop(rd, "cell_size")
col.prop(rd, "cell_height")

col = split.column()
class SCENE_PT_agent(SceneButtonsPanel, Panel):
bl_label = "Agent"
bl_parent_id = "SCENE_PT_game_navmesh"
COMPAT_ENGINES = {'BLENDER_GAME', 'BLENDER_EEVEE'}

def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False

rd = context.scene.game_settings.recast_data

col = layout.column()
col.prop(rd, "agent_height", text="Height")
col.prop(rd, "agent_radius", text="Radius")

col = split.column()
col.prop(rd, "slope_max")
col.prop(rd, "climb_max")

col = layout.column()
col.label(text="Region:")
row = col.row()
row.prop(rd, "region_min_size")
if rd.partitioning != 'LAYERS':
row.prop(rd, "region_merge_size")
class SCENE_PT_region(SceneButtonsPanel, Panel):
bl_label = "Region"
bl_options = {'DEFAULT_CLOSED'}
bl_parent_id = "SCENE_PT_game_navmesh"
COMPAT_ENGINES = {'BLENDER_GAME', 'BLENDER_EEVEE'}

def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False

rd = context.scene.game_settings.recast_data

col = layout.column()
col.prop(rd, "region_min_size")
if rd.partitioning != 'LAYERS':
col.prop(rd, "region_merge_size")
col.prop(rd, "partitioning")

col = layout.column()
col.label(text="Polygonization:")
split = col.split()
class SCENE_PT_polygonization(SceneButtonsPanel, Panel):
bl_label = "Polygonization"
bl_options = {'DEFAULT_CLOSED'}
bl_parent_id = "SCENE_PT_game_navmesh"
COMPAT_ENGINES = {'BLENDER_GAME', 'BLENDER_EEVEE'}

col = split.column()
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False

rd = context.scene.game_settings.recast_data

col = layout.column()
col.prop(rd, "edge_max_len")
col.prop(rd, "edge_max_error")
col.prop(rd, "verts_per_poly")

class SCENE_PT_detail_mesh(SceneButtonsPanel, Panel):
bl_label = "Detail Mesh"
bl_options = {'DEFAULT_CLOSED'}
bl_parent_id = "SCENE_PT_game_navmesh"
COMPAT_ENGINES = {'BLENDER_GAME', 'BLENDER_EEVEE'}

split.prop(rd, "verts_per_poly")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False

rd = context.scene.game_settings.recast_data

col = layout.column()
col.label(text="Detail Mesh:")
row = col.row()
row.prop(rd, "sample_dist")
row.prop(rd, "sample_max_error")
col.prop(rd, "sample_dist")
col.prop(rd, "sample_max_error")


class SCENE_PT_game_hysteresis(SceneButtonsPanel, Panel):
Expand Down Expand Up @@ -588,6 +633,11 @@ def draw(self, context):
SCENE_PT_game_physics,
SCENE_PT_game_physics_obstacles,
SCENE_PT_game_navmesh,
SCENE_PT_rasterization,
SCENE_PT_agent,
SCENE_PT_region,
SCENE_PT_polygonization,
SCENE_PT_detail_mesh,
SCENE_PT_game_hysteresis,
SCENE_PT_game_console,
OBJECT_MT_lod_tools,
Expand Down
16 changes: 8 additions & 8 deletions release/scripts/startup/bl_ui/properties_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ def draw(self, context):
row.label(text="Exit Key")
row.prop(gs, "exit_key", text="", event=True)

flow = layout.column_flow()
flow.prop(gs, "show_debug_properties", text="Debug Properties")
flow.prop(gs, "show_framerate_profile", text="Framerate and Profile")
flow.prop(gs, "show_physics_visualization", text="Physics Visualization")
flow.prop(gs, "use_deprecation_warnings")
flow.prop(gs, "show_mouse", text="Mouse Cursor")
flow.prop(gs, "use_undo", text="Undo at exit")
flow.prop(gs, "use_ui_anti_flicker", text="No UI flickering")
col = layout.column()
col.prop(gs, "show_debug_properties", text="Debug Properties")
col.prop(gs, "show_framerate_profile", text="Framerate and Profile")
col.prop(gs, "show_physics_visualization", text="Physics Visualization")
col.prop(gs, "use_deprecation_warnings")
col.prop(gs, "show_mouse", text="Mouse Cursor")
col.prop(gs, "use_undo", text="Undo at exit")
col.prop(gs, "use_ui_anti_flicker", text="No UI flickering")

class RENDER_PT_color_management(RenderButtonsPanel, Panel):
bl_label = "Color Management"
Expand Down