Commit: 2eba93970088862ba80e1e82422e6fbd32b42196
Author: Julian Eisel
Date:   Thu Jun 1 19:21:03 2017 +0200
Branches: workspaces
https://developer.blender.org/rB2eba93970088862ba80e1e82422e6fbd32b42196

Show alternative mode button when building without USE_WORKSPACE_MODE

Gets active mode from active object, like old mode switcher.

===================================================================

M       release/scripts/startup/bl_ui/space_info.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_info.py 
b/release/scripts/startup/bl_ui/space_info.py
index 9e63573b706..f05808c7a2c 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -31,6 +31,7 @@ class INFO_HT_header(Header):
         workspace = context.workspace
         screen = context.screen
         scene = context.scene
+        layer = context.render_layer
         rd = scene.render
 
         row = layout.row(align=True)
@@ -49,7 +50,10 @@ class INFO_HT_header(Header):
 
         if hasattr(workspace, 'object_mode'):
             act_mode_item = 
bpy.types.Object.bl_rna.properties['mode'].enum_items[workspace.object_mode]
-            layout.operator_menu_enum("object.mode_set", "mode", 
text=act_mode_item.name, icon=act_mode_item.icon)
+        else:
+            act_mode_item = 
bpy.types.Object.bl_rna.properties['mode'].enum_items[layer.objects.active.mode]
+        layout.operator_menu_enum("object.mode_set", "mode", 
text=act_mode_item.name, icon=act_mode_item.icon)
+
         layout.template_search(workspace, "render_layer", scene, 
"render_layers")
 
         layout.separator()

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to