diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-20 21:24:20 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-20 21:24:20 +0400 |
commit | 921b2ee2d44ed87363198d7bfa89bb7116b0818b (patch) | |
tree | 3e04fd777b5c32f4814357ff9d18289ee072c962 /release | |
parent | 1dc74acc123721d366e3628663ed029db5761e4d (diff) | |
parent | 738fdc7b6f43c3e1e838bd4239b36340fa4c2e0f (diff) |
Merging r42723 through r42769 from trunk into soc-2011-tomato
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 22 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_game.py | 85 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_particle.py | 6 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_render.py | 4 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_scene.py | 9 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_logic.py | 4 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_text.py | 2 |
7 files changed, 94 insertions, 38 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 1da5e2ca381..58941e00914 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -29,6 +29,8 @@ from bpy.props import (StringProperty, from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear +import subprocess +import os class MESH_OT_delete_edgeloop(Operator): '''Delete an edge loop by merging the faces on each side to a single face loop''' @@ -1175,6 +1177,26 @@ class WM_OT_copy_prev_settings(Operator): return {'CANCELLED'} +class WM_OT_blenderplayer_start(bpy.types.Operator): + '''Launches the Blenderplayer with the current blendfile''' + bl_idname = "wm.blenderplayer_start" + bl_label = "Start" + + blender_bin_path = bpy.app.binary_path + blender_bin_dir = os.path.dirname(blender_bin_path) + ext = os.path.splitext(blender_bin_path)[-1] + player_path = os.path.join(blender_bin_dir, 'blenderplayer' + ext) + + def execute(self, context): + import sys + + if sys.platform == 'darwin': + self.player_path = os.path.join(self.blender_bin_dir, '../../../blenderplayer.app/Contents/MacOS/blenderplayer') + + filepath = bpy.app.tempdir + "game.blend" + bpy.ops.wm.save_as_mainfile(filepath=filepath, check_existing=False, copy=True) + subprocess.call([self.player_path, filepath]) + return {'FINISHED'} class WM_OT_keyconfig_test(Operator): "Test keyconfig for conflicts" diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index db65b0ff669..66b8cca7866 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -244,16 +244,22 @@ class RenderButtonsPanel(): return (rd.engine in cls.COMPAT_ENGINES) -class RENDER_PT_game(RenderButtonsPanel, Panel): - bl_label = "Game" +class RENDER_PT_embedded(RenderButtonsPanel, bpy.types.Panel): + bl_label = "Embedded Player" COMPAT_ENGINES = {'BLENDER_GAME'} - def draw(self, context): layout = self.layout + rd = context.scene.render + row = layout.row() row.operator("view3d.game_start", text="Start") row.label() + 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): @@ -264,29 +270,23 @@ class RENDER_PT_game_player(RenderButtonsPanel, Panel): layout = self.layout gs = context.scene.game_settings - - layout.prop(gs, "show_fullscreen") - - split = layout.split() - - col = split.column() - col.label(text="Resolution:") - sub = col.column(align=True) - sub.prop(gs, "resolution_x", slider=False, text="X") - sub.prop(gs, "resolution_y", slider=False, text="Y") - - col = split.column() + + row = layout.row() + row.operator("wm.blenderplayer_start", text="Start") + row.prop(gs, "show_fullscreen") + + 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") + + col = layout.column() col.label(text="Quality:") - sub = col.column(align=True) - sub.prop(gs, "depth", text="Bit Depth", slider=False) - sub.prop(gs, "frequency", text="FPS", slider=False) + col = layout.column(align=True) + col.prop(gs, "depth", text="Bit Depth", slider=False) + col.prop(gs, "frequency", text="Refresh Rate", slider=False) - # framing: - 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 RENDER_PT_game_stereo(RenderButtonsPanel, Panel): @@ -368,20 +368,24 @@ class RENDER_PT_game_shading(RenderButtonsPanel, Panel): col.prop(gs, "use_glsl_extra_textures", text="Extra Textures") -class RENDER_PT_game_performance(RenderButtonsPanel, Panel): - bl_label = "Performance" +class RENDER_PT_game_system(RenderButtonsPanel, Panel): + bl_label = "System" COMPAT_ENGINES = {'BLENDER_GAME'} def draw(self, context): layout = self.layout gs = context.scene.game_settings - col = layout.column() - row = col.row() + row = layout.row() row.prop(gs, "use_frame_rate") + row.prop(gs, "restrict_animation_updates") + + row = layout.row() row.prop(gs, "use_display_lists") - col.prop(gs, "restrict_animation_updates") + row = layout.row() + row.label("Exit Key") + row.prop(gs, "exit_key", text="", event=True) class RENDER_PT_game_display(RenderButtonsPanel, Panel): @@ -391,6 +395,9 @@ class RENDER_PT_game_display(RenderButtonsPanel, Panel): def draw(self, context): layout = self.layout + row = layout.row() + row.prop(context.scene.render, "fps", text="Animation Frame Rate", slider=False) + gs = context.scene.game_settings flow = layout.column_flow() flow.prop(gs, "show_debug_properties", text="Debug Properties") @@ -399,6 +406,12 @@ class RENDER_PT_game_display(RenderButtonsPanel, Panel): flow.prop(gs, "use_deprecation_warnings") flow.prop(gs, "show_mouse", text="Mouse Cursor") + 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' @@ -463,6 +476,20 @@ class SCENE_PT_game_navmesh(SceneButtonsPanel, Panel): row.prop(rd, "sample_dist") row.prop(rd, "sample_max_error") +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") class WorldButtonsPanel(): bl_space_type = 'PROPERTIES' diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index f7f67527b63..b19cf0032af 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -76,7 +76,7 @@ class ParticleButtonsPanel(): class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): bl_label = "" bl_options = {'HIDE_HEADER'} - COMPAT_ENGINES = {'BLENDER_RENDER'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} @classmethod def poll(cls, context): @@ -85,6 +85,10 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): def draw(self, context): layout = self.layout + + if context.scene.render.engine == "BLENDER_GAME": + layout.label("Not available in the Game Engine") + return ob = context.object psys = context.particle_system diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index 4b4c2d2b214..6a8439ffaaa 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -51,7 +51,7 @@ class RenderButtonsPanel(): @classmethod def poll(cls, context): rd = context.scene.render - return (context.scene and rd.use_game_engine is False) and (rd.engine in cls.COMPAT_ENGINES) + return context.scene and (rd.engine in cls.COMPAT_ENGINES) class RENDER_PT_render(RenderButtonsPanel, Panel): @@ -553,7 +553,7 @@ class RENDER_PT_encoding(RenderButtonsPanel, Panel): class RENDER_PT_bake(RenderButtonsPanel, Panel): bl_label = "Bake" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index 05f4887a542..b7218e4ba47 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -29,12 +29,13 @@ class SceneButtonsPanel(): @classmethod def poll(cls, context): - return context.scene + rd = context.scene.render + return context.scene and (rd.engine in cls.COMPAT_ENGINES) class SCENE_PT_scene(SceneButtonsPanel, Panel): bl_label = "Scene" - COMPAT_ENGINES = {'BLENDER_RENDER'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} def draw(self, context): layout = self.layout @@ -75,7 +76,7 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel): class SCENE_PT_unit(SceneButtonsPanel, Panel): bl_label = "Units" - COMPAT_ENGINES = {'BLENDER_RENDER'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} def draw(self, context): layout = self.layout @@ -93,6 +94,7 @@ class SCENE_PT_unit(SceneButtonsPanel, Panel): class SCENE_PT_keying_sets(SceneButtonsPanel, Panel): bl_label = "Keying Sets" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} def draw(self, context): layout = self.layout @@ -125,6 +127,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, Panel): class SCENE_PT_keying_set_paths(SceneButtonsPanel, Panel): bl_label = "Active Keying Set" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} @classmethod def poll(cls, context): diff --git a/release/scripts/startup/bl_ui/space_logic.py b/release/scripts/startup/bl_ui/space_logic.py index 1ae8095fab3..1fc58475ace 100644 --- a/release/scripts/startup/bl_ui/space_logic.py +++ b/release/scripts/startup/bl_ui/space_logic.py @@ -70,7 +70,9 @@ class LOGIC_HT_header(Header): layout.template_header() if context.area.show_menus: - layout.menu("LOGIC_MT_view") + row = layout.row(align=True) + row.menu("LOGIC_MT_view") + row.menu("LOGIC_MT_logicbricks_add") class LOGIC_MT_view(Menu): diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py index c3b2e30cb12..7249e9522ff 100644 --- a/release/scripts/startup/bl_ui/space_text.py +++ b/release/scripts/startup/bl_ui/space_text.py @@ -174,9 +174,7 @@ class TEXT_MT_text(Menu): st = context.space_data text = st.text - layout.operator_context = 'EXEC_AREA' layout.operator("text.new") - layout.operator_context = 'INVOKE_AREA' layout.operator("text.open") if text: |