diff options
Diffstat (limited to 'release/scripts/startup')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_modifier.py | 4 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_game.py | 106 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_physics_fluid.py | 2 |
3 files changed, 111 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index b49f9adc4cf..294d2c7adcd 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -383,6 +383,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.label(text="Mirror Object:") col.prop(md, "mirror_object", text="") + def NAVMESH(self, layout, ob, md): + layout.operator("object.assign_navpolygon") + layout.operator("object.assign_new_navpolygon") + def MULTIRES(self, layout, ob, md): layout.row().prop(md, "subdivision_type", expand=True) diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index 5ea55d82471..b06876637f7 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -195,6 +195,31 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel): row.prop(game, "collision_margin", text="Margin", slider=True) row.prop(game, "use_collision_compound", text="Compound") +class PHYSICS_PT_game_obstacles(PhysicsButtonsPanel, Panel): + bl_label = "Create Obstacle" + COMPAT_ENGINES = {'BLENDER_GAME'} + + @classmethod + def poll(cls, context): + game = context.object.game + rd = context.scene.render + return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine in cls.COMPAT_ENGINES) + + def draw_header(self, context): + game = context.active_object.game + + self.layout.prop(game, "create_obstacle", text="") + + def draw(self, context): + layout = self.layout + + game = context.active_object.game + + layout.active = game.create_obstacle + + row = layout.row() + row.prop(game, "obstacle_radius", text="Radius") + row.label() class RenderButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -362,6 +387,68 @@ class RENDER_PT_game_display(RenderButtonsPanel, Panel): flow.prop(gs, "show_physics_visualization", text="Physics Visualization") flow.prop(gs, "use_deprecation_warnings") flow.prop(gs, "show_mouse", text="Mouse Cursor") + +class SceneButtonsPanel(): + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "scene" + +class SCENE_PT_game_navmesh(SceneButtonsPanel, bpy.types.Panel): + bl_label = "Navigation mesh" + bl_default_closed = True + COMPAT_ENGINES = {'BLENDER_GAME'} + + @classmethod + def poll(cls, context): + scene = context.scene + return (scene and scene.render.engine in cls.COMPAT_ENGINES) + + def draw(self, context): + layout = self.layout + + rd = context.scene.game_settings.recast_data + + layout.operator("object.create_navmesh", text='Build navigation mesh') + + col = layout.column() + col.label(text="Rasterization:") + row = col.row() + row.prop(rd, "cell_size") + row.prop(rd, "cell_height") + + col = layout.column() + col.label(text="Agent:") + split = col.split() + + col = split.column() + col.prop(rd, "agent_height", text="Height") + col.prop(rd, "agent_radius", text="Radius") + + col = split.column() + col.prop(rd, "max_slope") + col.prop(rd, "max_climb") + + col = layout.column() + col.label(text="Region:") + row = col.row() + row.prop(rd, "region_min_size") + row.prop(rd, "region_merge_size") + + col = layout.column() + col.label(text="Polygonization:") + split = col.split() + + col = split.column() + col.prop(rd, "edge_max_len") + col.prop(rd, "edge_max_error") + + split.prop(rd, "verts_per_poly") + + col = layout.column() + col.label(text="Detail Mesh:") + row = col.row() + row.prop(rd, "sample_dist") + row.prop(rd, "sample_max_error") class WorldButtonsPanel(): @@ -487,5 +574,24 @@ class WORLD_PT_game_physics(WorldButtonsPanel, Panel): col.label(text="Logic Steps:") col.prop(gs, "logic_step_max", text="Max") +class WORLD_PT_game_physics_obstacles(WorldButtonsPanel, Panel): + bl_label = "Obstacle simulation" + COMPAT_ENGINES = {'BLENDER_GAME'} + + @classmethod + def poll(cls, context): + scene = context.scene + return (scene.world and scene.render.engine in cls.COMPAT_ENGINES) + + def draw(self, context): + layout = self.layout + + gs = context.scene.game_settings + + layout.prop(gs, "obstacle_simulation", text = "Type") + if gs.obstacle_simulation != 'NONE': + layout.prop(gs, "level_height") + layout.prop(gs, "show_obstacle_simulation") + if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py index 46893af3582..55629e6c6b9 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py @@ -46,7 +46,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel): row = layout.row() if fluid is None: - row.label("built without fluids") + row.label("Built without fluids") return row.prop(fluid, "type") |