Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2014-02-24 23:53:37 +0400
committerThomas Dinges <blender@dingto.org>2014-02-24 23:53:37 +0400
commita3202e434a8bce94aa2e496787dda1856da080bf (patch)
tree9de4a15dc2cdb17e6445b8de357754f2574793f0 /release
parent39cad75dcb5401cb66969402ef680b76cb8b3146 (diff)
Code cleanup: Re-use Grease Pencil panel for 3D view as well.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/properties_grease_pencil_common.py6
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py30
2 files changed, 10 insertions, 26 deletions
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 97173f8c305..5dd1f94747c 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -42,3 +42,9 @@ class GreasePencilPanel():
row = col.row(align=True)
row.prop(context.tool_settings, "use_grease_pencil_sessions")
+ if context.space_data.type == 'VIEW_3D':
+ col.separator()
+
+ col.label(text="Measure:")
+ col.operator("view3d.ruler")
+
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index db20057318f..b7e0cc5235d 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -19,6 +19,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Menu, Panel
+from bl_ui.properties_grease_pencil_common import GreasePencilPanel
from bl_ui.properties_paint_common import (
UnifiedPaintPanel,
brush_texture_settings,
@@ -50,26 +51,6 @@ def draw_keyframing_tools(context, layout):
row.operator("anim.keyframe_delete_v3d", text="Remove")
-# Grease Pencil tools
-def draw_gpencil_tools(context, layout):
- col = layout.column(align=True)
-
- row = col.row(align=True)
- row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
- row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
- row = col.row(align=True)
- row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY'
- row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
-
- col.separator()
-
- col.prop(context.tool_settings, "use_grease_pencil_sessions")
-
- col.separator()
-
- col.label(text="Measure:")
- col.operator("view3d.ruler")
-
# ********** default tools for object-mode ****************
@@ -1614,13 +1595,10 @@ class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
# Grease Pencil tools
-class VIEW3D_PT_tools_greasepencil(View3DPanel, Panel):
+class VIEW3D_PT_tools_grease_pencil(GreasePencilPanel, Panel):
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'TOOLS'
bl_category = "Grease Pencil"
- bl_label = "Grease Pencil"
-
- def draw(self, context):
- layout = self.layout
- draw_gpencil_tools(context, layout)
if __name__ == "__main__": # only for live edit.