Skip to content

Commit

Permalink
UPBGE: Cleanup UI.
Browse files Browse the repository at this point in the history
Some unused options/entities are removed from the UI in game engine mode:
- scene keying set
- scene audio
- speaker and forec filed in add menu

Also the game engine is renamed UPBGE.

Fix issue #756.
  • Loading branch information
panzergame committed Jul 31, 2018
1 parent 727c1fb commit 1ff5933
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions release/scripts/startup/bl_ui/properties_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions release/scripts/startup/bl_ui/space_view3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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')
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion source/blender/render/intern/source/external_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -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}
};
Expand Down

0 comments on commit 1ff5933

Please sign in to comment.