[Bf-blender-cvs] [70f84fe] GPencil_Editing_Stage3: GPencil Editing UI: Move editing toggle to the main panel
Joshua Leung
noreply at git.blender.org
Sat Jun 13 02:45:00 CEST 2015
Commit: 70f84fe4c8339ea481ffaafb558fc6340c78d777
Author: Joshua Leung
Date: Sun May 31 12:24:47 2015 +1200
Branches: GPencil_Editing_Stage3
https://developer.blender.org/rB70f84fe4c8339ea481ffaafb558fc6340c78d777
GPencil Editing UI: Move editing toggle to the main panel
In preparation for a brush-based editing tool, moved the Stroke EditMode toggle
to the main toolshelf panel so that the editing panel can be collapsed when only
the brush panel is needed.
Also, improved the tooltip here.
===================================================================
M release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M source/blender/makesrna/intern/rna_gpencil.c
===================================================================
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 e86fc79..4860f3b 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -80,6 +80,12 @@ class GreasePencilDrawingToolsPanel:
col.separator()
gpencil_stroke_placement_settings(context, col, gpd)
+ layout.separator()
+ layout.separator()
+
+ col = layout.column(align=True)
+ col.prop(gpd, "use_stroke_edit_mode", text="Enable Editing", icon='EDIT', toggle=True)
+
if context.space_data.type == 'VIEW_3D':
col.separator()
col.separator()
@@ -98,64 +104,54 @@ class GreasePencilStrokeEditPanel:
@classmethod
def poll(cls, context):
- return (context.gpencil_data is not None)
+ if context.gpencil_data is None:
+ return False
+
+ gpd = context.gpencil_data
+ return bool(context.editable_gpencil_strokes) and bool(gpd.use_stroke_edit_mode)
@staticmethod
def draw(self, context):
layout = self.layout
- gpd = context.gpencil_data
- edit_ok = bool(context.editable_gpencil_strokes) and bool(gpd.use_stroke_edit_mode)
-
+ layout.label(text="Select:")
col = layout.column(align=True)
- col.prop(gpd, "use_stroke_edit_mode", text="Enable Editing", icon='EDIT', toggle=True)
-
- col.separator()
+ col.operator("gpencil.select_all", text="Select All")
+ col.operator("gpencil.select_border")
+ col.operator("gpencil.select_circle")
- col.label(text="Select:")
- subcol = col.column(align=True)
- subcol.active = edit_ok
- subcol.operator("gpencil.select_all", text="Select All")
- subcol.operator("gpencil.select_border")
- subcol.operator("gpencil.select_circle")
-
- col.separator()
+ layout.separator()
- subcol = col.column(align=True)
- subcol.active = edit_ok
- subcol.operator("gpencil.select_linked")
- subcol.operator("gpencil.select_more")
- subcol.operator("gpencil.select_less")
+ col = layout.column(align=True)
+ col.operator("gpencil.select_linked")
+ col.operator("gpencil.select_more")
+ col.operator("gpencil.select_less")
- col.separator()
+ layout.separator()
- col.label(text="Edit:")
- row = col.row(align=True)
- row.active = edit_ok
+ layout.label(text="Edit:")
+ row = layout.row(align=True)
row.operator("gpencil.copy", text="Copy")
row.operator("gpencil.paste", text="Paste")
- subcol = col.column(align=True)
- subcol.active = edit_ok
- subcol.operator("gpencil.delete", text="Delete")
- subcol.operator("gpencil.duplicate_move", text="Duplicate")
- subcol.operator("transform.mirror", text="Mirror").gpencil_strokes = True
+ col = layout.column(align=True)
+ col.operator("gpencil.delete", text="Delete")
+ col.operator("gpencil.duplicate_move", text="Duplicate")
+ col.operator("transform.mirror", text="Mirror").gpencil_strokes = True
- col.separator()
+ layout.separator()
- subcol = col.column(align=True)
- subcol.active = edit_ok
- subcol.operator("transform.translate").gpencil_strokes = True # icon='MAN_TRANS'
- subcol.operator("transform.rotate").gpencil_strokes = True # icon='MAN_ROT'
- subcol.operator("transform.resize", text="Scale").gpencil_strokes = True # icon='MAN_SCALE'
+ col = layout.column(align=True)
+ col.operator("transform.translate").gpencil_strokes = True # icon='MAN_TRANS'
+ col.operator("transform.rotate").gpencil_strokes = True # icon='MAN_ROT'
+ col.operator("transform.resize", text="Scale").gpencil_strokes = True # icon='MAN_SCALE'
- col.separator()
+ layout.separator()
- subcol = col.column(align=True)
- subcol.active = edit_ok
- subcol.operator("transform.bend", text="Bend").gpencil_strokes = True
- subcol.operator("transform.shear", text="Shear").gpencil_strokes = True
- subcol.operator("transform.tosphere", text="To Sphere").gpencil_strokes = True
+ col = layout.column(align=True)
+ col.operator("transform.bend", text="Bend").gpencil_strokes = True
+ col.operator("transform.shear", text="Shear").gpencil_strokes = True
+ col.operator("transform.tosphere", text="To Sphere").gpencil_strokes = True
###############################
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 7d7df0f..4b11376 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -886,7 +886,7 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_stroke_edit_mode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_STROKE_EDITMODE);
- RNA_def_property_ui_text(prop, "Stroke Edit Mode", "Enable alternative keymap to make editing stroke points easier");
+ RNA_def_property_ui_text(prop, "Stroke Edit Mode", "Edit Grease Pencil strokes instead of viewport data");
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | ND_GPENCIL_EDITMODE, "rna_GPencil_update");
/* API Functions */
More information about the Bf-blender-cvs
mailing list