[Bf-blender-cvs] [a1f8706] master: Grease Pencil: Merge GPencil_Editing_Stage3 branch into master

Joshua Leung noreply at git.blender.org
Sun Dec 13 09:11:50 CET 2015


Commit: a1f87064c4c0cd9e8eafc19c599c4ad4ccdba49f
Author: Joshua Leung
Date:   Sun Dec 13 21:03:13 2015 +1300
Branches: master
https://developer.blender.org/rBa1f87064c4c0cd9e8eafc19c599c4ad4ccdba49f

Grease Pencil: Merge GPencil_Editing_Stage3 branch into master

This commit merges all the work done in the GPencil_Editing_Stage3 branch
as of ef2aecf2db981b5344e0d14e7f074f1742b0b2f7 into master. For more details
about the changes that this brings, see the WIP release notes:

http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.77/GPencil

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

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_dopesheet.py
M	release/scripts/startup/bl_ui/space_image.py
M	release/scripts/startup/bl_ui/space_node.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/blenkernel/BKE_gpencil.h
M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/blenkernel/intern/scene.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/blenloader/intern/versioning_defaults.c
M	source/blender/editors/animation/anim_draw.c
M	source/blender/editors/animation/anim_filter.c
M	source/blender/editors/animation/keyframes_general.c
M	source/blender/editors/gpencil/CMakeLists.txt
M	source/blender/editors/gpencil/drawgpencil.c
M	source/blender/editors/gpencil/editaction_gpencil.c
A	source/blender/editors/gpencil/gpencil_brush.c
M	source/blender/editors/gpencil/gpencil_convert.c
M	source/blender/editors/gpencil/gpencil_data.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/gpencil/gpencil_intern.h
M	source/blender/editors/gpencil/gpencil_ops.c
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_select.c
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/editors/include/ED_gpencil.h
M	source/blender/editors/object/object_edit.c
M	source/blender/editors/screen/screen_ops.c
M	source/blender/editors/space_action/action_edit.c
M	source/blender/editors/space_time/space_time.c
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/editors/space_view3d/view3d_header.c
M	source/blender/editors/transform/transform_conversions.c
M	source/blender/editors/transform/transform_generics.c
M	source/blender/editors/transform/transform_manipulator.c
M	source/blender/makesdna/DNA_action_types.h
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesdna/DNA_object_types.h
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/RNA_enum_types.h
M	source/blender/makesrna/intern/rna_action.c
M	source/blender/makesrna/intern/rna_gpencil.c
M	source/blender/makesrna/intern/rna_object.c
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/makesrna/intern/rna_sculpt_paint.c
M	source/blender/makesrna/intern/rna_wm.c
M	source/blender/windowmanager/intern/wm_event_system.c
M	source/blender/windowmanager/intern/wm_init_exit.c
M	source/blender/windowmanager/intern/wm_keymap.c
M	source/blender/windowmanager/wm_event_types.h

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

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 91a986d..59c05c1 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -22,23 +22,34 @@
 from bpy.types import Menu, UIList
 
 
-def gpencil_stroke_placement_settings(context, layout, gpd):
+def gpencil_stroke_placement_settings(context, layout):
+    if context.space_data.type == 'VIEW_3D':
+        propname = "gpencil_stroke_placement_view3d"
+    elif context.space_data.type == 'SEQUENCE_EDITOR':
+        propname = "gpencil_stroke_placement_sequencer_preview"
+    elif context.space_data.type == 'IMAGE_EDITOR':
+        propname = "gpencil_stroke_placement_image_edit"
+    else:
+        propname = "gpencil_stroke_placement_view2d"
+
+    ts = context.tool_settings
+
     col = layout.column(align=True)
 
     col.label(text="Stroke Placement:")
 
     row = col.row(align=True)
-    row.prop_enum(gpd, "draw_mode", 'VIEW')
-    row.prop_enum(gpd, "draw_mode", 'CURSOR')
+    row.prop_enum(ts, propname, 'VIEW')
+    row.prop_enum(ts, propname, 'CURSOR')
 
     if context.space_data.type == 'VIEW_3D':
         row = col.row(align=True)
-        row.prop_enum(gpd, "draw_mode", 'SURFACE')
-        row.prop_enum(gpd, "draw_mode", 'STROKE')
+        row.prop_enum(ts, propname, 'SURFACE')
+        row.prop_enum(ts, propname, 'STROKE')
 
         row = col.row(align=False)
-        row.active = gpd.draw_mode in {'SURFACE', 'STROKE'}
-        row.prop(gpd, "use_stroke_endpoints")
+        row.active = getattr(ts, propname) in {'SURFACE', 'STROKE'}
+        row.prop(ts, "use_gpencil_stroke_endpoints")
 
 
 class GreasePencilDrawingToolsPanel:
@@ -56,15 +67,19 @@ class GreasePencilDrawingToolsPanel:
 
         col.label(text="Draw:")
         row = col.row(align=True)
-        row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
-        row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
+        row.operator("gpencil.draw", icon='GREASEPENCIL', text="Draw").mode = 'DRAW'
+        row.operator("gpencil.draw", icon='FORCE_CURVE', text="Erase").mode = 'ERASER'  # XXX: Needs a dedicated icon
 
         row = col.row(align=True)
