Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPBGE: Cleanup UI. #772

Merged
merged 1 commit into from
Sep 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions release/scripts/startup/bl_ui/properties_game.py
Original file line number Diff line number Diff line change
@@ -720,6 +720,30 @@ def draw(self, context):
row.prop(gs, "python_console_key4", text="", event=True)


class SCENE_PT_game_audio(SceneButtonsPanel, Panel):
bl_label = "Audio"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_GAME'}

@classmethod
def poll(cls, context):
scene = context.scene
return (scene and scene.render.engine in cls.COMPAT_ENGINES)

def draw(self, context):
layout = self.layout

scene = context.scene

split = layout.split()

col = layout.column()
col.prop(scene, "audio_distance_model", text="Distance Model")
col = layout.column(align=True)
col.prop(scene, "audio_doppler_speed", text="Speed")
col.prop(scene, "audio_doppler_factor", text="Doppler")


class WorldButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@@ -1034,6 +1058,7 @@ def draw(self, context):
SCENE_PT_game_navmesh,
SCENE_PT_game_hysteresis,
SCENE_PT_game_console,
SCENE_PT_game_audio,
WORLD_PT_game_context_world,
WORLD_PT_game_world,
WORLD_PT_game_environment_lighting,
6 changes: 3 additions & 3 deletions release/scripts/startup/bl_ui/properties_scene.py
Original file line number Diff line number Diff line change
@@ -167,7 +167,7 @@ def _draw_keyframing_setting(context, layout, ks, ksp, label, toggle_prop, prop,

class SCENE_PT_keying_sets(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
bl_label = "Keying Sets"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
COMPAT_ENGINES = {'BLENDER_RENDER'}

def draw(self, context):
layout = self.layout
@@ -200,7 +200,7 @@ def draw(self, context):

class SCENE_PT_keying_set_paths(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
bl_label = "Active Keying Set"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
COMPAT_ENGINES = {'BLENDER_RENDER'}

@classmethod
def poll(cls, context):
@@ -282,7 +282,7 @@ def draw(self, context):
class SCENE_PT_audio(SceneButtonsPanel, Panel):
bl_label = "Audio"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
COMPAT_ENGINES = {'BLENDER_RENDER'}

def draw(self, context):
layout = self.layout
12 changes: 8 additions & 4 deletions release/scripts/startup/bl_ui/space_view3d.py
Original file line number Diff line number Diff line change
@@ -1292,6 +1292,7 @@ class INFO_MT_add(Menu):
bl_label = "Add"

def draw(self, context):
rd = context.scene.render.engine
layout = self.layout

# note, don't use 'EXEC_SCREEN' or operators wont get the 'v3d' context.
@@ -1316,8 +1317,9 @@ def draw(self, context):
layout.operator_menu_enum("object.empty_add", "type", text="Empty", icon='OUTLINER_OB_EMPTY')
layout.separator()

layout.operator("object.speaker_add", text="Speaker", icon='OUTLINER_OB_SPEAKER')
layout.separator()
if rd != "BLENDER_GAME":
layout.operator("object.speaker_add", text="Speaker", icon='OUTLINER_OB_SPEAKER')
layout.separator()

if INFO_MT_camera_add.is_extended():
layout.menu("INFO_MT_camera_add", icon='OUTLINER_OB_CAMERA')
@@ -1327,8 +1329,10 @@ def draw(self, context):
layout.menu("INFO_MT_lamp_add", icon='OUTLINER_OB_LAMP')
layout.separator()

layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_FORCE_FIELD')
layout.separator()
print(rd)
if rd != "BLENDER_GAME":
layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_FORCE_FIELD')
layout.separator()

if len(bpy.data.groups) > 10:
layout.operator_context = 'INVOKE_REGION_WIN'
2 changes: 1 addition & 1 deletion source/blender/render/intern/source/external_engine.c
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@ static RenderEngineType internal_render_type = {

static RenderEngineType internal_game_type = {
NULL, NULL,
"BLENDER_GAME", N_("Blender Game"), RE_INTERNAL | RE_GAME,
"BLENDER_GAME", N_("UPBGE"), RE_INTERNAL | RE_GAME,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
{NULL, NULL, NULL}
};