blender/release/scripts/startup/bl_ui/properties_game.py

741 lines
22 KiB
Python
Raw Normal View History

# ##### 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.
#
# 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.
#
# 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.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
from bpy.types import Panel
2011-09-20 18:29:19 +00:00
class PhysicsButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"
class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
bl_label = "Physics"
COMPAT_ENGINES = {'BLENDER_GAME'}
@classmethod
def poll(cls, context):
ob = context.active_object
rd = context.scene.render
return ob and ob.game and (rd.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
ob = context.active_object
game = ob.game
soft = ob.game.soft_body
layout.prop(game, "physics_type")
layout.separator()
physics_type = game.physics_type
if physics_type == 'CHARACTER':
layout.prop(game, "use_actor")
layout.prop(ob, "hide_render", text="Invisible") # out of place but useful
layout.prop(game, "step_height", slider=True)
layout.prop(game, "jump_speed")
layout.prop(game, "fall_speed")
elif physics_type in {'DYNAMIC', 'RIGID_BODY'}:
split = layout.split()
col = split.column()
col.prop(game, "use_actor")
col.prop(game, "use_ghost")
col.prop(ob, "hide_render", text="Invisible") # out of place but useful
col = split.column()
col.prop(game, "use_material_physics_fh")
col.prop(game, "use_rotate_from_normal")
col.prop(game, "use_sleep")
layout.separator()
split = layout.split()
col = split.column()
col.label(text="Attributes:")
col.prop(game, "mass")
col.prop(game, "radius")
col.prop(game, "form_factor")
col = split.column()
sub = col.column()
sub.prop(game, "use_anisotropic_friction")
subsub = sub.column()
subsub.active = game.use_anisotropic_friction
subsub.prop(game, "friction_coefficients", text="", slider=True)
split = layout.split()
col = split.column()
col.label(text="Velocity:")
sub = col.column(align=True)
sub.prop(game, "velocity_min", text="Minimum")
sub.prop(game, "velocity_max", text="Maximum")
col = split.column()
col.label(text="Damping:")
sub = col.column(align=True)
sub.prop(game, "damping", text="Translation", slider=True)
sub.prop(game, "rotation_damping", text="Rotation", slider=True)
layout.separator()
split = layout.split()
col = split.column()
col.label(text="Lock Translation:")
col.prop(game, "lock_location_x", text="X")
col.prop(game, "lock_location_y", text="Y")
col.prop(game, "lock_location_z", text="Z")
col = split.column()
col.label(text="Lock Rotation:")
col.prop(game, "lock_rotation_x", text="X")
col.prop(game, "lock_rotation_y", text="Y")
col.prop(game, "lock_rotation_z", text="Z")
elif physics_type == 'SOFT_BODY':
col = layout.column()
col.prop(game, "use_actor")
col.prop(game, "use_ghost")
col.prop(ob, "hide_render", text="Invisible")
layout.separator()
split = layout.split()
col = split.column()
col.label(text="Attributes:")
col.prop(game, "mass")
# disabled in the code
# col.prop(soft, "weld_threshold")
col.prop(soft, "location_iterations")
col.prop(soft, "linear_stiffness", slider=True)
col.prop(soft, "dynamic_friction", slider=True)
col.prop(soft, "collision_margin", slider=True)
col.prop(soft, "use_bending_constraints", text="Bending Constraints")
col = split.column()
col.prop(soft, "use_shape_match")
sub = col.column()
sub.active = soft.use_shape_match
sub.prop(soft, "shape_threshold", slider=True)
col.separator()
col.label(text="Cluster Collision:")
col.prop(soft, "use_cluster_rigid_to_softbody")
col.prop(soft, "use_cluster_soft_to_softbody")
sub = col.column()
sub.active = (soft.use_cluster_rigid_to_softbody or soft.use_cluster_soft_to_softbody)
sub.prop(soft, "cluster_iterations", text="Iterations")
elif physics_type == 'STATIC':
col = layout.column()
col.prop(game, "use_actor")
col.prop(game, "use_ghost")
col.prop(ob, "hide_render", text="Invisible")
layout.separator()
split = layout.split()
col = split.column()
col.label(text="Attributes:")
col.prop(game, "radius")
col = split.column()
sub = col.column()
sub.prop(game, "use_anisotropic_friction")
subsub = sub.column()
subsub.active = game.use_anisotropic_friction
subsub.prop(game, "friction_coefficients", text="", slider=True)
elif physics_type == 'SENSOR':
col = layout.column()
col.prop(game, "use_actor", text="Detect Actors")
col.prop(ob, "hide_render", text="Invisible")
elif physics_type in {'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'}:
layout.prop(ob, "hide_render", text="Invisible")
elif physics_type == 'NAVMESH':
layout.operator("mesh.navmesh_face_copy")
layout.operator("mesh.navmesh_face_add")
layout.separator()
layout.operator("mesh.navmesh_reset")
layout.operator("mesh.navmesh_clear")
if physics_type not in {'NO_COLLISION', 'OCCLUDE'}:
layout.separator()
split = layout.split()
col = split.column()
col.prop(game, "collision_group")
col = split.column()
col.prop(game, "collision_mask")
2013-01-15 23:15:32 +00:00
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel):
bl_label = "Collision Bounds"
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', 'CHARACTER'}) and (rd.engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
game = context.active_object.game
self.layout.prop(game, "use_collision_bounds", text="")
def draw(self, context):
layout = self.layout
game = context.active_object.game
layout.active = game.use_collision_bounds
layout.prop(game, "collision_bounds_type", text="Bounds")
row = layout.row()
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"
2010-08-05 13:54:56 +00:00
COMPAT_ENGINES = {'BLENDER_GAME'}
2011-09-11 15:36:11 +00:00
2010-10-03 16:28:28 +00:00
@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, "use_obstacle_create", text="")
def draw(self, context):
layout = self.layout
game = context.active_object.game
layout.active = game.use_obstacle_create
row = layout.row()
row.prop(game, "obstacle_radius", text="Radius")
row.label()
2011-09-11 15:36:11 +00:00
class RenderButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "render"
@classmethod
def poll(cls, context):
rd = context.scene.render
return (rd.engine in cls.COMPAT_ENGINES)
2012-01-18 06:11:56 +00:00
class RENDER_PT_embedded(RenderButtonsPanel, Panel):
Cucumber, first batch of merge - UI changes and custom exit key --------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
2011-12-20 03:11:56 +00:00
bl_label = "Embedded Player"
COMPAT_ENGINES = {'BLENDER_GAME'}
2012-01-01 08:52:54 +00:00
def draw(self, context):
layout = self.layout
Cucumber, first batch of merge - UI changes and custom exit key --------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
2011-12-20 03:11:56 +00:00
rd = context.scene.render
row = layout.row()
row.operator("view3d.game_start", text="Start")
row.label()
Cucumber, first batch of merge - UI changes and custom exit key --------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
2011-12-20 03:11:56 +00:00
row = layout.row()
row.label(text="Resolution:")
row = layout.row(align=True)
row.prop(rd, "resolution_x", slider=False, text="X")
row.prop(rd, "resolution_y", slider=False, text="Y")
class RENDER_PT_game_player(RenderButtonsPanel, Panel):
bl_label = "Standalone Player"
COMPAT_ENGINES = {'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
2010-08-18 08:26:18 +00:00
gs = context.scene.game_settings
2012-01-01 08:52:54 +00:00
Cucumber, first batch of merge - UI changes and custom exit key --------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
2011-12-20 03:11:56 +00:00
row = layout.row()
row.operator("wm.blenderplayer_start", text="Start")
Cucumber - AA for blenderplayer and fullscreen .............................................. svn merge ^/branches/soc-2011-cucumber -r 38968,38970,38973,39045,40845 Notes: ====== * we replaced fullscreen by playerflag in DNA_scene.types.h. So no doversion here, I think this is a small reversion can't see any potential problem in forcuing users to re-check fullscreen. If the file is really old (<250) it will doversion though; * (for after commit) it would be nice to gray out the width/height when desktop=True * for a rainy day: it would be nice to have other ghost modes (e.g. screensaver) to support desktop + MSAA as well. It's not a huge deal given that I don't even know if anything else work (apart from windowed, fullscreen and embed) but it doesn't hurt to have it updated as well. * there is something strange with outliner. I think space_outliner merge-info is not in sync with the ^/ folder. It's probably a wrong merge early in cucumber. Commit Logs: =========== # 40845 by dfelinto remove desktop and fullscreen properties. They are both part of playerflag now also I removed the fullscreen from the DNA completely. I don't think we need doversion that.. #39045 by kupoman The Desktop option is now greyed out when fullscreen is not checked rather than disappearing from the UI completely. #38973 by kupoman Adding a checkbox to the UI to allow the full screen Blender Player to use the current desktop resolution instead of the resolution setting. #38970 by kupoman Multisampling now works in a fullscreen Blender Player. #38968 by moguri Committing a patch from Mitchell Stokes (Moguri) to include a setting in the UI for the Blenderplayer multisampling.
2012-01-11 20:53:22 +00:00
row.label()
2012-01-01 08:52:54 +00:00
Cucumber, first batch of merge - UI changes and custom exit key --------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
2011-12-20 03:11:56 +00:00
row = layout.row()
row.label(text="Resolution:")
row = layout.row(align=True)
row.prop(gs, "resolution_x", slider=False, text="X")
row.prop(gs, "resolution_y", slider=False, text="Y")
Cucumber - AA for blenderplayer and fullscreen .............................................. svn merge ^/branches/soc-2011-cucumber -r 38968,38970,38973,39045,40845 Notes: ====== * we replaced fullscreen by playerflag in DNA_scene.types.h. So no doversion here, I think this is a small reversion can't see any potential problem in forcuing users to re-check fullscreen. If the file is really old (<250) it will doversion though; * (for after commit) it would be nice to gray out the width/height when desktop=True * for a rainy day: it would be nice to have other ghost modes (e.g. screensaver) to support desktop + MSAA as well. It's not a huge deal given that I don't even know if anything else work (apart from windowed, fullscreen and embed) but it doesn't hurt to have it updated as well. * there is something strange with outliner. I think space_outliner merge-info is not in sync with the ^/ folder. It's probably a wrong merge early in cucumber. Commit Logs: =========== # 40845 by dfelinto remove desktop and fullscreen properties. They are both part of playerflag now also I removed the fullscreen from the DNA completely. I don't think we need doversion that.. #39045 by kupoman The Desktop option is now greyed out when fullscreen is not checked rather than disappearing from the UI completely. #38973 by kupoman Adding a checkbox to the UI to allow the full screen Blender Player to use the current desktop resolution instead of the resolution setting. #38970 by kupoman Multisampling now works in a fullscreen Blender Player. #38968 by moguri Committing a patch from Mitchell Stokes (Moguri) to include a setting in the UI for the Blenderplayer multisampling.
2012-01-11 20:53:22 +00:00
row = layout.row()
col = row.column()
col.prop(gs, "show_fullscreen")
col = row.column()
col.prop(gs, "use_desktop")
col.active = gs.show_fullscreen
2012-01-17 17:57:20 +00:00
Cucumber, first batch of merge - UI changes and custom exit key --------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
2011-12-20 03:11:56 +00:00
col = layout.column()
col.label(text="Quality:")
Cucumber - AA for blenderplayer and fullscreen .............................................. svn merge ^/branches/soc-2011-cucumber -r 38968,38970,38973,39045,40845 Notes: ====== * we replaced fullscreen by playerflag in DNA_scene.types.h. So no doversion here, I think this is a small reversion can't see any potential problem in forcuing users to re-check fullscreen. If the file is really old (<250) it will doversion though; * (for after commit) it would be nice to gray out the width/height when desktop=True * for a rainy day: it would be nice to have other ghost modes (e.g. screensaver) to support desktop + MSAA as well. It's not a huge deal given that I don't even know if anything else work (apart from windowed, fullscreen and embed) but it doesn't hurt to have it updated as well. * there is something strange with outliner. I think space_outliner merge-info is not in sync with the ^/ folder. It's probably a wrong merge early in cucumber. Commit Logs: =========== # 40845 by dfelinto remove desktop and fullscreen properties. They are both part of playerflag now also I removed the fullscreen from the DNA completely. I don't think we need doversion that.. #39045 by kupoman The Desktop option is now greyed out when fullscreen is not checked rather than disappearing from the UI completely. #38973 by kupoman Adding a checkbox to the UI to allow the full screen Blender Player to use the current desktop resolution instead of the resolution setting. #38970 by kupoman Multisampling now works in a fullscreen Blender Player. #38968 by moguri Committing a patch from Mitchell Stokes (Moguri) to include a setting in the UI for the Blenderplayer multisampling.
2012-01-11 20:53:22 +00:00
col.prop(gs, "samples")
Cucumber, first batch of merge - UI changes and custom exit key --------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
2011-12-20 03:11:56 +00:00
col = layout.column(align=True)
col.prop(gs, "depth", text="Bit Depth", slider=False)
col.prop(gs, "frequency", text="Refresh Rate", slider=False)
class RENDER_PT_game_stereo(RenderButtonsPanel, Panel):
bl_label = "Stereo"
COMPAT_ENGINES = {'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
2010-08-18 08:26:18 +00:00
gs = context.scene.game_settings
stereo_mode = gs.stereo
# stereo options:
layout.prop(gs, "stereo", expand=True)
# stereo:
if stereo_mode == 'STEREO':
layout.prop(gs, "stereo_mode")
layout.prop(gs, "stereo_eye_separation")
# dome:
elif stereo_mode == 'DOME':
layout.prop(gs, "dome_mode", text="Dome Type")
dome_type = gs.dome_mode
split = layout.split()
if dome_type in {'FISHEYE', 'TRUNCATED_REAR', 'TRUNCATED_FRONT'}:
col = split.column()
col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
col.prop(gs, "dome_angle", slider=True)
col = split.column()
col.prop(gs, "dome_tessellation", text="Tessellation")
col.prop(gs, "dome_tilt")
elif dome_type == 'PANORAM_SPH':
col = split.column()
col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
2012-07-29 12:07:06 +00:00
col = split.column()
col.prop(gs, "dome_tessellation", text="Tessellation")
2010-09-07 15:17:42 +00:00
else: # cube map
col = split.column()
col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
col = split.column()
layout.prop(gs, "dome_text")
class RENDER_PT_game_shading(RenderButtonsPanel, Panel):
bl_label = "Shading"
COMPAT_ENGINES = {'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
2010-08-18 08:26:18 +00:00
gs = context.scene.game_settings
layout.prop(gs, "material_mode", expand=True)
if gs.material_mode == 'GLSL':
split = layout.split()
col = split.column()
col.prop(gs, "use_glsl_lights", text="Lights")
col.prop(gs, "use_glsl_shaders", text="Shaders")
col.prop(gs, "use_glsl_shadows", text="Shadows")
col.prop(gs, "use_glsl_color_management", text="Color Management")
col = split.column()
col.prop(gs, "use_glsl_ramps", text="Ramps")
col.prop(gs, "use_glsl_nodes", text="Nodes")
col.prop(gs, "use_glsl_extra_textures", text="Extra Textures")
Cucumber, first batch of merge - UI changes and custom exit key --------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
2011-12-20 03:11:56 +00:00
class RENDER_PT_game_system(RenderButtonsPanel, Panel):
bl_label = "System"
COMPAT_ENGINES = {'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
2010-08-18 08:26:18 +00:00
gs = context.scene.game_settings
col = layout.column()
row = col.row()
col = row.column()
col.prop(gs, "use_frame_rate")
col.prop(gs, "restrict_animation_updates")
col.prop(gs, "use_material_caching")
col = row.column()
col.prop(gs, "use_display_lists")
col.active = gs.raster_storage != 'VERTEX_BUFFER_OBJECT'
2013-01-15 23:15:32 +00:00
Cucumber, first batch of merge - UI changes and custom exit key --------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
2011-12-20 03:11:56 +00:00
row = layout.row()
row.prop(gs, "raster_storage")
2013-01-15 23:15:32 +00:00
Cucumber, first batch of merge - UI changes and custom exit key --------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
2011-12-20 03:11:56 +00:00
row = layout.row()
row.label("Exit Key")
row.prop(gs, "exit_key", text="", event=True)
class RENDER_PT_game_display(RenderButtonsPanel, Panel):
bl_label = "Display"
COMPAT_ENGINES = {'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
2012-07-29 12:07:06 +00:00
gs = context.scene.game_settings
layout.prop(context.scene.render, "fps", text="Animation Frame Rate", slider=False)
Cucumber, first batch of merge - UI changes and custom exit key --------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
2011-12-20 03:11:56 +00:00
flow = layout.column_flow()
flow.prop(gs, "show_debug_properties", text="Debug Properties")
flow.prop(gs, "show_framerate_profile", text="Framerate and Profile")
flow.prop(gs, "show_physics_visualization", text="Physics Visualization")
flow.prop(gs, "use_deprecation_warnings")
flow.prop(gs, "show_mouse", text="Mouse Cursor")
Cucumber, first batch of merge - UI changes and custom exit key --------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
2011-12-20 03:11:56 +00:00
col = layout.column()
col.label(text="Framing:")
col.row().prop(gs, "frame_type", expand=True)
if gs.frame_type == 'LETTERBOX':
col.prop(gs, "frame_color", text="")
class SceneButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "scene"
2011-09-11 15:36:11 +00:00
2011-11-11 03:28:46 +00:00
class SCENE_PT_game_navmesh(SceneButtonsPanel, Panel):
bl_label = "Navigation mesh"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_GAME'}
2011-09-11 15:36:11 +00:00
@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
2012-07-04 21:41:05 +00:00
layout.operator("mesh.navmesh_make", text="Build navigation mesh")
col = layout.column()
col.label(text="Rasterization:")
row = col.row()
row.prop(rd, "cell_size")
row.prop(rd, "cell_height")
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, "slope_max")
col.prop(rd, "climb_max")
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()
2011-09-11 15:36:11 +00:00
col = split.column()
col.prop(rd, "edge_max_len")
col.prop(rd, "edge_max_error")
split.prop(rd, "verts_per_poly")
2011-09-11 15:36:11 +00:00
col = layout.column()
col.label(text="Detail Mesh:")
row = col.row()
row.prop(rd, "sample_dist")
row.prop(rd, "sample_max_error")
2012-01-01 08:52:54 +00:00
Cucumber, first batch of merge - UI changes and custom exit key --------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
2011-12-20 03:11:56 +00:00
class RENDER_PT_game_sound(RenderButtonsPanel, Panel):
bl_label = "Sound"
COMPAT_ENGINES = {'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
scene = context.scene
layout.prop(scene, "audio_distance_model")
col = layout.column(align=True)
col.prop(scene, "audio_doppler_speed", text="Speed")
col.prop(scene, "audio_doppler_factor")
2012-01-01 08:52:54 +00:00
class WorldButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "world"
class WORLD_PT_game_context_world(WorldButtonsPanel, Panel):
bl_label = ""
bl_options = {'HIDE_HEADER'}
COMPAT_ENGINES = {'BLENDER_GAME'}
@classmethod
def poll(cls, context):
rd = context.scene.render
return (context.scene) and (rd.use_game_engine)
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, Panel):
bl_label = "World"
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
world = context.world
row = layout.row()
row.column().prop(world, "horizon_color")
row.column().prop(world, "ambient_color")
class WORLD_PT_game_mist(WorldButtonsPanel, Panel):
bl_label = "Mist"
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_header(self, context):
world = context.world
self.layout.prop(world.mist_settings, "use_mist", text="")
def draw(self, context):
layout = self.layout
world = context.world
layout.active = world.mist_settings.use_mist
2012-07-29 12:07:06 +00:00
layout.prop(world.mist_settings, "falloff")
row = layout.row(align=True)
row.prop(world.mist_settings, "start")
row.prop(world.mist_settings, "depth")
2012-07-29 12:07:06 +00:00
layout.prop(world.mist_settings, "intensity", text="Minimum Intensity")
class WORLD_PT_game_physics(WorldButtonsPanel, Panel):
bl_label = "Physics"
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
2010-08-18 08:26:18 +00:00
gs = context.scene.game_settings
layout.prop(gs, "physics_engine")
if gs.physics_engine != 'NONE':
col = layout.column()
col.prop(gs, "physics_gravity", text="Gravity")
col.prop(gs, "occlusion_culling_resolution", text="Culling Resolution")
split = layout.split()
col = split.column()
col.label(text="Physics Steps:")
sub = col.column(align=True)
sub.prop(gs, "physics_step_max", text="Max")
sub.prop(gs, "physics_step_sub", text="Substeps")
col.prop(gs, "fps", text="FPS")
col = split.column()
col.label(text="Logic Steps:")
col.prop(gs, "logic_step_max", text="Max")
col = layout.column()
col.label(text="Physics Deactivation:")
sub = col.row(align=True)
sub.prop(gs, "deactivation_linear_threshold", text="Linear Threshold")
sub.prop(gs, "deactivation_angular_threshold", text="Angular Threshold")
sub = col.row()
sub.prop(gs, "deactivation_time", text="Time")
else:
split = layout.split()
col = split.column()
col.label(text="Physics Steps:")
col.prop(gs, "fps", text="FPS")
col = split.column()
col.label(text="Logic Steps:")
col.prop(gs, "logic_step_max", text="Max")
2011-09-11 15:36:11 +00:00
class WORLD_PT_game_physics_obstacles(WorldButtonsPanel, Panel):
bl_label = "Obstacle simulation"
COMPAT_ENGINES = {'BLENDER_GAME'}
2011-09-11 15:36:11 +00:00
@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
2010-10-03 16:28:28 +00:00
gs = context.scene.game_settings
2011-09-11 15:36:11 +00:00
layout.prop(gs, "obstacle_simulation", text="Type")
if gs.obstacle_simulation != 'NONE':
layout.prop(gs, "level_height")
layout.prop(gs, "show_obstacle_simulation")
2012-05-01 13:32:55 +00:00
class DataButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
2012-05-01 13:32:55 +00:00
class DATA_PT_shadow_game(DataButtonsPanel, Panel):
bl_label = "Shadow"
COMPAT_ENGINES = {'BLENDER_GAME'}
@classmethod
def poll(cls, context):
COMPAT_LIGHTS = {'SPOT', 'SUN'}
lamp = context.lamp
engine = context.scene.render.engine
return (lamp and lamp.type in COMPAT_LIGHTS) and (engine in cls.COMPAT_ENGINES)
2012-05-01 13:32:55 +00:00
def draw_header(self, context):
lamp = context.lamp
2012-05-01 13:32:55 +00:00
self.layout.prop(lamp, "use_shadow", text="")
def draw(self, context):
layout = self.layout
lamp = context.lamp
2012-05-01 13:32:55 +00:00
layout.active = lamp.use_shadow
2012-05-01 13:32:55 +00:00
split = layout.split()
col = split.column()
col.prop(lamp, "shadow_color", text="")
col = split.column()
col.prop(lamp, "use_shadow_layer", text="This Layer Only")
col.prop(lamp, "use_only_shadow")
2012-05-01 13:32:55 +00:00
col = layout.column()
col.label("Buffer Type:")
col.prop(lamp, "ge_shadow_buffer_type", text="", toggle=True)
col.label("Quality:")
col = layout.column(align=True)
col.prop(lamp, "shadow_buffer_size", text="Size")
col.prop(lamp, "shadow_buffer_bias", text="Bias")
col.prop(lamp, "shadow_buffer_bleed_bias", text="Bleed Bias")
row = layout.row()
row.label("Clipping:")
row = layout.row(align=True)
row.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
row.prop(lamp, "shadow_buffer_clip_end", text="Clip End")
if lamp.type == 'SUN':
row = layout.row()
row.prop(lamp, "shadow_frustum_size", text="Frustum Size")
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)