Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_game.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_game.py106
1 files changed, 106 insertions, 0 deletions
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__)