[Bf-blender-cvs] [9d81cfaba37] tracking_tools: Annotations: Cleanup old tools and tool settings

Aaron Carlisle noreply at git.blender.org
Mon Jul 19 00:03:16 CEST 2021


Commit: 9d81cfaba37157e08764205d98be7510d53764a8
Author: Aaron Carlisle
Date:   Sun Jul 18 18:03:07 2021 -0400
Branches: tracking_tools
https://developer.blender.org/rB9d81cfaba37157e08764205d98be7510d53764a8

Annotations: Cleanup old tools and tool settings

This removes the unused generic toolbar panel.

There is also an issue with `annotation_stroke_placement_view2d`,
this property needs to be updated for view2d types.
This is a bug that can be fixed in master be creating a new
enum of view2d placement options.

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	release/scripts/startup/bl_ui/space_clip.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 de743033036..58f6a4c2bea 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -23,40 +23,6 @@ from bpy.types import Menu, UIList, Operator
 from bpy.app.translations import pgettext_iface as iface_
 
 
-# XXX: To be replaced with active tools
-# Currently only used by the clip editor
-class AnnotationDrawingToolsPanel:
-    # subclass must set
-    # bl_space_type = 'IMAGE_EDITOR'
-    bl_label = "Annotation"
-    bl_category = "Annotation"
-    bl_region_type = 'TOOLS'
-
-    def draw(self, context):
-        layout = self.layout
-
-        tool_settings = context.tool_settings
-
-        col = layout.column(align=True)
-
-        col.label(text="Draw:")
-        row = col.row(align=True)
-        row.operator("gpencil.annotate", icon='GREASEPENCIL', text="Draw").mode = 'DRAW'
-        # XXX: Needs a dedicated icon
-        row.operator("gpencil.annotate", icon='FORCE_CURVE', text="Erase").mode = 'ERASER'
-
-        row = col.row(align=True)
-        row.operator("gpencil.annotate", icon='LINE_DATA', text="Line").mode = 'DRAW_STRAIGHT'
-        row.operator("gpencil.annotate", icon='MESH_DATA', text="Poly").mode = 'DRAW_POLY'
-
-        col.separator()
-
-        col.label(text="Stroke Placement:")
-        row = col.row(align=True)
-        row.prop_enum(tool_settings, "annotation_stroke_placement_view2d", 'VIEW')
-        row.prop_enum(tool_settings, "annotation_stroke_placement_view2d", 'CURSOR', text="Cursor")
-
-
 class GreasePencilSculptOptionsPanel:
     bl_label = "Sculpt Strokes"
 
@@ -399,19 +365,10 @@ class AnnotationDataPanel:
         layout = self.layout
         layout.use_property_decorate = False
 
-        is_clip_editor = context.space_data.type == 'CLIP_EDITOR'
-
         # Grease Pencil owner.
         gpd_owner = context.annotation_data_owner
         gpd = context.annotation_data
 
-        # Owner selector.
-        if is_clip_editor:
-            col = layout.column()
-            col.label(text="Data Source:")
-            row = col.row()
-            row.prop(context.space_data, "annotation_source", expand=True)
-
         # Only allow adding annotation ID if its owner exist
         if context.annotation_data_owner is None:
             row = layout.row()
diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py
index 03a12354848..7ecac39c1e5 100644
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@ -23,7 +23,6 @@ from bpy.types import Panel, Header, Menu, UIList
 from bpy.app.translations import pgettext_iface as iface_
 from bl_ui.utils import PresetPanel
 from bl_ui.properties_grease_pencil_common import (
-    AnnotationDrawingToolsPanel,
     AnnotationDataPanel,
 )
 
@@ -1374,12 +1373,6 @@ class CLIP_PT_annotation(AnnotationDataPanel, CLIP_PT_clip_view_panel, Panel):
     # But, this should only be visible in "clip" view
 
 
-# Grease Pencil drawing tools
-class CLIP_PT_tools_grease_pencil_draw(AnnotationDrawingToolsPanel, Panel):
-    bl_space_type = 'CLIP_EDITOR'
-    bl_region_type = 'TOOLS'
-
-
 class CLIP_MT_view_zoom(Menu):
     bl_label = "Fractional Zoom"
 
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index acdb4ac7e92..4f5feb13358 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -196,6 +196,9 @@ class _defs_annotate:
             row = layout.row(align=True)
             row.label(text="Data Source:")
             row.prop(context.space_data, "annotation_source", expand=True)
+
+            row = layout.row(align=True)
+            row.prop(tool_settings, "annotation_stroke_placement_view2d", text="Placement")
         if tool.idname == "builtin.annotate_line":
             layout.separator()



More information about the Bf-blender-cvs mailing list