From f185cc0ca55c8c817903d53bf5c107f3efd4e0db Mon Sep 17 00:00:00 2001 From: mano-wii Date: Fri, 11 Oct 2019 16:11:57 -0300 Subject: [PATCH 1/7] Fix T70729: Multi-object edit UV not transform all meshes Detail that went unnoticed in rBbfc9d426bb95 --- source/blender/editors/transform/transform_convert_mesh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/transform/transform_convert_mesh.c b/source/blender/editors/transform/transform_convert_mesh.c index 7f9c4ee2fcc..f1928433491 100644 --- a/source/blender/editors/transform/transform_convert_mesh.c +++ b/source/blender/editors/transform/transform_convert_mesh.c @@ -1451,7 +1451,7 @@ void createTransUVs(bContext *C, TransInfo *t) const bool use_facesel = (ts->uv_flag & UV_SYNC_SELECTION) == 0; elementmap = BM_uv_element_map_create(em->bm, use_facesel, false, true); if (elementmap == NULL) { - return; + continue; } if (is_prop_connected) { From 3842519a387ede582950c96d155c74dce3c4c059 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 11 Oct 2019 21:29:46 +0200 Subject: [PATCH 2/7] Revert "Merge branch 'master' into blender-v2.81-release" This reverts commit 20b2acf336cb8f6965fd39728a746922d1b8ae42, reversing changes made to f185cc0ca55c8c817903d53bf5c107f3efd4e0db. Merges should only go form the release branch to master. For backporting commits, use cherry-pick. --- .github/stale.yml | 22 -- doc/doxygen/Doxyfile | 2 +- release/scripts/addons | 2 +- .../keyconfig/keymap_data/blender_default.py | 13 - .../startup/bl_ui/properties_paint_common.py | 38 +- .../startup/bl_ui/space_toolsystem_toolbar.py | 13 - release/scripts/startup/bl_ui/space_view3d.py | 23 +- .../startup/bl_ui/space_view3d_toolbar.py | 3 +- .../blender/blenkernel/BKE_blender_version.h | 6 +- .../blender/editors/interface/CMakeLists.txt | 1 - .../editors/interface/interface_eyedropper.c | 1 - .../interface_eyedropper_gpencil_color.c | 324 ------------------ .../editors/interface/interface_intern.h | 3 - .../blender/editors/interface/interface_ops.c | 1 - .../editors/space_view3d/view3d_draw.c | 8 +- source/tools | 2 +- 16 files changed, 31 insertions(+), 431 deletions(-) delete mode 100644 .github/stale.yml delete mode 100644 source/blender/editors/interface/interface_eyedropper_gpencil_color.c diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 9c563f2dee0..00000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale -# This file is used on Blender's GitHub mirror to automatically close any pull request -# and invite contributors to join the official development platform on blender.org - -# Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 1 - -# Number of days of inactivity before an Issue or Pull Request with the stale label is closed. -# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 1 - -# Label to use when marking as stale -staleLabel: stale - -# Comment to post when closing a stale Issue or Pull Request. -closeComment: > - This issue has been automatically closed, because this repository is only - used as a mirror of git.blender.org. Blender development happens on - developer.blender.org. - - To get started contributing code, please read: - https://wiki.blender.org/wiki/Process/Contributing_Code diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile index 4380b94890a..366d0b1b507 100644 --- a/doc/doxygen/Doxyfile +++ b/doc/doxygen/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = Blender # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "V2.82" +PROJECT_NUMBER = "V2.81" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/release/scripts/addons b/release/scripts/addons index 7a6516c3e98..120d31a17c0 160000 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit 7a6516c3e98ffa9cec21f490be733ee6d49a6424 +Subproject commit 120d31a17c0eb571420b828425fc1fe6ef13db2d diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 74492f2a101..0728cbf8f9f 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -5869,18 +5869,6 @@ def km_3d_view_tool_paint_gpencil_cutter(params): ) -def km_3d_view_tool_paint_gpencil_eyedropper(params): - return ( - "3D View Tool: Paint Gpencil, Eyedropper", - {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, - {"items": [ - ("ui.eyedropper_gpencil_color", {"type": params.tool_mouse, "value": 'PRESS'}, None), - ("ui.eyedropper_gpencil_color", {"type": params.tool_mouse, "value": 'PRESS', "shift": True}, None), - ("ui.eyedropper_gpencil_color", {"type": params.tool_mouse, "value": 'PRESS', "shift": True, "ctrl": True}, None), - ]}, - ) - - def km_3d_view_tool_edit_gpencil_select(params): return ( "3D View Tool: Edit Gpencil, Tweak", @@ -6218,7 +6206,6 @@ def generate_keymaps(params=None): km_3d_view_tool_paint_gpencil_arc(params), km_3d_view_tool_paint_gpencil_curve(params), km_3d_view_tool_paint_gpencil_cutter(params), - km_3d_view_tool_paint_gpencil_eyedropper(params), km_3d_view_tool_edit_gpencil_select(params), km_3d_view_tool_edit_gpencil_select_box(params), km_3d_view_tool_edit_gpencil_select_circle(params), diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index c201ccbe7f8..23b2556eddb 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -367,7 +367,7 @@ def brush_basic_sculpt_settings(layout, context, brush, *, compact=False): layout.row().prop(brush, "direction", expand=True, **({"text": ""} if compact else {})) -def brush_basic_gpencil_paint_settings(layout, _context, brush, tool, *, compact=True, is_toolbar=False): +def brush_basic_gpencil_paint_settings(layout, _context, brush, *, compact=True): gp_settings = brush.gpencil_settings # Brush details @@ -395,23 +395,6 @@ def brush_basic_gpencil_paint_settings(layout, _context, brush, tool, *, compact row = layout.row(align=True) row.prop(gp_settings, "fill_draw_mode", text="Boundary") row.prop(gp_settings, "show_fill_boundary", text="", icon='GRID') - # Fill options - if is_toolbar: - settings = _context.tool_settings.gpencil_sculpt - row = layout.row(align=True) - sub = row.row(align=True) - sub.popover( - panel="TOPBAR_PT_gpencil_fill", - text="Fill Options", - ) - else: - row = layout.row(align=True) - row.prop(gp_settings, "fill_factor", text="Resolution") - if gp_settings.fill_draw_mode != 'STROKE': - row = layout.row(align=True) - row.prop(gp_settings, "show_fill", text="Ignore Transparent Strokes") - row = layout.row(align=True) - row.prop(gp_settings, "fill_threshold", text="Threshold") else: # brush.gpencil_tool == 'DRAW': row = layout.row(align=True) row.prop(brush, "size", text="Radius") @@ -419,25 +402,6 @@ def brush_basic_gpencil_paint_settings(layout, _context, brush, tool, *, compact row = layout.row(align=True) row.prop(gp_settings, "pen_strength", slider=True) row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE') - - if tool.idname in {"builtin.arc", "builtin.curve", "builtin.line", "builtin.box", "builtin.circle"}: - settings = _context.tool_settings.gpencil_sculpt - if is_toolbar: - row = layout.row(align=True) - row.prop(settings, "use_thickness_curve", text="", icon='CURVE_DATA') - sub = row.row(align=True) - sub.active = settings.use_thickness_curve - sub.popover( - panel="TOPBAR_PT_gpencil_primitive", - text="Thickness Profile", - ) - else: - row = layout.row(align=True) - row.prop(settings, "use_thickness_curve", text="Use Thickness Profile") - sub = row.row(align=True) - if settings.use_thickness_curve: - # Curve - layout.template_curve_mapping(settings, "thickness_primitive_curve", brush=True) def brush_basic_gpencil_sculpt_settings(layout, context, brush, *, compact=False): diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 112151d3478..4bce8a95528 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -1393,17 +1393,6 @@ class _defs_gpencil_paint: ) - @ToolDef.from_fn - def eyedropper(): - return dict( - idname="builtin.eyedropper", - label="Eyedropper", - icon="ops.paint.weight_sample", - cursor='EYEDROPPER', - widget=None, - keymap=(), - ) - class _defs_gpencil_edit: @ToolDef.from_fn def bend(): @@ -2055,8 +2044,6 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel): _defs_gpencil_paint.generate_from_brushes, _defs_gpencil_paint.cutter, None, - _defs_gpencil_paint.eyedropper, - None, _defs_gpencil_paint.line, _defs_gpencil_paint.arc, _defs_gpencil_paint.curve, diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 5ad1dec9480..7d13c9c4112 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -351,7 +351,28 @@ class _draw_tool_settings_context_mode: from bl_ui.properties_paint_common import ( brush_basic_gpencil_paint_settings, ) - brush_basic_gpencil_paint_settings(layout, context, brush, tool, compact=True, is_toolbar=True) + brush_basic_gpencil_paint_settings(layout, context, brush, compact=True) + + # FIXME: tools must use their own UI drawing! + if tool.idname in {"builtin.arc", "builtin.curve", "builtin.line", "builtin.box", "builtin.circle"}: + settings = context.tool_settings.gpencil_sculpt + row = layout.row(align=True) + row.prop(settings, "use_thickness_curve", text="", icon='CURVE_DATA') + sub = row.row(align=True) + sub.active = settings.use_thickness_curve + sub.popover( + panel="TOPBAR_PT_gpencil_primitive", + text="Thickness Profile", + ) + + if brush.gpencil_tool == 'FILL': + settings = context.tool_settings.gpencil_sculpt + row = layout.row(align=True) + sub = row.row(align=True) + sub.popover( + panel="TOPBAR_PT_gpencil_fill", + text="Fill Options", + ) @staticmethod def SCULPT_GPENCIL(context, layout, tool): diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 8da5ba67187..3aee14e0239 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1873,8 +1873,7 @@ class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel): from bl_ui.properties_paint_common import ( brush_basic_gpencil_paint_settings, ) - tool = context.workspace.tools.from_space_view3d_mode(context.mode, create=False) - brush_basic_gpencil_paint_settings(layout, context, brush, tool, compact=True, is_toolbar=False) + brush_basic_gpencil_paint_settings(layout, context, brush, compact=True) # Grease Pencil drawing brushes options diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 9bd90f76b79..a1900c1af94 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -26,8 +26,8 @@ * * \note Use #STRINGIFY() rather than defining with quotes. */ -#define BLENDER_VERSION 282 -#define BLENDER_SUBVERSION 0 +#define BLENDER_VERSION 281 +#define BLENDER_SUBVERSION 15 /** Several breakages with 280, e.g. collections vs layers. */ #define BLENDER_MINVERSION 280 #define BLENDER_MINSUBVERSION 0 @@ -36,7 +36,7 @@ /** Can be left blank, otherwise a,b,c... etc with no quotes. */ #define BLENDER_VERSION_CHAR /** alpha/beta/rc/release, docs use this. */ -#define BLENDER_VERSION_CYCLE alpha +#define BLENDER_VERSION_CYCLE beta /** Optionally set to 1,2,... for example to to get alpha1 or rc2. */ #define BLENDER_VERSION_CYCLE_NUMBER diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt index d33023c69a1..bc8d25e8d9e 100644 --- a/source/blender/editors/interface/CMakeLists.txt +++ b/source/blender/editors/interface/CMakeLists.txt @@ -50,7 +50,6 @@ set(SRC interface_eyedropper_datablock.c interface_eyedropper_depth.c interface_eyedropper_driver.c - interface_eyedropper_gpencil_color.c interface_handlers.c interface_icons.c interface_icons_event.c diff --git a/source/blender/editors/interface/interface_eyedropper.c b/source/blender/editors/interface/interface_eyedropper.c index 988dea270f5..3c26c37b610 100644 --- a/source/blender/editors/interface/interface_eyedropper.c +++ b/source/blender/editors/interface/interface_eyedropper.c @@ -69,7 +69,6 @@ wmKeyMap *eyedropper_modal_keymap(wmKeyConfig *keyconf) WM_modalkeymap_assign(keymap, "UI_OT_eyedropper_id"); WM_modalkeymap_assign(keymap, "UI_OT_eyedropper_depth"); WM_modalkeymap_assign(keymap, "UI_OT_eyedropper_driver"); - WM_modalkeymap_assign(keymap, "UI_OT_eyedropper_gpencil_color"); return keymap; } diff --git a/source/blender/editors/interface/interface_eyedropper_gpencil_color.c b/source/blender/editors/interface/interface_eyedropper_gpencil_color.c deleted file mode 100644 index 02d4596e93c..00000000000 --- a/source/blender/editors/interface/interface_eyedropper_gpencil_color.c +++ /dev/null @@ -1,324 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2009 Blender Foundation. - * All rights reserved. - */ - -/** \file - * \ingroup edinterface - * - * Eyedropper (RGB Color) - * - * Defines: - * - #UI_OT_eyedropper_gpencil_color - */ - -#include "MEM_guardedalloc.h" - -#include "BLI_string.h" - -#include "BLT_translation.h" - -#include "DNA_gpencil_types.h" -#include "DNA_space_types.h" - -#include "BKE_context.h" -#include "BKE_gpencil.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_report.h" - -#include "UI_interface.h" - -#include "IMB_colormanagement.h" - -#include "WM_api.h" -#include "WM_types.h" - -#include "RNA_access.h" -#include "RNA_define.h" - -#include "ED_gpencil.h" -#include "ED_screen.h" -#include "ED_undo.h" - -#include "DEG_depsgraph.h" -#include "DEG_depsgraph_build.h" - -#include "interface_intern.h" -#include "interface_eyedropper_intern.h" - -typedef struct EyedropperGPencil { - struct ColorManagedDisplay *display; - /** color under cursor RGB */ - float color[3]; -} EyedropperGPencil; - -/* Helper: Draw status message while the user is running the operator */ -static void eyedropper_gpencil_status_indicators(bContext *C) -{ - char msg_str[UI_MAX_DRAW_STR]; - BLI_strncpy( - msg_str, TIP_("LMB: Stroke - Shift: Fill - Shift+Ctrl: Stroke + Fill"), UI_MAX_DRAW_STR); - - ED_workspace_status_text(C, msg_str); -} - -/* Initialize. */ -static bool eyedropper_gpencil_init(bContext *C, wmOperator *op) -{ - EyedropperGPencil *eye = MEM_callocN(sizeof(EyedropperGPencil), __func__); - - op->customdata = eye; - Scene *scene = CTX_data_scene(C); - - const char *display_device; - display_device = scene->display_settings.display_device; - eye->display = IMB_colormanagement_display_get_named(display_device); - - return true; -} - -/* Exit and free memory. */ -static void eyedropper_gpencil_exit(bContext *C, wmOperator *op) -{ - /* Clear status message area. */ - ED_workspace_status_text(C, NULL); - - MEM_SAFE_FREE(op->customdata); -} - -/* Set the material. */ -static void eyedropper_gpencil_color_set(bContext *C, const wmEvent *event, EyedropperGPencil *eye) -{ - Main *bmain = CTX_data_main(C); - Object *ob = CTX_data_active_object(C); - Material *ma = NULL; - - const bool only_stroke = ((!event->ctrl) && (!event->shift)); - const bool only_fill = ((!event->ctrl) && (event->shift)); - const bool both = ((event->ctrl) && (event->shift)); - - float col_conv[4]; - bool found = false; - - /* Convert from linear rgb space to display space because grease pencil colors are in display - * space, and this conversion is needed to undo the conversion to linear performed by - * eyedropper_color_sample_fl. */ - if (eye->display) { - copy_v3_v3(col_conv, eye->color); - IMB_colormanagement_scene_linear_to_display_v3(col_conv, eye->display); - } - else { - copy_v3_v3(col_conv, eye->color); - } - - /* Look for a similar material in grease pencil slots. */ - short *totcol = give_totcolp(ob); - for (short i = 0; i < *totcol; i++) { - ma = give_current_material(ob, i + 1); - if (ma == NULL) { - continue; - } - - MaterialGPencilStyle *gp_style = ma->gp_style; - if (gp_style != NULL) { - /* Check stroke color. */ - bool found_stroke = compare_v3v3(gp_style->stroke_rgba, col_conv, 0.01f) && - (gp_style->flag & GP_STYLE_STROKE_SHOW); - /* Check fill color. */ - bool found_fill = compare_v3v3(gp_style->fill_rgba, col_conv, 0.01f) && - (gp_style->flag & GP_STYLE_FILL_SHOW); - - if ((only_stroke) && (found_stroke) && ((gp_style->flag & GP_STYLE_FILL_SHOW) == 0)) { - found = true; - } - else if ((only_fill) && (found_fill) && ((gp_style->flag & GP_STYLE_STROKE_SHOW) == 0)) { - found = true; - } - else if ((both) && (found_stroke) && (found_fill)) { - found = true; - } - - /* Found existing material. */ - if (found) { - ob->actcol = i + 1; - WM_main_add_notifier(NC_MATERIAL | ND_SHADING_LINKS, NULL); - WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, NULL); - return; - } - } - } - - /* If material was not found add a new material with stroke and/or fill color - * depending of the secondary key (LMB: Stroke, Shift: Fill, Shift+Ctrl: Stroke/Fill) - */ - int idx; - Material *ma_new = BKE_gpencil_object_material_new(bmain, ob, "Material", &idx); - WM_main_add_notifier(NC_OBJECT | ND_OB_SHADING, &ob->id); - WM_main_add_notifier(NC_MATERIAL | ND_SHADING_LINKS, NULL); - DEG_relations_tag_update(bmain); - - BLI_assert(ma_new != NULL); - - MaterialGPencilStyle *gp_style_new = ma_new->gp_style; - BLI_assert(gp_style_new != NULL); - - /* Only create Stroke (default option). */ - if (only_stroke) { - /* Stroke color. */ - gp_style_new->flag |= GP_STYLE_STROKE_SHOW; - gp_style_new->flag &= ~GP_STYLE_FILL_SHOW; - copy_v3_v3(gp_style_new->stroke_rgba, col_conv); - zero_v4(gp_style_new->fill_rgba); - } - /* Fill Only. */ - else if (only_fill) { - /* Fill color. */ - gp_style_new->flag &= ~GP_STYLE_STROKE_SHOW; - gp_style_new->flag |= GP_STYLE_FILL_SHOW; - zero_v4(gp_style_new->stroke_rgba); - copy_v3_v3(gp_style_new->fill_rgba, col_conv); - } - /* Stroke and Fill. */ - else if (both) { - gp_style_new->flag |= GP_STYLE_STROKE_SHOW | GP_STYLE_FILL_SHOW; - copy_v3_v3(gp_style_new->stroke_rgba, col_conv); - copy_v3_v3(gp_style_new->fill_rgba, col_conv); - } - /* Push undo for new created material. */ - ED_undo_push(C, "Add Grease Pencil Material"); -} - -/* Sample the color below cursor. */ -static void eyedropper_gpencil_color_sample(bContext *C, EyedropperGPencil *eye, int mx, int my) -{ - eyedropper_color_sample_fl(C, mx, my, eye->color); -} - -/* Cancel operator. */ -static void eyedropper_gpencil_cancel(bContext *C, wmOperator *op) -{ - eyedropper_gpencil_exit(C, op); -} - -/* Main modal status check. */ -static int eyedropper_gpencil_modal(bContext *C, wmOperator *op, const wmEvent *event) -{ - EyedropperGPencil *eye = (EyedropperGPencil *)op->customdata; - /* Handle modal keymap */ - switch (event->type) { - case EVT_MODAL_MAP: { - switch (event->val) { - case EYE_MODAL_SAMPLE_BEGIN: { - return OPERATOR_RUNNING_MODAL; - } - case EYE_MODAL_CANCEL: { - eyedropper_gpencil_cancel(C, op); - return OPERATOR_CANCELLED; - } - case EYE_MODAL_SAMPLE_CONFIRM: { - eyedropper_gpencil_color_sample(C, eye, event->x, event->y); - - /* Create material. */ - eyedropper_gpencil_color_set(C, event, eye); - WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL); - - eyedropper_gpencil_exit(C, op); - return OPERATOR_FINISHED; - break; - } - default: { - break; - } - } - break; - } - case MOUSEMOVE: - case INBETWEEN_MOUSEMOVE: { - eyedropper_gpencil_color_sample(C, eye, event->x, event->y); - break; - } - default: { - break; - } - } - - return OPERATOR_RUNNING_MODAL; -} - -/* Modal Operator init */ -static int eyedropper_gpencil_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) -{ - /* Init. */ - if (eyedropper_gpencil_init(C, op)) { - /* Add modal temp handler. */ - WM_event_add_modal_handler(C, op); - /* Status message. */ - eyedropper_gpencil_status_indicators(C); - - return OPERATOR_RUNNING_MODAL; - } - else { - return OPERATOR_PASS_THROUGH; - } -} - -/* Repeat operator */ -static int eyedropper_gpencil_exec(bContext *C, wmOperator *op) -{ - /* init */ - if (eyedropper_gpencil_init(C, op)) { - - /* cleanup */ - eyedropper_gpencil_exit(C, op); - - return OPERATOR_FINISHED; - } - else { - return OPERATOR_PASS_THROUGH; - } -} - -static bool eyedropper_gpencil_poll(bContext *C) -{ - /* Only valid if the current active object is grease pencil. */ - Object *obact = CTX_data_active_object(C); - if ((obact == NULL) || (obact->type != OB_GPENCIL)) { - return false; - } - - /* Test we have a window below. */ - return (CTX_wm_window(C) != NULL); -} - -void UI_OT_eyedropper_gpencil_color(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Grease Pencil Eyedropper"; - ot->idname = "UI_OT_eyedropper_gpencil_color"; - ot->description = "Sample a color from the Blender Window and create Grease Pencil material"; - - /* api callbacks */ - ot->invoke = eyedropper_gpencil_invoke; - ot->modal = eyedropper_gpencil_modal; - ot->cancel = eyedropper_gpencil_cancel; - ot->exec = eyedropper_gpencil_exec; - ot->poll = eyedropper_gpencil_poll; - - /* flags */ - ot->flag = OPTYPE_UNDO | OPTYPE_BLOCKING; -} diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 81979b1fc8f..4351b75eb86 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -971,9 +971,6 @@ void UI_OT_eyedropper_depth(struct wmOperatorType *ot); /* interface_eyedropper_driver.c */ void UI_OT_eyedropper_driver(struct wmOperatorType *ot); -/* interface_eyedropper_gpencil_color.c */ -void UI_OT_eyedropper_gpencil_color(struct wmOperatorType *ot); - /* interface_util.c */ /** diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 7ce4242c697..4e56a02997b 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -1751,7 +1751,6 @@ void ED_operatortypes_ui(void) WM_operatortype_append(UI_OT_eyedropper_id); WM_operatortype_append(UI_OT_eyedropper_depth); WM_operatortype_append(UI_OT_eyedropper_driver); - WM_operatortype_append(UI_OT_eyedropper_gpencil_color); } /** diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 3ee9755cb06..aafd36a5bb8 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1422,24 +1422,18 @@ static void draw_grid_unit_name( { if (!rv3d->is_persp && RV3D_VIEW_IS_AXIS(rv3d->view)) { const char *grid_unit = NULL; - int font_id = BLF_default(); ED_view3d_grid_view_scale(scene, v3d, rv3d, &grid_unit); if (grid_unit) { char numstr[32] = ""; - UI_FontThemeColor(font_id, TH_TEXT_HI); + UI_FontThemeColor(BLF_default(), TH_TEXT_HI); if (v3d->grid != 1.0f) { BLI_snprintf(numstr, sizeof(numstr), "%s x %.4g", grid_unit, v3d->grid); } *yoffset -= U.widget_unit; - BLF_enable(font_id, BLF_SHADOW); - BLF_shadow(font_id, 5, (const float[4]){0.0f, 0.0f, 0.0f, 1.0f}); - BLF_shadow_offset(font_id, 1, -1); BLF_draw_default_ascii( xoffset, *yoffset, 0.0f, numstr[0] ? numstr : grid_unit, sizeof(numstr)); - - BLF_disable(font_id, BLF_SHADOW); } } } diff --git a/source/tools b/source/tools index d8c4ae2c23a..4ad446dbddd 160000 --- a/source/tools +++ b/source/tools @@ -1 +1 @@ -Subproject commit d8c4ae2c23a36d9609d47142dc72f243551258f1 +Subproject commit 4ad446dbddd1b23acc185b8c056474d27b69278b From 60d02b336eaf930825ca548b5849636975656f50 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 11 Oct 2019 21:43:45 +0200 Subject: [PATCH 3/7] Build: also use release branch for source/tools module --- build_files/utils/make_update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py index f845515bb3b..ec72514fdfc 100755 --- a/build_files/utils/make_update.py +++ b/build_files/utils/make_update.py @@ -161,7 +161,7 @@ def submodules_update(args, release_version, branch): ("release/scripts/addons", branch), ("release/scripts/addons_contrib", branch), ("release/datafiles/locale", branch), - ("source/tools", "master"), + ("source/tools", branch), ] # Initialize submodules only if needed. From 95f020c853d6f1c6afc46cd3b3c0f6b8817a1245 Mon Sep 17 00:00:00 2001 From: Arto Kitula Date: Sat, 12 Oct 2019 18:33:34 +0300 Subject: [PATCH 4/7] macOS: add opus to FFMPEG_LIBRARIES --- build_files/cmake/platform/platform_apple.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake index 5cea7a418bd..3ae3b2b66b5 100644 --- a/build_files/cmake/platform/platform_apple.cmake +++ b/build_files/cmake/platform/platform_apple.cmake @@ -157,7 +157,7 @@ if(WITH_CODEC_FFMPEG) avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc - vorbis vorbisenc vorbisfile ogg + vorbis vorbisenc vorbisfile ogg opus vpx swresample) set(FFMPEG_LIBPATH ${FFMPEG}/lib) endif() From e8220dea606d0db5fa554e83ff969de19b95a6e9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 14 Oct 2019 18:37:31 +1100 Subject: [PATCH 5/7] GPU: prevent assert for zero length arrays This could happen with the build modifier. --- source/blender/gpu/intern/gpu_element.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/gpu/intern/gpu_element.c b/source/blender/gpu/intern/gpu_element.c index 166a6236893..518829d1c78 100644 --- a/source/blender/gpu/intern/gpu_element.c +++ b/source/blender/gpu/intern/gpu_element.c @@ -243,7 +243,7 @@ GPUIndexBuf *GPU_indexbuf_create_subrange(GPUIndexBuf *elem_src, uint start, uin { GPUIndexBuf *elem = MEM_callocN(sizeof(GPUIndexBuf), "GPUIndexBuf"); BLI_assert(elem_src && !elem_src->is_subrange); - BLI_assert(start + length <= elem_src->index_len); + BLI_assert((length == 0) || (start + length <= elem_src->index_len)); #if GPU_TRACK_INDEX_RANGE elem->index_type = elem_src->index_type; elem->gl_index_type = elem_src->gl_index_type; From 0fb55ff845fcaa76d9b540c2fbdd3e1b4671a7e7 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 14 Oct 2019 11:12:13 +0200 Subject: [PATCH 6/7] Fix T70787: Duplicating objects with custom property of type ID creates bogus links. Note that the issue also affected animdata handling... Checked all usages of the `BKE_libblock_copy_ex()` function, and think never handling user count here is valid, although a bit risky maybe. But other solution would be to add yet another copy flag, so would rather go with that one for now. --- source/blender/blenkernel/intern/library.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 468d0e97ece..909db9c7b52 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1468,8 +1468,12 @@ void BKE_libblock_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int ori new_id->flag = (new_id->flag & ~copy_idflag_mask) | (id->flag & copy_idflag_mask); + /* We do not want any handling of usercount in code duplicating the data here, we do that all + * at once in id_copy_libmanagement_cb() at the end. */ + const int copy_data_flag = orig_flag | LIB_ID_CREATE_NO_USER_REFCOUNT; + if (id->properties) { - new_id->properties = IDP_CopyProperty_ex(id->properties, flag); + new_id->properties = IDP_CopyProperty_ex(id->properties, copy_data_flag); } /* XXX Again... We need a way to control what we copy in a much more refined way. @@ -1488,10 +1492,9 @@ void BKE_libblock_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int ori if ((flag & LIB_ID_COPY_NO_ANIMDATA) == 0) { /* Note that even though horrors like root nodetrees are not in bmain, the actions they use * in their anim data *are* in bmain... super-mega-hooray. */ - int animdata_flag = orig_flag; - BLI_assert((animdata_flag & LIB_ID_COPY_ACTIONS) == 0 || - (animdata_flag & LIB_ID_CREATE_NO_MAIN) == 0); - iat->adt = BKE_animdata_copy(bmain, iat->adt, animdata_flag); + BLI_assert((copy_data_flag & LIB_ID_COPY_ACTIONS) == 0 || + (copy_data_flag & LIB_ID_CREATE_NO_MAIN) == 0); + iat->adt = BKE_animdata_copy(bmain, iat->adt, copy_data_flag); } else { iat->adt = NULL; From 80fe0ac7ff8cf44cc7f3706ea47270a1e794e1ff Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Mon, 14 Oct 2019 11:55:49 +0200 Subject: [PATCH 7/7] Fix T70581: Node Wrangler output switching broken When executing the node selection operator through Python, or in fact any similar select operator with drag-all-selected support, the operator was enabling modal execution, which should not be done in this case. Reason was simply a wrong default for an internal property. --- source/blender/windowmanager/intern/wm_operator_props.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/windowmanager/intern/wm_operator_props.c b/source/blender/windowmanager/intern/wm_operator_props.c index 395de89c0da..21636153904 100644 --- a/source/blender/windowmanager/intern/wm_operator_props.c +++ b/source/blender/windowmanager/intern/wm_operator_props.c @@ -399,7 +399,7 @@ void WM_operator_properties_select_operation_simple(wmOperatorType *ot) void WM_operator_properties_generic_select(wmOperatorType *ot) { PropertyRNA *prop = RNA_def_boolean( - ot->srna, "wait_to_deselect_others", true, "Wait to Deselect Others", ""); + ot->srna, "wait_to_deselect_others", false, "Wait to Deselect Others", ""); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); RNA_def_int(ot->srna, "mouse_x", 0, INT_MIN, INT_MAX, "Mouse X", "", INT_MIN, INT_MAX);