[Bf-blender-cvs] [ae23f566581] greasepencil-object: WIP: More UI changes and continuous drawing
Antonio Vazquez
noreply at git.blender.org
Wed Jun 7 16:42:02 CEST 2017
Commit: ae23f56658176a8ff7d2b19a99507e42258e32af
Author: Antonio Vazquez
Date: Wed Jun 7 16:37:08 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBae23f56658176a8ff7d2b19a99507e42258e32af
WIP: More UI changes and continuous drawing
More changes in the panels and enable continuous drawing mode by
default.
===================================================================
M release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
M source/blender/editors/gpencil/gpencil_paint.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 603c8189254..95c5452e578 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -79,7 +79,7 @@ class GreasePencilDrawingToolsPanel:
# subclass must set
# bl_space_type = 'IMAGE_EDITOR'
bl_label = "Grease Pencil"
- bl_category = "Grease Pencil"
+ bl_category = "Create"
bl_region_type = 'TOOLS'
@staticmethod
@@ -120,12 +120,12 @@ class GreasePencilDrawingToolsPanel:
row = col.row(align=True)
row.prop(context.space_data, "grease_pencil_source", expand=True)
- col.separator()
- col.separator()
-
- gpencil_stroke_placement_settings(context, col)
-
gpd = context.gpencil_data
+ if gpd and not is_3d_view:
+ col.separator()
+ col.separator()
+
+ gpencil_stroke_placement_settings(context, col)
if gpd and not is_3d_view:
layout.separator()
@@ -135,9 +135,6 @@ class GreasePencilDrawingToolsPanel:
col.prop(gpd, "use_stroke_edit_mode", text="Enable Editing", icon='EDIT', toggle=True)
if is_3d_view:
- col.separator()
- col.separator()
-
col.label(text="Tools:")
col.operator_menu_enum("gpencil.convert", text="Convert to Geometry...", property="type")
col.operator("view3d.ruler")
@@ -147,7 +144,7 @@ class GreasePencilStrokeEditPanel:
# subclass must set
# bl_space_type = 'IMAGE_EDITOR'
bl_label = "Edit Strokes"
- bl_category = "Grease Pencil"
+ bl_category = "Tools"
bl_region_type = 'TOOLS'
bl_options = {'DEFAULT_CLOSED'}
@@ -236,7 +233,7 @@ class GreasePencilStrokeEditPanel:
class GreasePencilInterpolatePanel:
bl_space_type = 'VIEW_3D'
bl_label = "Interpolate"
- bl_category = "Grease Pencil"
+ bl_category = "Tools"
bl_region_type = 'TOOLS'
bl_options = {'DEFAULT_CLOSED'}
@@ -366,7 +363,7 @@ class GreasePencilStrokeSculptPanel:
# subclass must set
# bl_space_type = 'IMAGE_EDITOR'
bl_label = "Sculpt Strokes"
- bl_category = "Grease Pencil"
+ bl_category = "Tools"
bl_region_type = 'TOOLS'
@classmethod
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 68f65cce56b..56dd692231d 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -60,13 +60,6 @@ class VIEW3D_PT_tools_transform(View3DPanel, Panel):
bl_context = "objectmode"
bl_label = "Transform"
- @classmethod
- def poll(cls, context):
- if context.active_object and context.active_object.mode == 'GPENCIL_PAINT':
- return False
- else:
- return True
-
def draw(self, context):
layout = self.layout
@@ -86,7 +79,7 @@ class VIEW3D_PT_tools_object(View3DPanel, Panel):
@classmethod
def poll(cls, context):
- if context.active_object and context.active_object.mode == 'GPENCIL_PAINT':
+ if context.active_object and context.active_object.mode in ('GPENCIL_EDIT', 'GPENCIL_PAINT', 'GPENCIL_SCULPT'):
return False
else:
return True
@@ -134,7 +127,7 @@ class VIEW3D_PT_tools_add_object(View3DPanel, Panel):
@classmethod
def poll(cls, context):
- if context.active_object and context.active_object.mode == 'GPENCIL_PAINT':
+ if context.active_object and context.active_object.mode in ('GPENCIL_EDIT', 'GPENCIL_PAINT', 'GPENCIL_SCULPT'):
return False
else:
return True
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index c55d0ca697d..608f5bc5ed9 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -2313,6 +2313,12 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event
/* add a modal handler for this operator, so that we can then draw continuous strokes */
WM_event_add_modal_handler(C, op);
+
+ /* enable continuous drawing by default */
+ if (p->sa->spacetype == SPACE_VIEW3D) {
+ p->scene->toolsettings->gpencil_flags |= GP_TOOL_FLAG_PAINTSESSIONS_ON;
+ }
+
return OPERATOR_RUNNING_MODAL;
}
More information about the Bf-blender-cvs
mailing list