[Bf-blender-cvs] [03082dd1dd0] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object
Antonio Vazquez
noreply at git.blender.org
Tue Jul 3 19:48:02 CEST 2018
Commit: 03082dd1dd0604916d0e14623ca26ce9369ab35e
Author: Antonio Vazquez
Date: Tue Jul 3 19:46:29 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB03082dd1dd0604916d0e14623ca26ce9369ab35e
Merge branch 'blender2.8' into greasepencil-object
Conflicts:
release/scripts/startup/bl_ui/space_view3d.py
===================================================================
===================================================================
diff --cc release/scripts/startup/bl_ui/space_view3d.py
index e98456bbc31,f5d451a1189..a9f7cb382db
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@@ -4118,39 -4105,98 +4147,131 @@@ class VIEW3D_PT_overlay_paint(Panel)
col.prop(overlay, "show_paint_wire")
+ class VIEW3D_PT_pivot_point(Panel):
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'HEADER'
+ bl_label = "Pivot Point"
+
+ def draw(self, context):
+ toolsettings = context.tool_settings
+ obj = context.active_object
+ mode = context.mode
+
+ layout = self.layout
+ col = layout.column()
+ col.label("Pivot Point")
+ col.prop(toolsettings, "transform_pivot_point", expand=True)
+
+ col.separator()
+
+ if (obj is None) or (mode in {'OBJECT', 'POSE', 'WEIGHT_PAINT'}):
+ col.prop(
+ toolsettings,
+ "use_transform_pivot_point_align",
+ text="Center Points Only",
+ )
+
+
+ class VIEW3D_PT_snapping(Panel):
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'HEADER'
+ bl_label = "Snapping"
+
+ def draw(self, context):
+ toolsettings = context.tool_settings
+ snap_elements = toolsettings.snap_elements
+ obj = context.active_object
+ mode = context.mode
+ object_mode = 'OBJECT' if obj is None else obj.mode
+
+ layout = self.layout
+ col = layout.column()
+ col.label("Snapping")
+ col.prop(toolsettings, "snap_elements", expand=True)
+
+ col.separator()
+ if 'INCREMENT' in snap_elements:
+ col.prop(toolsettings, "use_snap_grid_absolute")
+
+ if snap_elements != {'INCREMENT'}:
+ col.label("Target")
+ row = col.row(align=True)
+ row.prop(toolsettings, "snap_target", expand=True)
+
+ if obj:
+ if object_mode == 'EDIT':
+ col.prop(toolsettings, "use_snap_self")
+ if object_mode in {'OBJECT', 'POSE', 'EDIT'}:
+ col.prop(toolsettings, "use_snap_align_rotation", text="Align Rotation")
+
+ if 'FACE' in snap_elements:
+ col.prop(toolsettings, "use_snap_project", text="Project Elements")
+
+ if 'VOLUME' in snap_elements:
+ col.prop(toolsettings, "use_snap_peel_object")
+
+
+ class VIEW3D_PT_transform_orientations(Panel):
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'HEADER'
+ bl_label = "Transform Orientations"
+
+ @classmethod
+ def poll(cls, context):
+ view = context.space_data
+ return (view)
+
+ def draw(self, context):
+ layout = self.layout
+ layout.label("Transform Orientations")
+
+ scene = context.scene
+ orientation = scene.current_orientation
+
+ row = layout.row()
+ col = row.column()
+ col.prop(scene, "transform_orientation", expand=True)
+ row.operator("transform.create_orientation", text="", icon='ZOOMIN', emboss=False).use = True
+
+ if orientation:
+ row = layout.row(align=False)
+ row.prop(orientation, "name", text="")
+ row.operator("transform.delete_orientation", text="", icon='X', emboss=False)
+
+
+class VIEW3D_PT_overlay_gpencil_paper(Panel):
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'HEADER'
+ bl_parent_id = 'VIEW3D_PT_overlay'
+ bl_label = ""
+
+ @classmethod
+ def poll(cls, context):
+ return context.mode in {'GPENCIL_PAINT', 'GPENCIL_SCULPT'}
+
+ def draw_header(self, context):
+ view = context.space_data
+ self.layout.prop(view, "use_gpencil_paper", text="Drawing Paper")
+
+ def draw(self, context):
+ layout = self.layout
+ view = context.space_data
+ layout.active = view.use_gpencil_paper
+
+ row = layout.row()
+ row.prop(view, "gp_paper_color", text="Color")
+ row = layout.row()
+ row.prop(view, "gp_paper_opacity", text="Opacity")
+
+ row = layout.row(align=False)
+ row.prop(view, "use_gpencil_grid", text="Display Grid")
+
+ row = layout.row(align=False)
+ col = row.column(align=True)
+ col.enabled = view.use_gpencil_grid
+ col.prop(view, "gpencil_grid_size", text="")
+
+
class VIEW3D_PT_quad_view(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
@@@ -4435,7 -4451,9 +4556,10 @@@ classes =
VIEW3D_PT_overlay_pose,
VIEW3D_PT_overlay_paint,
VIEW3D_PT_overlay_sculpt,
+ VIEW3D_PT_pivot_point,
+ VIEW3D_PT_snapping,
+ VIEW3D_PT_transform_orientations,
+ VIEW3D_PT_overlay_gpencil_paper,
VIEW3D_PT_context_properties,
)
diff --cc source/blender/draw/intern/draw_manager.c
index 94a0141a5dd,ea25739e52d..764c27f0768
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@@ -1247,12 -1235,9 +1247,10 @@@ void DRW_draw_render_loop_ex
Scene *scene = DEG_get_evaluated_scene(depsgraph);
ViewLayer *view_layer = DEG_get_evaluated_view_layer(depsgraph);
RegionView3D *rv3d = ar->regiondata;
+ bool do_annotations = (v3d->flag2 & V3D_SHOW_GPENCIL) != 0;
DST.draw_ctx.evil_C = evil_C;
-
DST.viewport = viewport;
- v3d->zbuf = true;
/* Setup viewport */
GPU_viewport_engines_data_validate(DST.viewport, DRW_engines_get_hash());
diff --cc source/blender/editors/gpencil/gpencil_ops.c
index 90429ad454a,3f114a4dd4a..fd96b10e779
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@@ -113,88 -121,72 +113,90 @@@ static bool gp_stroke_editmode_poll(bCo
return (gpd && (gpd->flag & GP_DATA_STROKE_EDITMODE));
}
-/* Stroke Editing Keymap - Only when editmode is enabled */
-static void ed_keymap_gpencil_editing(wmKeyConfig *keyconf)
+/* Poll callback for stroke painting mode */
+static bool gp_stroke_paintmode_poll(bContext *C)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "Grease Pencil Stroke Edit Mode", 0, 0);
- wmKeyMapItem *kmi;
-
- /* set poll callback - so that this keymap only gets enabled when stroke editmode is enabled */
- keymap->poll = gp_stroke_editmode_poll;
-
- /* ----------------------------------------------- */
-
- /* Exit EditMode */
- WM_keymap_add_item(keymap, "GPENCIL_OT_editmode_toggle", TABKEY, KM_PRESS, 0, 0);
-
- /* Pie Menu - For settings/tools easy access */
- WM_keymap_add_menu_pie(keymap, "GPENCIL_MT_pie_sculpt", EKEY, KM_PRESS, 0, DKEY);
-
- /* Brush Settings */
- /* NOTE: We cannot expose these in the standard keymap, as they will interfere with regular hotkeys
- * in other modes. However, when we are dealing with Stroke Edit Mode, we know for certain
- * that the only data being edited is that of the Grease Pencil strokes
- */
-
- /* CTRL + FKEY = Eraser Radius */
- kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, KM_CTRL, 0);
- RNA_string_set(kmi->ptr, "data_path_primary", "user_preferences.edit.grease_pencil_eraser_radius");
-
- /* Interpolation */
- WM_keymap_add_item(keymap, "GPENCIL_OT_interpolate", EKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
- WM_keymap_add_item(keymap, "GPENCIL_OT_interpolate_sequence", EKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
+ /* TODO: limit this to mode, but review 2D editors */
+ bGPdata *gpd = CTX_data_gpencil_data(C);
+ return (gpd && (gpd->flag & GP_DATA_STROKE_PAINTMODE));
+}
- /* Sculpting ------------------------------------- */
+/* Poll callback for stroke painting (draw brush) */
+static bool gp_stroke_paintmode_draw_poll(bContext *C)
+{
+ /* TODO: limit this to mode, but review 2D editors */
+ bGPdata *gpd = CTX_data_gpencil_data(C);
+ ToolSettings *ts = CTX_data_tool_settings(C);
+ Brush *brush = BKE_brush_getactive_gpencil(ts);
+ return (gpd && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush)
+ && (brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_DRAW));
+}
- /* Brush-Based Editing:
- * EKEY + LMB = Single stroke, draw immediately
- * + Other Modifiers (Ctrl/Shift) = Invert, Smooth, etc.
- *
- * For the modal version, use D+E -> Sculpt
- */
- kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_brush_paint", LEFTMOUSE, KM_PRESS, 0, EKEY);
- RNA_boolean_set(kmi->ptr, "wait_for_input", false);
+/* Poll callback for stroke painting (erase brush) */
+static bool gp_stroke_paintmode_erase_poll(bContext *C)
+{
+ /* TODO: limit this to mode, but review 2D editors */
+ bGPdata *gpd = CTX_data_gpencil_data(C);
+ ToolSettings *ts = CTX_data_tool_settings(C);
+ Brush *brush = BKE_brush_getactive_gpencil(ts);
+ return (gpd && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush)
+ && (brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_ERASE));
+}
- kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_brush_paint", LEFTMOUSE, KM_PRESS, KM_CTRL, EKEY);
- RNA_boolean_set(kmi->ptr, "wait_for_input", false);
- /*RNA_boolean_set(kmi->ptr, "use_invert", true);*/
+/* Poll callback for stroke painting (fill) */
+static bool gp_stroke_paintmode_fill_poll(bContext *C)
+{
+ /* TODO: limit this to mode, but review 2D editors */
+ bGPdata *gpd = CTX_data_gpencil_data(C);
+ ToolSettings *ts = CTX_data_tool_settings(C);
+ Brush *brush = BKE_brush_getactive_gpencil(ts);
+ return (gpd && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush)
+ && (brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_FILL));
+}
- kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_brush_paint", LEFTMOUSE, KM_PRESS, KM_SHIFT, EKEY);
- RNA_boolean_set(kmi->ptr, "wait_for_input", false);
- /*RNA_boolean_set(kmi->ptr, "use_smooth", true);*/
+/* Poll callback for stroke sculpting mode */
+static bool gp_stroke_sculptmode_poll(bContext *C)
+{
+ bGPdata *gpd = CTX_data_gpencil_data(C);
+ Object *ob = CTX_data_active_object(C);
+ ScrArea *sa = CTX_wm_area(C);
+
+ /* if not gpencil object and not view3d, need sculpt keys if edit mode */
+ if (sa->spacetype != SPACE_VIEW3D) {
+ return ((gpd) && (gpd->flag &
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list