[Bf-blender-cvs] [41025e1550f] greasepencil-object: Fix: GP-related menus were only available in "Edit Mode" but not any of the other modes

Joshua Leung noreply at git.blender.org
Tue Oct 24 13:56:23 CEST 2017


Commit: 41025e1550f7995e53e0c0598fd65a97bea96698
Author: Joshua Leung
Date:   Wed Oct 25 00:52:59 2017 +1300
Branches: greasepencil-object
https://developer.blender.org/rB41025e1550f7995e53e0c0598fd65a97bea96698

Fix: GP-related menus were only available in "Edit Mode" but not any of the other modes

Instead, the Object Mode menus were being shown, which could be quite confusing
and useless in general.

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

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

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

diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 151680ba09f..4dc1779b56a 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -181,7 +181,8 @@ class VIEW3D_MT_editor_menus(Menu):
         obj = context.active_object
         mode_string = context.mode
         edit_object = context.edit_object
-        gp_edit = context.gpencil_data and context.gpencil_data.use_stroke_edit_mode
+        gp_edit = context.active_object and \
+                  context.active_object.mode in {'GPENCIL_EDIT', 'GPENCIL_PAINT', 'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'}
 
         layout.menu("VIEW3D_MT_view")



More information about the Bf-blender-cvs mailing list