[Bf-blender-cvs] [c8cf0e10e08] greasepencil-object: Annotations: Show "Stroke Placement" options in the topbar again

Joshua Leung noreply at git.blender.org
Tue Jul 24 07:26:43 CEST 2018


Commit: c8cf0e10e08203bb43d0c551c4ecb42a76886326
Author: Joshua Leung
Date:   Tue Jul 24 17:24:25 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rBc8cf0e10e08203bb43d0c551c4ecb42a76886326

Annotations: Show "Stroke Placement" options in the topbar again

We may have to introduce a dedicated setting here for use with the
annotation tools, since the GP Object version is quite different now.

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	release/scripts/startup/bl_ui/space_toolsystem_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 4b1b3cdbd62..f972c467182 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -119,7 +119,7 @@ class GreasePencilDrawingToolsPanel:
         col.separator()
         col.separator()
 
-        if context.space_data.type in {'VIEW_3D', 'CLIP_EDITOR'}:
+        if context.space_data.type in {'CLIP_EDITOR'}:
             col.separator()
             col.label("Data Source:")
             row = col.row(align=True)
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 6f3019d6fff..08cf388870d 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -176,7 +176,7 @@ class _defs_annotate:
     @classmethod
     def draw_settings_common(cls, context, layout, tool):
         user_prefs = context.user_preferences
-        #tool_settings = context.tool_settings
+        ts = context.tool_settings
 
         # XXX: These context checks are needed for layer-dependent settings,
         # but this breaks for using topbar for 2D editor active tools, etc.
@@ -190,6 +190,19 @@ class _defs_annotate:
             layout.prop(user_prefs.edit, "grease_pencil_default_color", text="Color")
             layout.label("Thickness: [...]")
 
+        # For 3D view, show the stroke placement settings
+        # XXX: How to tell what editor the active tool comes from?
+        is_3d_view = True
+        if is_3d_view:
+            layout.separator()
+
+            row = layout.row(align=True)
+            row.prop(ts, "gpencil_stroke_placement_view3d", text="Orientation")
+            if ts.gpencil_stroke_placement_view3d == 'CURSOR':
+                row.prop(ts.gpencil_sculpt, "lockaxis")
+            elif ts.gpencil_stroke_placement_view3d in {'SURFACE', 'STROKE'}:
+                row.prop(ts, "use_gpencil_stroke_endpoints")
+
     @ToolDef.from_fn
     def scribble():
         def draw_settings(context, layout, tool):



More information about the Bf-blender-cvs mailing list