[Bf-blender-cvs] [573074eb22f] greasepencil-object: UI: move convert to geometry and ruler

Antonio Vazquez noreply at git.blender.org
Sun Jul 9 20:26:21 CEST 2017


Commit: 573074eb22f3d5984e737895da6f4f081c230c1a
Author: Antonio Vazquez
Date:   Sun Jul 9 20:26:09 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB573074eb22f3d5984e737895da6f4f081c230c1a

UI: move convert to geometry and ruler

Move the convert to geometry to new panel and hide rler if enable gp modes

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py

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

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 01ed2019fdb..b3a159f5473 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -129,9 +129,10 @@ class GreasePencilDrawingToolsPanel:
             col.prop(gpd, "use_stroke_edit_mode", text="Enable Editing", icon='EDIT', toggle=True)
 
         if is_3d_view:
-            col.label(text="Tools:")
-            col.operator_menu_enum("gpencil.convert", text="Convert to Geometry...", property="type")
-            col.operator("view3d.ruler")
+            is_gpmode = context.active_object.mode in ('GPENCIL_EDIT', 'GPENCIL_PAINT', 'GPENCIL_SCULPT')
+            if context.active_object is None or is_gpmode is False:
+                col.label(text="Tools:")
+                col.operator("view3d.ruler")
 
 
 class GreasePencilStrokeEditPanel:
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 28fc7b6bbfe..ce4f244cd92 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -127,6 +127,12 @@ class VIEW3D_PT_tools_object(View3DPanel, Panel):
                 row.operator("object.data_transfer", text="Data")
                 row.operator("object.datalayout_transfer", text="Data Layout")
 
+            if obj_type == 'GPENCIL':
+                col = layout.column(align=True)
+                col.label(text="Grease Pencil:")
+                row = col.row(align=True)
+                col.operator_menu_enum("gpencil.convert", text="Convert to Geometry...", property="type")
+
 
 class VIEW3D_PT_tools_add_object(View3DPanel, Panel):
     bl_category = "Create"




More information about the Bf-blender-cvs mailing list