2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-07-20 20:28:29 +00:00
|
|
|
import bpy
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-05-16 10:21:00 +00:00
|
|
|
narrowui = bpy.context.user_preferences.view.properties_width_check
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
class PhysicsButtonsPanel(bpy.types.Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "physics"
|
2009-07-20 20:28:29 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def poll(self, context):
|
|
|
|
ob = context.active_object
|
2010-02-23 12:48:35 +00:00
|
|
|
rd = context.scene.render
|
2010-06-10 23:53:13 +00:00
|
|
|
return ob and ob.game and (rd.engine in self.COMPAT_ENGINES)
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Physics"
|
2010-06-10 23:53:13 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.active_object
|
|
|
|
game = ob.game
|
|
|
|
soft = ob.game.soft_body
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(game, "physics_type")
|
2009-11-14 23:24:15 +00:00
|
|
|
else:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(game, "physics_type", text="")
|
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
#if game.physics_type == 'DYNAMIC':
|
|
|
|
if game.physics_type in ('DYNAMIC', 'RIGID_BODY'):
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(game, "actor")
|
|
|
|
col.prop(game, "ghost")
|
|
|
|
col.prop(ob, "restrict_render", text="Invisible") # out of place but useful
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(game, "material_physics")
|
|
|
|
col.prop(game, "rotate_from_normal")
|
|
|
|
col.prop(game, "no_sleeping")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Attributes:")
|
|
|
|
col.prop(game, "mass")
|
|
|
|
col.prop(game, "radius")
|
|
|
|
col.prop(game, "form_factor")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = (game.physics_type == 'RIGID_BODY')
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(game, "anisotropic_friction")
|
2009-10-31 19:31:45 +00:00
|
|
|
subsub = sub.column()
|
|
|
|
subsub.active = game.anisotropic_friction
|
2009-11-23 00:27:30 +00:00
|
|
|
subsub.prop(game, "friction_coefficients", text="", slider=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Velocity:")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(game, "minimum_velocity", text="Minimum")
|
|
|
|
sub.prop(game, "maximum_velocity", text="Maximum")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Damping:")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(game, "damping", text="Translation", slider=True)
|
|
|
|
sub.prop(game, "rotation_damping", text="Rotation", slider=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Lock Translation:")
|
|
|
|
col.prop(game, "lock_x_axis", text="X")
|
|
|
|
col.prop(game, "lock_y_axis", text="Y")
|
|
|
|
col.prop(game, "lock_z_axis", text="Z")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Lock Rotation:")
|
|
|
|
col.prop(game, "lock_x_rot_axis", text="X")
|
|
|
|
col.prop(game, "lock_y_rot_axis", text="Y")
|
|
|
|
col.prop(game, "lock_z_rot_axis", text="Z")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
elif game.physics_type == 'SOFT_BODY':
|
|
|
|
col = layout.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(game, "actor")
|
|
|
|
col.prop(game, "ghost")
|
|
|
|
col.prop(ob, "restrict_render", text="Invisible")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Attributes:")
|
|
|
|
col.prop(game, "mass")
|
|
|
|
col.prop(soft, "welding")
|
|
|
|
col.prop(soft, "position_iterations")
|
|
|
|
col.prop(soft, "linstiff", slider=True)
|
|
|
|
col.prop(soft, "dynamic_friction", slider=True)
|
|
|
|
col.prop(soft, "margin", slider=True)
|
|
|
|
col.prop(soft, "bending_const", text="Bending Constraints")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(soft, "shape_match")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = soft.shape_match
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(soft, "threshold", slider=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Cluster Collision:")
|
|
|
|
col.prop(soft, "cluster_rigid_to_softbody")
|
|
|
|
col.prop(soft, "cluster_soft_to_softbody")
|
2009-10-31 23:35:56 +00:00
|
|
|
sub = col.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
sub.active = (soft.cluster_rigid_to_softbody or soft.cluster_soft_to_softbody)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(soft, "cluster_iterations", text="Iterations")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
elif game.physics_type == 'STATIC':
|
|
|
|
col = layout.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(game, "actor")
|
|
|
|
col.prop(game, "ghost")
|
|
|
|
col.prop(ob, "restrict_render", text="Invisible")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'):
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(ob, "restrict_render", text="Invisible")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Collision Bounds"
|
2010-06-10 23:53:13 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
game = context.object.game
|
2010-02-23 12:48:35 +00:00
|
|
|
rd = context.scene.render
|
2010-06-10 23:53:13 +00:00
|
|
|
return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine in self.COMPAT_ENGINES)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
game = context.active_object.game
|
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
self.layout.prop(game, "use_collision_bounds", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
game = context.active_object.game
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
layout.active = game.use_collision_bounds
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(game, "collision_bounds", text="Bounds")
|
2009-11-14 23:24:15 +00:00
|
|
|
else:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(game, "collision_bounds", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
split = layout.split()
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(game, "collision_margin", text="Margin", slider=True)
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(game, "collision_compound", text="Compound")
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-07-20 20:28:29 +00:00
|
|
|
|
2009-10-16 19:25:51 +00:00
|
|
|
class RenderButtonsPanel(bpy.types.Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "render"
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def poll(self, context):
|
2010-02-23 12:48:35 +00:00
|
|
|
rd = context.scene.render
|
2010-06-10 23:53:13 +00:00
|
|
|
return (rd.engine in self.COMPAT_ENGINES)
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-16 19:25:51 +00:00
|
|
|
class RENDER_PT_game(RenderButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Game"
|
2010-06-10 23:53:13 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_GAME'}
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
row = layout.row()
|
2009-11-23 00:27:30 +00:00
|
|
|
row.operator("view3d.game_start", text="Start")
|
|
|
|
row.label()
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-16 19:25:51 +00:00
|
|
|
class RENDER_PT_game_player(RenderButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Standalone Player"
|
2010-06-10 23:53:13 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
gs = context.scene.game_data
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(gs, "fullscreen")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Resolution:")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(gs, "resolution_x", slider=False, text="X")
|
|
|
|
sub.prop(gs, "resolution_y", slider=False, text="Y")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Quality:")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(gs, "depth", text="Bit Depth", slider=False)
|
|
|
|
sub.prop(gs, "frequency", text="FPS", slider=False)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
# framing:
|
|
|
|
col = layout.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Framing:")
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-23 00:27:30 +00:00
|
|
|
col.row().prop(gs, "framing_type", expand=True)
|
2009-11-14 23:24:15 +00:00
|
|
|
else:
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(gs, "framing_type", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
if gs.framing_type == 'LETTERBOX':
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(gs, "framing_color", text="")
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-16 19:25:51 +00:00
|
|
|
class RENDER_PT_game_stereo(RenderButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Stereo"
|
2010-06-10 23:53:13 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
gs = context.scene.game_data
|
|
|
|
stereo_mode = gs.stereo
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
# stereo options:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(gs, "stereo", expand=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
# stereo:
|
|
|
|
if stereo_mode == 'STEREO':
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(gs, "stereo_mode")
|
2009-12-29 15:47:20 +00:00
|
|
|
layout.prop(gs, "eye_separation")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
# dome:
|
|
|
|
elif stereo_mode == 'DOME':
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(gs, "dome_mode", text="Dome Type")
|
2009-11-14 23:24:15 +00:00
|
|
|
else:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(gs, "dome_mode", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
dome_type = gs.dome_mode
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
split = layout.split()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if dome_type == 'FISHEYE' or \
|
|
|
|
dome_type == 'TRUNCATED_REAR' or \
|
|
|
|
dome_type == 'TRUNCATED_FRONT':
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
|
|
|
|
col.prop(gs, "dome_angle", slider=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(gs, "dome_tesselation", text="Tesselation")
|
|
|
|
col.prop(gs, "dome_tilt")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
elif dome_type == 'PANORAM_SPH':
|
2009-10-31 23:35:56 +00:00
|
|
|
col = split.column()
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(gs, "dome_tesselation", text="Tesselation")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
else: # cube map
|
2009-10-31 23:35:56 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(gs, "dome_text")
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-16 19:25:51 +00:00
|
|
|
class RENDER_PT_game_shading(RenderButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Shading"
|
2010-06-10 23:53:13 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
gs = context.scene.game_data
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(gs, "material_mode", expand=True)
|
2009-11-14 23:24:15 +00:00
|
|
|
else:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(gs, "material_mode", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if gs.material_mode == 'GLSL':
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(gs, "glsl_lights", text="Lights")
|
|
|
|
col.prop(gs, "glsl_shaders", text="Shaders")
|
|
|
|
col.prop(gs, "glsl_shadows", text="Shadows")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(gs, "glsl_ramps", text="Ramps")
|
|
|
|
col.prop(gs, "glsl_nodes", text="Nodes")
|
|
|
|
col.prop(gs, "glsl_extra_textures", text="Extra Textures")
|
2009-08-18 15:27:48 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-16 19:25:51 +00:00
|
|
|
class RENDER_PT_game_performance(RenderButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Performance"
|
2010-06-10 23:53:13 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
gs = context.scene.game_data
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Show:")
|
|
|
|
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")
|
2010-02-22 12:25:58 +00:00
|
|
|
col.prop(gs, "use_deprecation_warnings")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Render:")
|
2010-02-22 12:25:58 +00:00
|
|
|
col.prop(gs, "use_frame_rate")
|
|
|
|
col.prop(gs, "use_display_lists")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-16 19:25:51 +00:00
|
|
|
class RENDER_PT_game_sound(RenderButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Sound"
|
2010-06-10 23:53:13 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_GAME'}
|
2009-09-20 18:49:46 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-09-20 18:49:46 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
scene = context.scene
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(scene, "distance_model")
|
2009-11-14 23:24:15 +00:00
|
|
|
else:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(scene, "distance_model", text="")
|
|
|
|
layout.prop(scene, "speed_of_sound", text="Speed")
|
|
|
|
layout.prop(scene, "doppler_factor")
|
2009-08-18 15:27:48 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
class WorldButtonsPanel(bpy.types.Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "world"
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def poll(self, context):
|
2010-02-22 14:04:04 +00:00
|
|
|
scene = context.scene
|
2010-06-10 23:53:13 +00:00
|
|
|
return (scene.render.engine in self.COMPAT_ENGINES) and (scene.world is not None)
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
class WORLD_PT_game_context_world(WorldButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = ""
|
|
|
|
bl_show_header = False
|
2010-06-10 23:53:13 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
2010-02-23 12:48:35 +00:00
|
|
|
rd = context.scene.render
|
2009-10-31 19:31:45 +00:00
|
|
|
return (context.scene) and (rd.use_game_engine)
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
scene = context.scene
|
|
|
|
world = context.world
|
|
|
|
space = context.space_data
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-11-14 23:24:15 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-14 23:24:15 +00:00
|
|
|
split = layout.split(percentage=0.65)
|
|
|
|
if scene:
|
|
|
|
split.template_ID(scene, "world", new="world.new")
|
|
|
|
elif world:
|
|
|
|
split.template_ID(space, "pin_id")
|
2009-11-21 00:05:43 +00:00
|
|
|
else:
|
2009-11-14 23:24:15 +00:00
|
|
|
if scene:
|
|
|
|
layout.template_ID(scene, "world", new="world.new")
|
|
|
|
elif world:
|
|
|
|
layout.template_ID(space, "pin_id")
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
class WORLD_PT_game_world(WorldButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "World"
|
2010-06-10 23:53:13 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_GAME'}
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
world = context.world
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
split = layout.split()
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(world, "horizon_color")
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(world, "ambient_color")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
class WORLD_PT_game_mist(WorldButtonsPanel):
|
|
|
|
bl_label = "Mist"
|
2010-06-10 23:53:13 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_GAME'}
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
def draw_header(self, context):
|
|
|
|
world = context.world
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2010-06-11 09:09:57 +00:00
|
|
|
self.layout.prop(world.mist, "use_mist", text="")
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
world = context.world
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2010-06-11 09:09:57 +00:00
|
|
|
layout.active = world.mist.use_mist
|
2009-11-14 23:24:15 +00:00
|
|
|
split = layout.split()
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(world.mist, "start")
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(world.mist, "depth")
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
class WORLD_PT_game_physics(WorldButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Physics"
|
2010-06-10 23:53:13 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
gs = context.scene.game_data
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(gs, "physics_engine")
|
2009-10-31 19:31:45 +00:00
|
|
|
if gs.physics_engine != 'NONE':
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(gs, "physics_gravity", text="Gravity")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Physics Steps:")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(gs, "physics_step_max", text="Max")
|
|
|
|
sub.prop(gs, "physics_step_sub", text="Substeps")
|
|
|
|
col.prop(gs, "fps", text="FPS")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-14 23:24:15 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Logic Steps:")
|
|
|
|
col.prop(gs, "logic_step_max", text="Max")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = layout.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(gs, "use_occlusion_culling", text="Occlusion Culling")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = gs.use_occlusion_culling
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(gs, "occlusion_culling_resolution", text="Resolution")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
else:
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Physics Steps:")
|
|
|
|
col.prop(gs, "fps", text="FPS")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Logic Steps:")
|
|
|
|
col.prop(gs, "logic_step_max", text="Max")
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
|
|
|
|
classes = [
|
|
|
|
PHYSICS_PT_game_physics,
|
|
|
|
PHYSICS_PT_game_collision_bounds,
|
|
|
|
|
|
|
|
RENDER_PT_game,
|
|
|
|
RENDER_PT_game_player,
|
|
|
|
RENDER_PT_game_stereo,
|
|
|
|
RENDER_PT_game_shading,
|
|
|
|
RENDER_PT_game_performance,
|
|
|
|
RENDER_PT_game_sound,
|
|
|
|
|
|
|
|
WORLD_PT_game_context_world,
|
|
|
|
WORLD_PT_game_world,
|
|
|
|
WORLD_PT_game_mist,
|
|
|
|
WORLD_PT_game_physics]
|
|
|
|
|
|
|
|
|
|
|
|
def register():
|
|
|
|
register = bpy.types.register
|
|
|
|
for cls in classes:
|
|
|
|
register(cls)
|
|
|
|
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
def unregister():
|
|
|
|
unregister = bpy.types.unregister
|
|
|
|
for cls in classes:
|
|
|
|
unregister(cls)
|
2010-02-16 09:55:07 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
register()
|