2009-07-20 20:28:29 +00:00
|
|
|
|
|
|
|
import bpy
|
|
|
|
|
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-08-22 08:48:01 +00:00
|
|
|
__space_type__ = 'PROPERTIES'
|
|
|
|
__region_type__ = 'WINDOW'
|
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
|
|
|
__context__ = "physics"
|
2009-07-20 20:28:29 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
ob = context.active_object
|
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
|
|
|
rd = context.scene.render_data
|
|
|
|
return ob and ob.game and (rd.engine == 'BLENDER_GAME')
|
|
|
|
|
|
|
|
class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
|
|
|
|
__label__ = "Physics"
|
2009-07-20 20:28:29 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
ob = context.active_object
|
2009-07-20 20:28:29 +00:00
|
|
|
game = ob.game
|
2009-08-12 22:16:47 +00:00
|
|
|
soft = ob.game.soft_body
|
2009-07-20 20:28:29 +00:00
|
|
|
|
2009-07-20 21:31:32 +00:00
|
|
|
layout.itemR(game, "physics_type")
|
|
|
|
layout.itemS()
|
2009-07-20 20:28:29 +00:00
|
|
|
|
2009-08-12 22:16:47 +00:00
|
|
|
#if game.physics_type == 'DYNAMIC':
|
|
|
|
if game.physics_type in ('DYNAMIC', 'RIGID_BODY'):
|
2009-07-20 20:28:29 +00:00
|
|
|
|
2009-08-12 22:16:47 +00:00
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(game, "actor")
|
|
|
|
col.itemR(game, "ghost")
|
|
|
|
col.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
|
|
|
|
|
|
|
|
col = split.column()
|
2009-08-16 09:47:33 +00:00
|
|
|
col.itemR(game, "material_physics")
|
|
|
|
col.itemR(game, "rotate_from_normal")
|
2009-08-12 22:16:47 +00:00
|
|
|
col.itemR(game, "no_sleeping")
|
|
|
|
|
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Attributes:")
|
2009-09-01 00:33:39 +00:00
|
|
|
col.itemR(game, "mass")
|
|
|
|
col.itemR(game, "radius")
|
|
|
|
col.itemR(game, "form_factor")
|
2009-08-12 22:16:47 +00:00
|
|
|
|
2009-08-16 09:47:33 +00:00
|
|
|
col = split.column()
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = (game.physics_type == 'RIGID_BODY')
|
|
|
|
sub.itemR(game, "anisotropic_friction")
|
|
|
|
subsub = sub.column()
|
|
|
|
subsub.active = game.anisotropic_friction
|
|
|
|
subsub.itemR(game, "friction_coefficients", text="", slider=True)
|
2009-08-12 22:16:47 +00:00
|
|
|
|
2009-08-16 09:47:33 +00:00
|
|
|
split = layout.split()
|
2009-08-12 22:16:47 +00:00
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Velocity:")
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.itemR(game, "minimum_velocity", text="Minimum")
|
|
|
|
sub.itemR(game, "maximum_velocity", text="Maximum")
|
|
|
|
|
2009-08-16 09:47:33 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Damping:")
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.itemR(game, "damping", text="Translation", slider=True)
|
|
|
|
sub.itemR(game, "rotation_damping", text="Rotation", slider=True)
|
2009-08-12 22:16:47 +00:00
|
|
|
|
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Lock Translation:")
|
|
|
|
col.itemR(game, "lock_x_axis", text="X")
|
|
|
|
col.itemR(game, "lock_y_axis", text="Y")
|
|
|
|
col.itemR(game, "lock_z_axis", text="Z")
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Lock Rotation:")
|
|
|
|
col.itemR(game, "lock_x_rot_axis", text="X")
|
|
|
|
col.itemR(game, "lock_y_rot_axis", text="Y")
|
|
|
|
col.itemR(game, "lock_z_rot_axis", text="Z")
|
|
|
|
|
|
|
|
elif game.physics_type == 'SOFT_BODY':
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.itemR(game, "actor")
|
|
|
|
col.itemR(game, "ghost")
|
|
|
|
col.itemR(ob, "restrict_render", text="Invisible")
|
|
|
|
|
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Attributes:")
|
|
|
|
col.itemR(game, "mass")
|
|
|
|
col.itemR(soft, "welding")
|
|
|
|
col.itemR(soft, "position_iterations")
|
|
|
|
col.itemR(soft, "linstiff", slider=True)
|
|
|
|
col.itemR(soft, "dynamic_friction", slider=True)
|
|
|
|
col.itemR(soft, "margin", slider=True)
|
|
|
|
col.itemR(soft, "bending_const", text="Bending Constraints")
|
2009-09-01 00:33:39 +00:00
|
|
|
|
2009-08-12 22:16:47 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(soft, "shape_match")
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = soft.shape_match
|
|
|
|
sub.itemR(soft, "threshold", slider=True)
|
|
|
|
|
|
|
|
col.itemS()
|
|
|
|
|
|
|
|
col.itemL(text="Cluster Collision:")
|
2009-08-16 09:47:33 +00:00
|
|
|
col.itemR(soft, "cluster_rigid_to_softbody")
|
|
|
|
col.itemR(soft, "cluster_soft_to_softbody")
|
2009-08-12 22:16:47 +00:00
|
|
|
sub = col.column()
|
2009-08-16 09:47:33 +00:00
|
|
|
sub.active = (soft.cluster_rigid_to_softbody or soft.cluster_soft_to_softbody)
|
2009-08-12 22:16:47 +00:00
|
|
|
sub.itemR(soft, "cluster_iterations", text="Iterations")
|
|
|
|
|
|
|
|
elif game.physics_type == 'STATIC':
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.itemR(game, "actor")
|
|
|
|
col.itemR(game, "ghost")
|
|
|
|
col.itemR(ob, "restrict_render", text="Invisible")
|
|
|
|
|
|
|
|
elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'):
|
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
layout.itemR(ob, "restrict_render", text="Invisible")
|
2009-08-12 22:16:47 +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-07-20 20:28:29 +00:00
|
|
|
__label__ = "Collision Bounds"
|
|
|
|
|
2009-08-12 22:16:47 +00:00
|
|
|
def poll(self, context):
|
2009-09-01 00:33:39 +00:00
|
|
|
game = context.object.game
|
2009-08-13 09:30:36 +00:00
|
|
|
rd = context.scene.render_data
|
|
|
|
return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine == 'BLENDER_GAME')
|
2009-08-12 22:16:47 +00:00
|
|
|
|
2009-07-20 20:28:29 +00:00
|
|
|
def draw_header(self, context):
|
2009-09-01 00:33:39 +00:00
|
|
|
game = context.active_object.game
|
2009-07-20 20:28:29 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
self.layout.itemR(game, "use_collision_bounds", text="")
|
2009-07-20 20:28:29 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
game = context.active_object.game
|
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
layout.active = game.use_collision_bounds
|
2009-07-23 14:35:20 +00:00
|
|
|
layout.itemR(game, "collision_bounds", text="Bounds")
|
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.itemR(game, "collision_compound", text="Compound")
|
|
|
|
row.itemR(game, "collision_margin", text="Margin", slider=True)
|
2009-07-20 20:28:29 +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
|
|
|
bpy.types.register(PHYSICS_PT_game_physics)
|
|
|
|
bpy.types.register(PHYSICS_PT_game_collision_bounds)
|
|
|
|
|
|
|
|
class SceneButtonsPanel(bpy.types.Panel):
|
2009-08-22 08:48:01 +00:00
|
|
|
__space_type__ = 'PROPERTIES'
|
|
|
|
__region_type__ = 'WINDOW'
|
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
|
|
|
__context__ = "scene"
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
rd = context.scene.render_data
|
|
|
|
return (rd.engine == 'BLENDER_GAME')
|
|
|
|
|
|
|
|
class SCENE_PT_game(SceneButtonsPanel):
|
|
|
|
__label__ = "Game"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemO("view3d.game_start", text="Start")
|
|
|
|
row.itemL()
|
|
|
|
|
|
|
|
class SCENE_PT_game_player(SceneButtonsPanel):
|
2009-08-18 15:27:48 +00:00
|
|
|
__label__ = "Standalone Player"
|
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
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +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
|
|
|
gs = context.scene.game_data
|
2009-07-30 10:11:19 +00:00
|
|
|
|
|
|
|
layout.itemR(gs, "fullscreen")
|
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
|
|
|
|
|
|
|
split = layout.split()
|
2009-07-30 10:11:19 +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
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Resolution:")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.itemR(gs, "resolution_x", slider=False, text="X")
|
|
|
|
sub.itemR(gs, "resolution_y", slider=False, text="Y")
|
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
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Quality:")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.itemR(gs, "depth", text="Bit Depth", slider=False)
|
|
|
|
sub.itemR(gs, "frequency", text="FPS", slider=False)
|
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
|
|
|
|
|
|
|
# framing:
|
|
|
|
col = layout.column()
|
|
|
|
col.itemL(text="Framing:")
|
|
|
|
col.row().itemR(gs, "framing_type", expand=True)
|
2009-08-18 15:27:48 +00:00
|
|
|
if gs.framing_type == 'LETTERBOX':
|
|
|
|
col.itemR(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
|
|
|
|
|
|
|
class SCENE_PT_game_stereo(SceneButtonsPanel):
|
|
|
|
__label__ = "Stereo"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +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
|
|
|
gs = context.scene.game_data
|
2009-07-30 10:11:19 +00:00
|
|
|
stereo_mode = gs.stereo
|
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
|
|
|
|
|
|
|
# stereo options:
|
2009-07-30 10:11:19 +00:00
|
|
|
layout.itemR(gs, "stereo", expand=True)
|
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
|
|
|
|
|
|
|
# stereo:
|
|
|
|
if stereo_mode == 'STEREO':
|
2009-07-30 10:11:19 +00:00
|
|
|
layout.itemR(gs, "stereo_mode")
|
2009-08-07 03:06:32 +00:00
|
|
|
layout.itemL(text="To do: Focal Length")
|
|
|
|
layout.itemL(text="To do: Eye Separation")
|
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
|
|
|
|
|
|
|
# dome:
|
2009-08-07 03:06:32 +00:00
|
|
|
elif stereo_mode == 'DOME':
|
2009-07-30 10:11:19 +00:00
|
|
|
layout.itemR(gs, "dome_mode", text="Dome Type")
|
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-08-07 03:06:32 +00:00
|
|
|
dome_type = gs.dome_mode
|
|
|
|
|
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
|
|
|
split=layout.split()
|
2009-08-07 03:06:32 +00:00
|
|
|
|
|
|
|
if dome_type == 'FISHEYE' or \
|
|
|
|
dome_type == 'TRUNCATED_REAR' or \
|
|
|
|
dome_type == 'TRUNCATED_FRONT':
|
|
|
|
|
|
|
|
col=split.column()
|
|
|
|
col.itemR(gs, "dome_angle", slider=True)
|
|
|
|
col.itemR(gs, "dome_tilt")
|
|
|
|
|
|
|
|
col=split.column()
|
|
|
|
col.itemR(gs, "dome_tesselation", text="Tesselation")
|
|
|
|
col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
|
|
|
|
|
|
|
|
elif dome_type == 'PANORAM_SPH':
|
|
|
|
col=split.column()
|
|
|
|
col.itemR(gs, "dome_tesselation", text="Tesselation")
|
|
|
|
col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
|
|
|
|
|
|
|
|
else: # cube map
|
|
|
|
col=split.column()
|
|
|
|
col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
|
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
layout.itemR(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-08-18 15:27:48 +00:00
|
|
|
class SCENE_PT_game_shading(SceneButtonsPanel):
|
|
|
|
__label__ = "Shading"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
gs = context.scene.game_data
|
|
|
|
layout.itemR(gs, "material_mode", expand=True)
|
|
|
|
|
|
|
|
if gs.material_mode == 'GLSL':
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(gs, "glsl_lights", text="Lights")
|
|
|
|
col.itemR(gs, "glsl_shaders", text="Shaders")
|
|
|
|
col.itemR(gs, "glsl_shadows", text="Shadows")
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(gs, "glsl_ramps", text="Ramps")
|
|
|
|
col.itemR(gs, "glsl_nodes", text="Nodes")
|
|
|
|
col.itemR(gs, "glsl_extra_textures", text="Extra Textures")
|
|
|
|
|
|
|
|
class SCENE_PT_game_performance(SceneButtonsPanel):
|
|
|
|
__label__ = "Performance"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
gs = context.scene.game_data
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Show:")
|
|
|
|
col.itemR(gs, "show_debug_properties", text="Debug Properties")
|
|
|
|
col.itemR(gs, "show_framerate_profile", text="Framerate and Profile")
|
|
|
|
col.itemR(gs, "show_physics_visualization", text="Physics Visualization")
|
|
|
|
col.itemR(gs, "deprecation_warnings")
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Render:")
|
|
|
|
col.itemR(gs, "all_frames")
|
|
|
|
col.itemR(gs, "display_lists")
|
|
|
|
|
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
|
|
|
bpy.types.register(SCENE_PT_game)
|
|
|
|
bpy.types.register(SCENE_PT_game_player)
|
|
|
|
bpy.types.register(SCENE_PT_game_stereo)
|
2009-08-18 15:27:48 +00:00
|
|
|
bpy.types.register(SCENE_PT_game_shading)
|
|
|
|
bpy.types.register(SCENE_PT_game_performance)
|
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-08-22 08:48:01 +00:00
|
|
|
__space_type__ = 'PROPERTIES'
|
|
|
|
__region_type__ = 'WINDOW'
|
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
|
|
|
__context__ = "world"
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
rd = context.scene.render_data
|
|
|
|
return (rd.engine == 'BLENDER_GAME')
|
|
|
|
|
|
|
|
class WORLD_PT_game_context_world(WorldButtonsPanel):
|
2009-07-26 03:54:17 +00:00
|
|
|
__show_header__ = False
|
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
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
rd = context.scene.render_data
|
2009-07-30 10:11:19 +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
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
scene = context.scene
|
|
|
|
world = context.world
|
|
|
|
space = context.space_data
|
|
|
|
|
|
|
|
split = layout.split(percentage=0.65)
|
|
|
|
|
|
|
|
if scene:
|
|
|
|
split.template_ID(scene, "world", new="world.new")
|
|
|
|
elif world:
|
|
|
|
split.template_ID(space, "pin_id")
|
|
|
|
|
|
|
|
class WORLD_PT_game_world(WorldButtonsPanel):
|
|
|
|
__label__ = "World"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +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
|
|
|
world = context.world
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.column().itemR(world, "horizon_color")
|
|
|
|
row.column().itemR(world, "ambient_color")
|
|
|
|
|
|
|
|
layout.itemR(world.mist, "enabled", text="Mist")
|
|
|
|
|
|
|
|
row = layout.column_flow()
|
|
|
|
row.active = world.mist.enabled
|
|
|
|
row.itemR(world.mist, "start")
|
|
|
|
row.itemR(world.mist, "depth")
|
|
|
|
|
|
|
|
class WORLD_PT_game_physics(WorldButtonsPanel):
|
|
|
|
__label__ = "Physics"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +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
|
|
|
gs = context.scene.game_data
|
2009-07-30 10:11:19 +00:00
|
|
|
|
|
|
|
layout.itemR(gs, "physics_engine")
|
2009-08-06 13:15:23 +00:00
|
|
|
if gs.physics_engine != 'NONE':
|
2009-07-30 10:11:19 +00:00
|
|
|
layout.itemR(gs, "physics_gravity", text="Gravity")
|
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
|
|
|
|
|
|
|
split = layout.split()
|
2009-07-30 10:11:19 +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
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Physics Steps:")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.itemR(gs, "physics_step_max", text="Max")
|
|
|
|
sub.itemR(gs, "physics_step_sub", text="Substeps")
|
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
|
|
|
col.itemR(gs, "fps", text="FPS")
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Logic Steps:")
|
|
|
|
col.itemR(gs, "logic_step_max", text="Max")
|
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
col = layout.column()
|
|
|
|
col.itemR(gs, "use_occlusion_culling", text="Occlusion Culling")
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = gs.use_occlusion_culling
|
|
|
|
sub.itemR(gs, "occlusion_culling_resolution", text="Resolution")
|
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
|
|
|
|
|
|
|
else:
|
|
|
|
split = layout.split()
|
2009-07-30 10:11:19 +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
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Physics Steps:")
|
|
|
|
col.itemR(gs, "fps", text="FPS")
|
2009-07-30 10:11:19 +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
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Logic Steps:")
|
|
|
|
col.itemR(gs, "logic_step_max", text="Max")
|
|
|
|
|
|
|
|
bpy.types.register(WORLD_PT_game_context_world)
|
|
|
|
bpy.types.register(WORLD_PT_game_world)
|
|
|
|
bpy.types.register(WORLD_PT_game_physics)
|