diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index 611b69229f9d..4bb55d6325d3 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -307,6 +307,8 @@ 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 @@ -314,7 +316,6 @@ def draw(self, context): row = layout.row() row.prop(game, "obstacle_radius", text="Radius") - row.label() class RenderButtonsPanel: @@ -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): @@ -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, diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index 43098d1bade5..640bb54753a9 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -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"