-        row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
-        row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY'
+        row.operator("gpencil.draw", icon='LINE_DATA', text="Line").mode = 'DRAW_STRAIGHT'
+        row.operator("gpencil.draw", icon='MESH_DATA', text="Poly").mode = 'DRAW_POLY'
 
-        row = col.row(align=True)
-        row.prop(context.tool_settings, "use_grease_pencil_sessions", text="Continuous Drawing")
+        sub = col.column(align=True)
+        sub.prop(context.tool_settings, "use_gpencil_additive_drawing", text="Additive Drawing")
+        sub.prop(context.tool_settings, "use_gpencil_continuous_drawing", text="Continuous Drawing")
+
+        col.separator()
+        col.separator()
 
         if context.space_data.type in {'VIEW_3D', 'CLIP_EDITOR'}:
             col.separator()
@@ -74,11 +89,20 @@ class GreasePencilDrawingToolsPanel:
                 row.prop(context.tool_settings, "grease_pencil_source", expand=True)
             elif context.space_data.type == 'CLIP_EDITOR':
                 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:
-            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()
@@ -95,67 +119,103 @@ class GreasePencilStrokeEditPanel:
     bl_label = "Edit Strokes"
     bl_category = "Grease Pencil"
     bl_region_type = 'TOOLS'
+    bl_options = {'DEFAULT_CLOSED'}
 
     @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.operator("gpencil.select_all", text="Select All")
+        col.operator("gpencil.select_border")
+        col.operator("gpencil.select_circle")
+
+        layout.separator()
 
         col = layout.column(align=True)
-        col.prop(gpd, "use_stroke_edit_mode", text="Enable Editing", icon='EDIT', toggle=True)
+        col.operator("gpencil.select_linked")
+        col.operator("gpencil.select_more")
+        col.operator("gpencil.select_less")
 
-        col.separator()
+        layout.separator()
 
-        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")
+        layout.label(text="Edit:")
+        row = layout.row(align=True)
+        row.operator("gpencil.copy", text="Copy")
+        row.operator("gpencil.paste", text="Paste")
 
-        col.separator()
+        col = layout.column(align=True)
+        col.operator("gpencil.delete", text="Delete")
+        col.operator("gpencil.duplicate_move", text="Duplicate")
+        col.operator("transform.mirror", text="Mirror")
 
-        subcol = col.column(align=True)
-        subcol.active = edit_ok
-        subcol.operator("gpencil.select_linked")
-        subcol.operator("gpencil.select_more")
-        subcol.operator("gpencil.select_less")
+        layout.separator()
 
-        col.separator()
+        col = layout.column(align=True)
+        col.operator("transform.translate")                # icon='MAN_TRANS'
+        col.operator("transform.rotate")                   # icon='MAN_ROT'
+        col.operator("transform.resize", text="Scale")     # icon='MAN_SCALE'
 
-        col.label(text="Edit:")
-        row = col.row(align=True)
-        row.active = edit_ok
-        row.operator("gpencil.copy", text="Copy")
-        row.operator("gpencil.paste", text="Paste")
+        layout.separator()
 
-        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("transform.bend", text="Bend")
+        col.operator("transform.shear", text="Shear")
+        col.operator("transform.tosphere", text="To Sphere")
 
-        col.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'
+class GreasePencilStrokeSculptPanel:
+    # subclass must set
+    # bl_space_type = 'IMAGE_EDITOR'
+    bl_label = "Sculpt Strokes"
+    bl_category = "Grease Pencil"
+    bl_region_type = 'TOOLS'
+    bl_options = {'DEFAULT_CLOSED'}
 
-        col.separator()
+    @classmethod
+    def poll(cls, context):
+        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
+        
+        settings = context.tool_settings.gpencil_sculpt
+        tool = settings.tool
+        brush = settings.brush
+        
+        layout.column().prop(settings, "tool", expand=True)
+
+        col = layout.column()
+        col.prop(brush, "size", slider=True)
+        row = col.row(align=True)
+        row.prop(brush, "strength", slider=True)
+        row.prop(brush, "use_pressure_strength", text="")
+        col.prop(brush, "use_falloff")
+
+        layout.separator()
+
+        if settings.tool in {'THICKNESS', 'PINCH', 'TWIST'}:
+            layout.row().prop(brush, "direction", expand=True)
 
-        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
+        layout.separator()
+        layout.prop(settings, "use_select_mask")
+
+        if settings.tool == 'SMOOTH':
+            layout.prop(brush, "affect_pressure")
 
 
 ###############################
@@ -190,14 +250,14 @@ class GPENCIL_PIE_tool_palette(Menu):
         if gpd:
             if gpd.use_stroke_edit_mode and context.editable_gpencil_strokes:
                 # S - Exit Edit Mode
-                pie.prop(gpd, "use_stroke_edit_mode", text="Exit Edit Mode", icon='EDIT')
+                pie.operator("gpencil.editmode_toggle", text="Exit Edit Mode", icon='EDIT')
 
                 # N - Transforms
                 col = pie.column()
                 row = col.row(align=True)
-                row.operator("transform.translate", icon='MAN_TRANS').gpencil_strokes = True
-                row.operator("transform.rotate", icon='MAN_ROT').gpencil_strokes = True
-                row.operator("transform.resize", text="Scale", icon='MAN_SCALE').gpencil_strokes = True
+                row.operator("transform.tr

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list