[Bf-blender-cvs] [c08e8867c13] greasepencil-object: GPencil: Fix merge errors
Commit: c08e8867c1395119c61387848b6bddd791aa0f19 Author: Antonio Vazquez Date: Fri Aug 16 21:33:22 2019 +0200 Branches: greasepencil-object https://developer.blender.org/rBc08e8867c1395119c61387848b6bddd791aa0f19 GPencil: Fix merge errors === M source/blender/editors/gpencil/gpencil_edit.c === diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index f1d2b63cc09..1c70c0cb2c7 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -3353,7 +3353,6 @@ static int gp_strokes_reproject_exec(bContext *C, wmOperator *op) RegionView3D *rv3d = ar->regiondata; SnapObjectContext *sctx = NULL; int oldframe = (int)DEG_get_ctime(depsgraph); - const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd); GP_SpaceConversion gsc = {NULL}; eGP_ReprojectModes mode = RNA_enum_get(op->ptr, "type"); @@ -3369,149 +3368,119 @@ static int gp_strokes_reproject_exec(bContext *C, wmOperator *op) bmain, scene, depsgraph, 0, ar, CTX_wm_view3d(C)); /* Go through each editable + selected stroke, adjusting each of its points one by one... */ - CTX_DATA_BEGIN (C, bGPDlayer *, gpl, editable_gpencil_layers) { -bGPDframe *init_gpf = gpl->actframe; -if (is_multiedit) { - init_gpf = gpl->frames.first; -} -float diff_mat[4][4]; -float inverse_diff_mat[4][4]; -/* calculate difference matrix object */ -ED_gpencil_parent_location(depsgraph, ob, gpd, gpl, diff_mat); -/* Compute inverse matrix for unapplying parenting once instead of doing per-point */ -invert_m4_m4(inverse_diff_mat, diff_mat); + GP_EDITABLE_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) { +if (gps->flag & GP_STROKE_SELECT) { -for (bGPDframe *gpf = init_gpf; gpf; gpf = gpf->next) { - if ((gpf == gpl->actframe) || ((gpf->flag & GP_FRAME_SELECT) && (is_multiedit))) { -if (gpf == NULL) { - continue; -} + /* update frame to get the new location of objects */ + if ((mode == GP_REPROJECT_SURFACE) && (cfra_prv != gpf_->framenum)) { +cfra_prv = gpf_->framenum; +CFRA = gpf_->framenum; +BKE_scene_graph_update_for_newframe(depsgraph, bmain); + } -for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) { - /* skip strokes that are invalid for current view */ - if (ED_gpencil_stroke_can_use(C, gps) == false) { -continue; - } - if ((gps->flag & GP_STROKE_SELECT) == 0) { -continue; + bGPDspoint *pt; + int i; + /* Adjust each point */ + for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) { +float xy[2]; + +/* 3D to Screenspace */ +/* Note: We can't use gp_point_to_xy() here because that uses ints for the + * screenspace coordinates, resulting in lost precision, which in turn causes + * stairstepping artifacts in the final points. + */ +bGPDspoint pt2; +gp_point_to_parent_space(pt, gpstroke_iter.diff_mat, ); +gp_point_to_xy_fl(, gps, , [0], [1]); + +/* Project stroke in one axis */ +if (ELEM(mode, + GP_REPROJECT_FRONT, + GP_REPROJECT_SIDE, + GP_REPROJECT_TOP, + GP_REPROJECT_CURSOR)) { + if (mode != GP_REPROJECT_CURSOR) { +ED_gp_get_drawing_reference(scene, ob, gpl, ts->gpencil_v3d_align, origin); } - - /* update frame to get the new location of objects */ - if ((mode == GP_REPROJECT_SURFACE) && (cfra_prv != gpf->framenum)) { -cfra_prv = gpf->framenum; -CFRA = gpf->framenum; -BKE_scene_graph_update_for_newframe(depsgraph, bmain); + else { +copy_v3_v3(origin, scene->cursor.location); } - bGPDspoint *pt; - int i; - /* Adjust each point */ - for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) { -float xy[2]; - -/* 3D to Screenspace */ -/* Note: We can't use gp_point_to_xy() here because that uses ints for the - * screenspace coordinates, resulting in lost precision, which in turn causes - * stairstepping artifacts in the final points. - */ -bGPDspoint pt2; -gp_point_to_parent_space(pt, diff_mat, ); -gp_point_to_xy_fl(, gps, , [0], [1]); - -/* Project stroke in one axis */ -if (ELEM(mode, - GP_REPROJECT_FRONT, - GP_REPROJECT_SIDE, - GP_REPROJECT_TOP, - GP_REPROJECT_CURSOR)) { - if (mode != GP_REPROJECT_CURSOR) { -
[Bf-blender-cvs] [d853f745963] greasepencil-object: Merge branch 'master' into greasepencil-object
Commit: d853f7459632162b0eac1fb77350a78ecd80f645 Author: Antonio Vazquez Date: Fri Aug 16 21:24:07 2019 +0200 Branches: greasepencil-object https://developer.blender.org/rBd853f7459632162b0eac1fb77350a78ecd80f645 Merge branch 'master' into greasepencil-object Conflicts: source/blender/editors/gpencil/gpencil_edit.c === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e8ffe25eb11] master: PyRNA: include class name in double-register exception
Commit: e8ffe25eb11183bc8a6c1c53e20147b22ed17d2a Author: Campbell Barton Date: Sat Aug 17 04:51:50 2019 +1000 Branches: master https://developer.blender.org/rBe8ffe25eb11183bc8a6c1c53e20147b22ed17d2a PyRNA: include class name in double-register exception Helps debugging errors when classes are registered twice. === M source/blender/python/intern/bpy_rna.c === diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 9a8d8c5ec21..e7fed02fe79 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -8557,9 +8557,10 @@ static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class } if (PyDict_GetItem(((PyTypeObject *)py_class)->tp_dict, bpy_intern_str_bl_rna)) { -PyErr_SetString(PyExc_ValueError, -"register_class(...): " -"already registered as a subclass"); +PyErr_Format(PyExc_ValueError, + "register_class(...): " + "already registered as a subclass '%.200s'", + ((PyTypeObject *)py_class)->tp_name); return NULL; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1e51411db4e] master: Outliner: Fix scenes in scene display not starting open
Commit: 1e51411db4e5bc0f57a531207f13ee64977cc0e6 Author: Nathan Craddock Date: Fri Aug 9 13:51:58 2019 -0600 Branches: master https://developer.blender.org/rB1e51411db4e5bc0f57a531207f13ee64977cc0e6 Outliner: Fix scenes in scene display not starting open === M source/blender/editors/space_outliner/outliner_tree.c === diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 605b5383aec..ec5510cdf84 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -2347,7 +2347,8 @@ void outliner_build_tree( te = outliner_add_element(soops, >tree, sce, NULL, 0, 0); tselem = TREESTORE(te); - if (sce == scene && show_opened) { + /* New scene elements open by default */ + if ((sce == scene && show_opened) || !tselem->used) { tselem->flag &= ~TSE_CLOSED; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fdcae9ed0c7] master: Outliner: Add range extend select and modify keymap
Commit: fdcae9ed0c78eb9e5e01f121256329e8b45d727b Author: Nathan Craddock Date: Fri Aug 9 14:12:29 2019 -0600 Branches: master https://developer.blender.org/rBfdcae9ed0c78eb9e5e01f121256329e8b45d727b Outliner: Add range extend select and modify keymap Modifies selection keymap to be more conventional, with shift click for range selection and ctrl click for extend selection. === M release/scripts/presets/keyconfig/keymap_data/blender_default.py M source/blender/editors/space_outliner/outliner_select.c === diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 67e1abfd73f..8a8722a91c1 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -702,13 +702,11 @@ def km_outliner(params): ("outliner.item_rename", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None), ("outliner.item_rename", {"type": 'F2', "value": 'PRESS'}, None), ("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK'}, - {"properties": [("extend", False), ("recursive", False), ("deselect_all", not params.legacy)]}), -("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True}, - {"properties": [("extend", True), ("recursive", False)]}), + {"properties": [("extend", False), ("deselect_all", not params.legacy)]}), ("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK', "ctrl": True}, - {"properties": [("extend", False), ("recursive", True)]}), -("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True, "ctrl": True}, - {"properties": [("extend", True), ("recursive", True)]}), + {"properties": [("extend", True), ("deselect_all", not params.legacy)]}), +("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True}, + {"properties": [("extend", False), ("extend_range", True), ("deselect_all", not params.legacy)]}), ("outliner.select_box", {"type": 'B', "value": 'PRESS'}, None), ("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, {"properties": [("tweak", True)]}), ("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "shift": True}, diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index e4af3c41d97..19fd4511e50 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -54,13 +54,13 @@ #include "DEG_depsgraph_build.h" #include "ED_armature.h" +#include "ED_gpencil.h" #include "ED_object.h" #include "ED_outliner.h" #include "ED_screen.h" #include "ED_select_utils.h" #include "ED_sequencer.h" #include "ED_undo.h" -#include "ED_gpencil.h" #include "WM_api.h" #include "WM_types.h" @@ -253,9 +253,7 @@ static eOLDrawState active_viewlayer(bContext *C, } /** - * Select object tree: - * CTRL+LMB: Select/Deselect object and all children. - * CTRL+SHIFT+LMB: Add/Remove object and all children. + * Select object tree */ static void do_outliner_object_select_recursive(ViewLayer *view_layer, Object *ob_parent, @@ -1244,6 +1242,68 @@ void outliner_item_select(SpaceOutliner *soops, tselem->flag = new_flag; } +static void do_outliner_range_select_recursive(ListBase *lb, + TreeElement *active, + TreeElement *cursor, + bool *selecting) +{ + for (TreeElement *te = lb->first; te; te = te->next) { +if (*selecting) { + TREESTORE(te)->flag |= TSE_SELECTED; +} + +/* Set state for selection */ +if (te == active || te == cursor) { + *selecting = !*selecting; +} + +if (*selecting) { + TREESTORE(te)->flag |= TSE_SELECTED; +} + +/* Don't look inside closed elements */ +if (!(TREESTORE(te)->flag & TSE_CLOSED)) { + do_outliner_range_select_recursive(>subtree, active, cursor, selecting); +} + } +} + +/* Select a range of items between cursor and active element */ +static void do_outliner_range_select(bContext *C, SpaceOutliner *soops, TreeElement *cursor) +{ + TreeElement *active = outliner_find_element_with_flag(>tree, TSE_ACTIVE); + outliner_flag_set(>tree, TSE_ACTIVE_WALK, false); + + if (!active) { +outliner_item_select(soops, cursor, false, false); +outliner_item_do_activate_from_tree_element(C, cursor, TREESTORE(cursor), false, false); +return; + } + + TreeStoreElem *tselem = TREESTORE(active); + const bool active_selected = (tselem->flag
[Bf-blender-cvs] [6bc6d016c5e] master: Outliner: Fixes to show active and scroll page
Commit: 6bc6d016c5e735b437caa31d1f56fc38ca165702 Author: Nathan Craddock Date: Fri Aug 9 13:51:43 2019 -0600 Branches: master https://developer.blender.org/rB6bc6d016c5e735b437caa31d1f56fc38ca165702 Outliner: Fixes to show active and scroll page Adjusts the scrolling of show active and scroll page operators to use the `outliner_scroll_view` operator to ensure scrolling does not leave the outliner bounds. Also changes show active to expand subtrees containing all instances of the active object, which may be linked to multiple collections. === M source/blender/editors/space_outliner/outliner_edit.c === diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index a708142816a..318d90d0dca 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -1243,20 +1243,17 @@ static int outliner_open_back(TreeElement *te) return retval; } -static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op)) +/* Return element representing the active base or bone in the outliner, or NULL if none exists */ +static TreeElement *outliner_show_active_get_element(bContext *C, + SpaceOutliner *so, + ViewLayer *view_layer) { - SpaceOutliner *so = CTX_wm_space_outliner(C); - ViewLayer *view_layer = CTX_data_view_layer(C); - ARegion *ar = CTX_wm_region(C); - View2D *v2d = >v2d; - TreeElement *te; - int xdelta, ytop; Object *obact = OBACT(view_layer); if (!obact) { -return OPERATOR_CANCELLED; +return NULL; } te = outliner_find_id(so, >tree, >id); @@ -1279,25 +1276,50 @@ static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op)) } } - if (te) { -/* open up tree to active object/bone */ + return te; +} + +static void outliner_show_active(SpaceOutliner *so, ARegion *ar, TreeElement *te, ID *id) +{ + /* open up tree to active object/bone */ + if (TREESTORE(te)->id == id) { if (outliner_open_back(te)) { outliner_set_coordinates(ar, so); } +return; + } -/* make te->ys center of view */ -ytop = te->ys + BLI_rcti_size_y(>mask) / 2; -if (ytop > 0) { - ytop = 0; + for (TreeElement *ten = te->subtree.first; ten; ten = ten->next) { +outliner_show_active(so, ar, ten, id); + } +} + +static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceOutliner *so = CTX_wm_space_outliner(C); + ViewLayer *view_layer = CTX_data_view_layer(C); + ARegion *ar = CTX_wm_region(C); + View2D *v2d = >v2d; + + TreeElement *active_element = outliner_show_active_get_element(C, so, view_layer); + + if (active_element) { +ID *id = TREESTORE(active_element)->id; + +/* Expand all elements in the outliner with matching ID */ +for (TreeElement *te = so->tree.first; te; te = te->next) { + outliner_show_active(so, ar, te, id); } -v2d->cur.ymax = (float)ytop; -v2d->cur.ymin = (float)(ytop - BLI_rcti_size_y(>mask)); +/* Center view on first element found */ +int size_y = BLI_rcti_size_y(>mask) + 1; +int ytop = (active_element->ys + (size_y / 2)); +int delta_y = ytop - v2d->cur.ymax; -/* make te->xs ==> te->xend center of view */ -xdelta = (int)(te->xs - v2d->cur.xmin); -v2d->cur.xmin += xdelta; -v2d->cur.xmax += xdelta; +outliner_scroll_view(ar, delta_y); + } + else { +return OPERATOR_CANCELLED; } ED_region_tag_redraw_no_rebuild(ar); @@ -1323,18 +1345,15 @@ void OUTLINER_OT_show_active(wmOperatorType *ot) static int outliner_scroll_page_exec(bContext *C, wmOperator *op) { ARegion *ar = CTX_wm_region(C); - int dy = BLI_rcti_size_y(>v2d.mask); - int up = 0; + int size_y = BLI_rcti_size_y(>v2d.mask) + 1; - if (RNA_boolean_get(op->ptr, "up")) { -up = 1; - } + bool up = RNA_boolean_get(op->ptr, "up"); - if (up == 0) { -dy = -dy; + if (!up) { +size_y = -size_y; } - ar->v2d.cur.ymin += dy; - ar->v2d.cur.ymax += dy; + + outliner_scroll_view(ar, size_y); ED_region_tag_redraw_no_rebuild(ar); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7ee23928878] master: Outliner: Support box select on click+drag
Commit: 7ee23928878bafb32b53767806f613cc72d10c38 Author: Nathan Craddock Date: Fri Aug 9 14:00:49 2019 -0600 Branches: master https://developer.blender.org/rB7ee23928878bafb32b53767806f613cc72d10c38 Outliner: Support box select on click+drag === M release/scripts/presets/keyconfig/keymap_data/blender_default.py M source/blender/editors/space_outliner/outliner_dragdrop.c M source/blender/editors/space_outliner/outliner_select.c === diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 014671f4f6e..67e1abfd73f 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -710,6 +710,11 @@ def km_outliner(params): ("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True, "ctrl": True}, {"properties": [("extend", True), ("recursive", True)]}), ("outliner.select_box", {"type": 'B', "value": 'PRESS'}, None), +("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, {"properties": [("tweak", True)]}), +("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "shift": True}, + {"properties": [("tweak", True), ("mode", "ADD")]}), +("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "ctrl": True}, + {"properties": [("tweak", True), ("mode", "SUB")]}), ("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS'}, {"properties": [("direction", 'UP')]}), ("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True}, {"properties": [("direction", 'UP'), ("extend", True)]}), diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c index cfbf9c05648..6031ba5cffc 100644 --- a/source/blender/editors/space_outliner/outliner_dragdrop.c +++ b/source/blender/editors/space_outliner/outliner_dragdrop.c @@ -895,6 +895,12 @@ static int outliner_item_drag_drop_invoke(bContext *C, return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); } + float view_mval[2]; + UI_view2d_region_to_view(>v2d, event->mval[0], event->mval[1], _mval[0], _mval[1]); + if (outliner_item_is_co_within_close_toggle(te, view_mval[0])) { +return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); + } + wmDrag *drag = WM_event_start_drag(C, data.icon, WM_DRAG_ID, NULL, 0.0, WM_DRAG_NOP); if (ELEM(GS(data.drag_id->name), ID_OB, ID_GR)) { diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index a279512e84a..e4af3c41d97 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -1428,6 +1428,37 @@ static int outliner_box_select_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } +/* Find if x coordinate is over an icon or name */ +static bool outliner_item_is_co_over_name_icons(TreeElement *te, float view_co_x) +{ + /* Special case: count area left of Scene Collection as empty space */ + bool outside_left = (TREESTORE(te)->type == TSE_VIEW_COLLECTION_BASE) ? + (view_co_x > te->xs + UI_UNIT_X) : + (view_co_x > te->xs); + + return outside_left && (view_co_x < te->xend); +} + +static int outliner_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +{ + SpaceOutliner *soops = CTX_wm_space_outliner(C); + ARegion *ar = CTX_wm_region(C); + float view_mval[2]; + const bool tweak = RNA_boolean_get(op->ptr, "tweak"); + + UI_view2d_region_to_view(>v2d, event->mval[0], event->mval[1], _mval[0], _mval[1]); + + /* Find element clicked on */ + TreeElement *te = outliner_find_item_at_y(soops, >tree, view_mval[1]); + + /* Pass through if click is over name or icons, or not tweak event */ + if (te && tweak && outliner_item_is_co_over_name_icons(te, view_mval[0])) { +return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH; + } + + return WM_gesture_box_invoke(C, op, event); +} + void OUTLINER_OT_select_box(wmOperatorType *ot) { /* identifiers */ @@ -1436,7 +1467,7 @@ void OUTLINER_OT_select_box(wmOperatorType *ot) ot->description = "Use box selection to select tree elements"; /* api callbacks */ - ot->invoke = WM_gesture_box_invoke; + ot->invoke = outliner_box_select_invoke; ot->exec = outliner_box_select_exec; ot->modal = WM_gesture_box_modal; ot->cancel = WM_gesture_box_cancel; @@ -1447,6 +1478,12 @@ void OUTLINER_OT_select_box(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* properties */ + PropertyRNA *prop; + + prop = RNA_def_boolean( + ot->srna, "tweak", false, "Tweak", "Tweak
[Bf-blender-cvs] [252fb489973] master: Outliner: walk navigation operator and openclose fixes
Commit: 252fb4899735ca154cae9147be819f2362f2ba51 Author: Nathan Craddock Date: Thu Aug 8 22:00:57 2019 -0600 Branches: master https://developer.blender.org/rB252fb4899735ca154cae9147be819f2362f2ba51 Outliner: walk navigation operator and openclose fixes Adds a keyboard walk navigation and selection operator to the outliner. Up and down arrow keys walk up and down the list of elements, and left and right will open and close elements if the elements are closed or opened respectively. Holding shift while walking up and down the tree expands the selection. Holding shift while clicking or pressing left and right arrows will expand or collapse all children elements recursively. Pressing enter to openclose the hovered element is removed. Also allows click+drag for openclose of element subtrees. This moves openclose toggling to the openclose operator to remove duplicate code. The outliner tree building is tweaked slightly to set the proper parents in scene display mode for walk select to walk to parents without errors. === M release/scripts/presets/keyconfig/keymap_data/blender_default.py M source/blender/editors/space_outliner/outliner_edit.c M source/blender/editors/space_outliner/outliner_intern.h M source/blender/editors/space_outliner/outliner_ops.c M source/blender/editors/space_outliner/outliner_select.c M source/blender/editors/space_outliner/outliner_tree.c M source/blender/editors/space_outliner/outliner_utils.c M source/blender/editors/space_outliner/space_outliner.c M source/blender/makesdna/DNA_outliner_types.h === diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 3f6a5f0a514..798bdc1fe01 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -709,11 +709,24 @@ def km_outliner(params): ("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True, "ctrl": True}, {"properties": [("extend", True), ("recursive", True)]}), ("outliner.select_box", {"type": 'B', "value": 'PRESS'}, None), -("outliner.item_openclose", {"type": 'RET', "value": 'PRESS'}, +("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS'}, {"properties": [("direction", 'UP')]}), +("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True}, + {"properties": [("direction", 'UP'), ("extend", True)]}), +("outliner.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS'}, {"properties": [("direction", 'DOWN')]}), +("outliner.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True}, + {"properties": [("direction", 'DOWN'), ("extend", True)]}), +("outliner.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS'}, {"properties": [("direction", 'LEFT')]}), +("outliner.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True}, + {"properties": [("direction", 'LEFT'), ("toggle_all", True)]}), +("outliner.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS'}, {"properties": [("direction", 'RIGHT')]}), +("outliner.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True}, + {"properties": [("direction", 'RIGHT'), ("toggle_all", True)]}), +("outliner.item_openclose", {"type": 'LEFTMOUSE', "value": 'CLICK'}, {"properties": [("all", False)]}), -("outliner.item_openclose", {"type": 'RET', "value": 'PRESS', "shift": True}, +("outliner.item_openclose", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True}, {"properties": [("all", True)]}), -("outliner.item_rename", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None), +("outliner.item_openclose", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, + {"properties": [("all", False)]}), ("outliner.operation", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None), ("outliner.item_drag_drop", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None), ("outliner.item_drag_drop", {"type": 'EVT_TWEAK_L', "value": 'ANY', "shift": True}, None), diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 842502ec82f..60b5dbdfc50 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -140,59 +140,108 @@ void OUTLINER_OT_highlight_update(wmOperatorType *ot) /* Toggle Open/Closed --- */ -static int do_outliner_item_openclose( -bContext *C, SpaceOutliner *soops, TreeElement *te, const bool all, const float mval[2]) +/* Open or close a tree element,
[Bf-blender-cvs] [7ba2de8f8f5] master: Outliner: set parent for entire selection
Commit: 7ba2de8f8f5a0b404474eaaf822590781f73a745 Author: Nathan Craddock Date: Fri Aug 9 13:55:58 2019 -0600 Branches: master https://developer.blender.org/rB7ba2de8f8f5a0b404474eaaf822590781f73a745 Outliner: set parent for entire selection Set and clear parents for all elements in the selection in the outliner. This also removes the popup menu for setting the parent to curves, armatures, and lattices. It makes more sense to keep the outliner simple and only do object parenting. === M source/blender/editors/space_outliner/outliner_dragdrop.c === diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c index d8276aa2bbc..cfbf9c05648 100644 --- a/source/blender/editors/space_outliner/outliner_dragdrop.c +++ b/source/blender/editors/space_outliner/outliner_dragdrop.c @@ -326,38 +326,57 @@ static bool parent_drop_poll(bContext *C, return false; } -static int parent_drop_exec(bContext *C, wmOperator *op) +static void parent_drop_set_parents( +bContext *C, ReportList *reports, wmDragID *drag, Object *parent, short parent_type) { - Object *par = NULL, *ob = NULL; Main *bmain = CTX_data_main(C); - Scene *scene = CTX_data_scene(C); - int partype = -1; - char parname[MAX_NAME], childname[MAX_NAME]; + SpaceOutliner *soops = CTX_wm_space_outliner(C); - partype = RNA_enum_get(op->ptr, "type"); - RNA_string_get(op->ptr, "parent", parname); - par = (Object *)BKE_libblock_find_name(bmain, ID_OB, parname); - RNA_string_get(op->ptr, "child", childname); - ob = (Object *)BKE_libblock_find_name(bmain, ID_OB, childname); + TreeElement *te = outliner_find_id(soops, >tree, >id); + Scene *scene = (Scene *)outliner_search_back(soops, te, ID_SCE); - if (ID_IS_LINKED(ob)) { -BKE_report(op->reports, RPT_INFO, "Can't edit library linked object"); -return OPERATOR_CANCELLED; + if (scene == NULL) { +/* currently outliner organized in a way, that if there's no parent scene + * element for object it means that all displayed objects belong to + * active scene and parenting them is allowed (sergey) + */ + +scene = CTX_data_scene(C); } - ED_object_parent_set(op->reports, C, scene, ob, par, partype, false, false, NULL); + bool parent_set = false; + bool linked_objects = false; - DEG_relations_tag_update(bmain); - WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); - WM_event_add_notifier(C, NC_OBJECT | ND_PARENT, NULL); + for (wmDragID *drag_id = drag; drag_id; drag_id = drag_id->next) { +if (GS(drag_id->id->name) == ID_OB) { + Object *object = (Object *)drag_id->id; - return OPERATOR_FINISHED; + /* Do nothing to linked data */ + if (ID_IS_LINKED(object)) { +linked_objects = true; +continue; + } + + if (ED_object_parent_set( + reports, C, scene, object, parent, parent_type, false, false, NULL)) { +parent_set = true; + } +} + } + + if (linked_objects) { +BKE_report(reports, RPT_INFO, "Can't edit library linked object(s)"); + } + + if (parent_set) { +DEG_relations_tag_update(bmain); +WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); +WM_event_add_notifier(C, NC_OBJECT | ND_PARENT, NULL); + } } static int parent_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - Main *bmain = CTX_data_main(C); - SpaceOutliner *soops = CTX_wm_space_outliner(C); TreeElement *te = outliner_drop_find(C, event); TreeStoreElem *tselem = te ? TREESTORE(te) : NULL; @@ -374,107 +393,15 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event) if (ob == par) { return OPERATOR_CANCELLED; } - if (ID_IS_LINKED(ob)) { -BKE_report(op->reports, RPT_INFO, "Can't edit library linked object"); -return OPERATOR_CANCELLED; - } - - char childname[MAX_NAME]; - char parname[MAX_NAME]; - STRNCPY(childname, ob->id.name + 2); - STRNCPY(parname, par->id.name + 2); - RNA_string_set(op->ptr, "child", childname); - RNA_string_set(op->ptr, "parent", parname); - - Scene *scene = (Scene *)outliner_search_back(soops, te, ID_SCE); - - if (scene == NULL) { -/* currently outlier organized in a way, that if there's no parent scene - * element for object it means that all displayed objects belong to - * active scene and parenting them is allowed (sergey) - */ - -scene = CTX_data_scene(C); - } - if ((par->type != OB_ARMATURE) && (par->type != OB_CURVE) && (par->type != OB_LATTICE)) { -int partype = 0; -if (ED_object_parent_set(op->reports, C, scene, ob, par, partype, false, false, NULL)) { - DEG_relations_tag_update(bmain); - WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); - WM_event_add_notifier(C, NC_OBJECT | ND_PARENT, NULL); -} + if (event->custom
[Bf-blender-cvs] [b83b0d73a67] master: Outliner: set scene camera on camera data activate
Commit: b83b0d73a67a6e732a790a1d85babdbd177f9379 Author: Nathan Craddock Date: Fri Aug 9 13:47:53 2019 -0600 Branches: master https://developer.blender.org/rBb83b0d73a67a6e732a790a1d85babdbd177f9379 Outliner: set scene camera on camera data activate === M source/blender/editors/space_outliner/outliner_select.c M source/blender/editors/space_outliner/space_outliner.c === diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 6e70cdcddcd..a279512e84a 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -51,6 +51,7 @@ #include "BKE_workspace.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_build.h" #include "ED_armature.h" #include "ED_object.h" @@ -451,9 +452,9 @@ static eOLDrawState tree_element_active_material(bContext *C, return OL_DRAWSEL_NONE; } -static eOLDrawState tree_element_active_camera(bContext *UNUSED(C), +static eOLDrawState tree_element_active_camera(bContext *C, Scene *scene, - ViewLayer *UNUSED(sl), + ViewLayer *UNUSED(view_layer), SpaceOutliner *soops, TreeElement *te, const eOLSetState set) @@ -461,10 +462,21 @@ static eOLDrawState tree_element_active_camera(bContext *UNUSED(C), Object *ob = (Object *)outliner_search_back(soops, te, ID_OB); if (set != OL_SETSEL_NONE) { +scene->camera = ob; + +Main *bmain = CTX_data_main(C); +wmWindowManager *wm = bmain->wm.first; + +WM_windows_scene_data_sync(>windows, scene); +DEG_id_tag_update(>id, ID_RECALC_COPY_ON_WRITE); +DEG_relations_tag_update(bmain); +WM_event_add_notifier(C, NC_SCENE | NA_EDITED, NULL); + return OL_DRAWSEL_NONE; } - - return scene->camera == ob; + else { +return scene->camera == ob; + } } static eOLDrawState tree_element_active_world(bContext *C, diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index 3ac09b8bcf8..79880c68120 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -131,6 +131,9 @@ static void outliner_main_region_listener(wmWindow *UNUSED(win), ED_region_tag_redraw(ar); break; } + if (wmn->action & NA_EDITED) { +ED_region_tag_redraw(ar); + } break; case NC_OBJECT: switch (wmn->data) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [01006aa45d1] master: Outliner: Allow select on row icons
Commit: 01006aa45d1afc9f45d2f6a42f6981f5c92af051 Author: Nathan Craddock Date: Thu Aug 8 15:37:32 2019 -0600 Branches: master https://developer.blender.org/rB01006aa45d1afc9f45d2f6a42f6981f5c92af051 Outliner: Allow select on row icons Allow selection of subtree elements on a collapsed element's row. Because subtree elements are aggregated by type, a select on an icon that represents multiple subtree elements will invoke a popup menu to select the specific subtree element. Also draws highlights on cursor hover over a row icon. Any child elements that are linked to multiple collections will only be listed in the popup one time, and selection from the popup will select the first instance in the subtree. === M source/blender/editors/space_outliner/outliner_draw.c M source/blender/editors/space_outliner/outliner_edit.c M source/blender/editors/space_outliner/outliner_intern.h M source/blender/editors/space_outliner/outliner_select.c M source/blender/editors/space_outliner/outliner_tools.c M source/blender/editors/space_outliner/outliner_utils.c === diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index a2fe131198d..a3b1c03a1b8 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -2590,7 +2590,11 @@ static void tselem_draw_icon(uiBlock *block, return; } + /* Icon is covered by restrict buttons */ if (!is_clickable || x >= xmax) { +/* Reduce alpha to match icon buttons */ +alpha *= 0.8f; + /* placement of icons, copied from interface_widgets.c */ float aspect = (0.8f * UI_UNIT_Y) / ICON_DEFAULT_HEIGHT; x += 2.0f * aspect; @@ -2698,7 +2702,6 @@ static void outliner_draw_iconrow_doit(uiBlock *block, float ufac = UI_UNIT_X / 20.0f; float icon_color[4], icon_border[4]; outliner_icon_background_colors(icon_color, icon_border); -icon_color[3] *= alpha_fac; if (active == OL_DRAWSEL_ACTIVE) { UI_GetThemeColor4fv(TH_EDITED_OBJECT, icon_color); icon_border[3] = 0.3f; @@ -2723,6 +2726,9 @@ static void outliner_draw_iconrow_doit(uiBlock *block, GPU_blend(true); /* Roundbox disables. */ } + if (tselem->flag & TSE_HIGHLIGHTED) { +alpha_fac += 0.5; + } tselem_draw_icon(block, xmax, (float)*offsx, (float)ys, tselem, te, alpha_fac, false); te->xs = *offsx; te->ys = ys; @@ -2730,7 +2736,12 @@ static void outliner_draw_iconrow_doit(uiBlock *block, if (num_elements > 1) { outliner_draw_iconrow_number(fstyle, *offsx, ys, num_elements); +te->flag |= TE_ICONROW_MERGED; } + else { +te->flag |= TE_ICONROW; + } + (*offsx) += UI_UNIT_X; } @@ -2740,7 +2751,7 @@ static void outliner_draw_iconrow_doit(uiBlock *block, * We use a continuum of indices until we get to the object data-blocks * and we then make room for the object types. */ -static int tree_element_id_type_to_index(TreeElement *te) +int tree_element_id_type_to_index(TreeElement *te) { TreeStoreElem *tselem = TREESTORE(te); @@ -2870,7 +2881,7 @@ static void outliner_set_coord_tree_element(TreeElement *te, int startx, int sta TreeElement *ten; /* closed items may be displayed in row of parent, don't change their coordinate! */ - if ((te->flag & TE_ICONROW) == 0) { + if ((te->flag & TE_ICONROW) == 0 && (te->flag & TE_ICONROW_MERGED) == 0) { /* store coord and continue, we need coordinates for elements outside view too */ te->xs = startx; te->ys = starty; diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 57fea544c77..842502ec82f 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -101,9 +101,15 @@ static int outliner_highlight_update(bContext *C, wmOperator *UNUSED(op), const ARegion *ar = CTX_wm_region(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); - const float my = UI_view2d_region_to_view_y(>v2d, event->mval[1]); - TreeElement *hovered_te = outliner_find_item_at_y(soops, >tree, my); + float view_mval[2]; + UI_view2d_region_to_view(>v2d, event->mval[0], event->mval[1], _mval[0], _mval[1]); + + TreeElement *hovered_te = outliner_find_item_at_y(soops, >tree, view_mval[1]); + + if (hovered_te) { +hovered_te = outliner_find_item_at_x_in_row(soops, hovered_te, view_mval[0], NULL); + } bool changed = false; if (!hovered_te || !(hovered_te->store_elem->flag & TSE_HIGHLIGHTED)) { diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index c12fdcc6d1f..72cd8dc6424 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++
[Bf-blender-cvs] [eb92ac05d6f] master: Outliner: invisible object filter
Commit: eb92ac05d6f850ccdbc0ed636763669f5d1e765e Author: Nathan Craddock Date: Thu Aug 8 18:09:08 2019 -0600 Branches: master https://developer.blender.org/rBeb92ac05d6f850ccdbc0ed636763669f5d1e765e Outliner: invisible object filter Adds an invisible object filter in the outliner to show hidden objects. This is useful to quickly locate hidden items in a large outliner tree and easily toggle visibilty back on. Invisible refers to an object being hidden, or viewport visibility restricted. === M source/blender/editors/space_outliner/outliner_tree.c M source/blender/makesdna/DNA_space_types.h M source/blender/makesrna/intern/rna_space.c === diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index cc062467dbe..7107b5539c8 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -2008,6 +2008,9 @@ static int outliner_exclude_filter_get(SpaceOutliner *soops) case SO_FILTER_OB_VISIBLE: exclude_filter |= SO_FILTER_OB_STATE_VISIBLE; break; +case SO_FILTER_OB_INVISIBLE: + exclude_filter |= SO_FILTER_OB_STATE_INVISIBLE; + break; case SO_FILTER_OB_SELECTED: exclude_filter |= SO_FILTER_OB_STATE_SELECTED; break; @@ -2086,6 +2089,11 @@ static bool outliner_element_visible_get(ViewLayer *view_layer, return false; } } + else if (exclude_filter & SO_FILTER_OB_STATE_INVISIBLE) { +if ((base->flag & BASE_VISIBLE) != 0) { + return false; +} + } else if (exclude_filter & SO_FILTER_OB_STATE_SELECTED) { if ((base->flag & BASE_SELECTED) == 0) { return false; diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 707b312e967..67f058c298b 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -287,13 +287,14 @@ typedef enum eSpaceOutliner_Filter { SO_FILTER_NO_OB_CAMERA = (1 << 10), SO_FILTER_NO_OB_OTHERS = (1 << 11), - SO_FILTER_UNUSED_12 = (1 << 12), /* cleared */ - SO_FILTER_OB_STATE_VISIBLE = (1 << 13), /* Not set via DNA. */ - SO_FILTER_OB_STATE_SELECTED = (1 << 14), /* Not set via DNA. */ - SO_FILTER_OB_STATE_ACTIVE = (1 << 15), /* Not set via DNA. */ - SO_FILTER_NO_COLLECTION = (1 << 16), - - SO_FILTER_ID_TYPE = (1 << 17), + SO_FILTER_UNUSED_12 = (1 << 12), /* cleared */ + SO_FILTER_OB_STATE_VISIBLE = (1 << 13), /* Not set via DNA. */ + SO_FILTER_OB_STATE_INVISIBLE = (1 << 14), /* Not set via DNA. */ + SO_FILTER_OB_STATE_SELECTED = (1 << 15), /* Not set via DNA. */ + SO_FILTER_OB_STATE_ACTIVE = (1 << 16),/* Not set via DNA. */ + SO_FILTER_NO_COLLECTION = (1 << 17), + + SO_FILTER_ID_TYPE = (1 << 18), } eSpaceOutliner_Filter; #define SO_FILTER_OB_TYPE \ @@ -301,7 +302,8 @@ typedef enum eSpaceOutliner_Filter { SO_FILTER_NO_OB_LAMP | SO_FILTER_NO_OB_CAMERA | SO_FILTER_NO_OB_OTHERS) #define SO_FILTER_OB_STATE \ - (SO_FILTER_OB_STATE_VISIBLE | SO_FILTER_OB_STATE_SELECTED | SO_FILTER_OB_STATE_ACTIVE) + (SO_FILTER_OB_STATE_VISIBLE | SO_FILTER_OB_STATE_INVISIBLE | SO_FILTER_OB_STATE_SELECTED | \ + SO_FILTER_OB_STATE_ACTIVE) #define SO_FILTER_ANY \ (SO_FILTER_NO_OB_CONTENT | SO_FILTER_NO_CHILDREN | SO_FILTER_OB_TYPE | SO_FILTER_OB_STATE | \ @@ -311,8 +313,9 @@ typedef enum eSpaceOutliner_Filter { typedef enum eSpaceOutliner_StateFilter { SO_FILTER_OB_ALL = 0, SO_FILTER_OB_VISIBLE = 1, - SO_FILTER_OB_SELECTED = 2, - SO_FILTER_OB_ACTIVE = 3, + SO_FILTER_OB_INVISIBLE = 2, + SO_FILTER_OB_SELECTED = 3, + SO_FILTER_OB_ACTIVE = 4, } eSpaceOutliner_StateFilter; /* SpaceOutliner.show_restrict_flags */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 87472081f79..ef4406db84d 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2777,6 +2777,7 @@ static void rna_def_space_outliner(BlenderRNA *brna) static const EnumPropertyItem filter_state_items[] = { {SO_FILTER_OB_ALL, "ALL", 0, "All", "Show all objects in the view layer"}, {SO_FILTER_OB_VISIBLE, "VISIBLE", 0, "Visible", "Show visible objects"}, + {SO_FILTER_OB_INVISIBLE, "INVISIBLE", 0, "Invisible", "Show invisible objects"}, {SO_FILTER_OB_SELECTED, "SELECTED", 0, "Selected", "Show selected objects"}, {SO_FILTER_OB_ACTIVE, "ACTIVE", 0, "Active", "Show only the active object"}, {0, NULL, 0, NULL, NULL}, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bf95ab6bb24] master: Outliner: Draw constraint icons and enable button
Commit: bf95ab6bb24103e67856e76f9c3e058bf3e9e6de Author: Nathan Craddock Date: Thu Aug 8 13:58:53 2019 -0600 Branches: master https://developer.blender.org/rBbf95ab6bb24103e67856e76f9c3e058bf3e9e6de Outliner: Draw constraint icons and enable button Draw all constraint icons and enable/disable restrict buttons. The action constraint needs its own icon. It currently draws white instead of the blue modifier color. === M source/blender/editors/interface/interface_templates.c M source/blender/editors/space_outliner/outliner_draw.c M source/blender/editors/space_outliner/space_outliner.c M source/blender/makesrna/intern/rna_constraint.c === diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index ae0823eb550..22573c9c7d2 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -2523,7 +2523,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) /* enabled */ UI_block_emboss_set(block, UI_EMBOSS_NONE); -uiItemR(row, , "mute", 0, "", (con->flag & CONSTRAINT_OFF) ? ICON_HIDE_ON : ICON_HIDE_OFF); +uiItemR(row, , "mute", 0, "", 0); UI_block_emboss_set(block, UI_EMBOSS); uiLayoutSetOperatorContext(row, WM_OP_INVOKE_DEFAULT); diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index cab8e45b827..a2fe131198d 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -31,6 +31,7 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_sequence_types.h" +#include "DNA_constraint_types.h" #include "DNA_object_force_types.h" #include "BLI_math.h" @@ -849,6 +850,7 @@ typedef struct RestrictProperties { PropertyRNA *layer_collection_holdout, *layer_collection_indirect_only, *layer_collection_hide_viewport; PropertyRNA *modifier_show_viewport, *modifier_show_render; + PropertyRNA *constraint_enable; } RestrictProperties; /* We don't care about the value of the property @@ -866,6 +868,7 @@ typedef struct RestrictPropertiesActive { bool layer_collection_hide_viewport; bool modifier_show_viewport; bool modifier_show_render; + bool constraint_enable; } RestrictPropertiesActive; static void outliner_restrict_properties_enable_collection_set( @@ -879,6 +882,7 @@ static void outliner_restrict_properties_enable_collection_set( props_active->layer_collection_indirect_only = false; props_active->object_hide_render = false; props_active->modifier_show_render = false; + props_active->constraint_enable = false; } } @@ -892,6 +896,7 @@ static void outliner_restrict_properties_enable_collection_set( props_active->object_hide_viewport = false; props_active->base_hide_viewport = false; props_active->modifier_show_viewport = false; + props_active->constraint_enable = false; } } @@ -996,6 +1001,8 @@ static void outliner_draw_restrictbuts(uiBlock *block, props.modifier_show_viewport = RNA_struct_type_find_property(_Modifier, "show_viewport"); props.modifier_show_render = RNA_struct_type_find_property(_Modifier, "show_render"); +props.constraint_enable = RNA_struct_type_find_property(_Constraint, "mute"); + props.initialized = true; } @@ -1182,6 +1189,35 @@ static void outliner_draw_restrictbuts(uiBlock *block, } } } + else if (tselem->type == TSE_CONSTRAINT) { +bConstraint *con = (bConstraint *)te->directdata; + +PointerRNA ptr; +RNA_pointer_create(tselem->id, _Constraint, con, ); + +if (soops->show_restrict_flags & SO_RESTRICT_HIDE) { + bt = uiDefIconButR_prop(block, + UI_BTYPE_ICON_TOGGLE, + 0, + 0, + (int)(ar->v2d.cur.xmax - restrict_offsets.hide), + te->ys, + UI_UNIT_X, + UI_UNIT_Y, + , + props.constraint_enable, + -1, + 0, + 0, + -1, + -1, + NULL); + UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); + if (!props_active.constraint_enable) { +UI_but_flag_enable(bt, UI_BUT_INACTIVE); + } +} + } else if (tselem->type == TSE_MODIFIER) { ModifierData *md =
[Bf-blender-cvs] [05f2ccd6d41] master: Outliner: Draw sequencer and vertex group icons
Commit: 05f2ccd6d415f76ea6278b0455914172544bc4a8 Author: Nathan Craddock Date: Fri Aug 9 13:37:23 2019 -0600 Branches: master https://developer.blender.org/rB05f2ccd6d415f76ea6278b0455914172544bc4a8 Outliner: Draw sequencer and vertex group icons Draw icons for sequencer and vertex groups. The sequence types need updates because they all draw in various colors and some sequence types do not have an icon. === M source/blender/editors/space_outliner/outliner_draw.c === diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index a3b1c03a1b8..9c45fb15f6b 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1915,6 +1915,9 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te) case TSE_DEFGROUP_BASE: data.icon = ICON_GROUP_VERTEX; break; + case TSE_DEFGROUP: +data.icon = ICON_GROUP_VERTEX; +break; case TSE_BONE: case TSE_EBONE: data.icon = ICON_BONE_DATA; @@ -2268,23 +2271,57 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te) data.icon = ICON_GROUP_BONE; break; case TSE_SEQUENCE: -if (te->idcode == SEQ_TYPE_MOVIE) { - data.icon = ICON_SEQUENCE; -} -else if (te->idcode == SEQ_TYPE_META) { - data.icon = ICON_DOT; -} -else if (te->idcode == SEQ_TYPE_SCENE) { - data.icon = ICON_SCENE; -} -else if (te->idcode == SEQ_TYPE_SOUND_RAM) { - data.icon = ICON_SOUND; -} -else if (te->idcode == SEQ_TYPE_IMAGE) { - data.icon = ICON_IMAGE; -} -else { - data.icon = ICON_PARTICLES; +switch (te->idcode) { + case SEQ_TYPE_SCENE: +data.icon = ICON_SCENE_DATA; +break; + case SEQ_TYPE_MOVIECLIP: +data.icon = ICON_TRACKER; +break; + case SEQ_TYPE_MASK: +data.icon = ICON_MOD_MASK; +break; + case SEQ_TYPE_MOVIE: +data.icon = ICON_FILE_MOVIE; +break; + case SEQ_TYPE_SOUND_RAM: +data.icon = ICON_SOUND; +break; + case SEQ_TYPE_IMAGE: +data.icon = ICON_FILE_IMAGE; +break; + case SEQ_TYPE_COLOR: + case SEQ_TYPE_ADJUSTMENT: +data.icon = ICON_COLOR; +break; + case SEQ_TYPE_TEXT: +data.icon = ICON_FONT_DATA; +break; + case SEQ_TYPE_ADD: + case SEQ_TYPE_SUB: + case SEQ_TYPE_MUL: + case SEQ_TYPE_OVERDROP: + case SEQ_TYPE_ALPHAOVER: + case SEQ_TYPE_ALPHAUNDER: + case SEQ_TYPE_COLORMIX: + case SEQ_TYPE_MULTICAM: + case SEQ_TYPE_TRANSFORM: + case SEQ_TYPE_SPEED: + case SEQ_TYPE_GLOW: + case SEQ_TYPE_GAUSSIAN_BLUR: +data.icon = ICON_SHADERFX; +break; + case SEQ_TYPE_CROSS: + case SEQ_TYPE_GAMCROSS: + case SEQ_TYPE_WIPE: +data.icon = ICON_ARROW_LEFTRIGHT; +break; + case SEQ_TYPE_META: +data.icon = ICON_DOT; +break; + default: +data.icon = ICON_DOT; +break; } break; case TSE_SEQ_STRIP: ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [49020944405] master: Outliner: Use F2 to rename active outliner item
Commit: 49020944405be37d9f495a2bc7045716cb99ce29 Author: Nathan Craddock Date: Fri Aug 9 13:27:40 2019 -0600 Branches: master https://developer.blender.org/rB49020944405be37d9f495a2bc7045716cb99ce29 Outliner: Use F2 to rename active outliner item Previously with F2 mapped to the global rename active object operator, it was not posible to use the conventional F2 to rename any outliner element like collections or object data. This adds F2 to the outliner keymap to call the outliner rename operator rather than the popup rename object operator. === M release/scripts/presets/keyconfig/keymap_data/blender_default.py M source/blender/editors/space_outliner/outliner_edit.c === diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 798bdc1fe01..014671f4f6e 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -700,6 +700,7 @@ def km_outliner(params): items.extend([ ("outliner.highlight_update", {"type": 'MOUSEMOVE', "value": 'ANY', "any": True}, None), ("outliner.item_rename", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None), +("outliner.item_rename", {"type": 'F2', "value": 'PRESS'}, None), ("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK'}, {"properties": [("extend", False), ("recursive", False), ("deselect_all", not params.legacy)]}), ("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True}, diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 60b5dbdfc50..a708142816a 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -386,10 +386,10 @@ void item_rename_cb(bContext *C, do_item_rename(ar, te, tselem, reports); } -static int do_outliner_item_rename(ReportList *reports, - ARegion *ar, - TreeElement *te, - const float mval[2]) +static void do_outliner_item_rename(ReportList *reports, +ARegion *ar, +TreeElement *te, +const float mval[2]) { if (mval[1] > te->ys && mval[1] < te->ys + UI_UNIT_Y) { TreeStoreElem *tselem = TREESTORE(te); @@ -397,17 +397,12 @@ static int do_outliner_item_rename(ReportList *reports, /* click on name */ if (mval[0] > te->xs + UI_UNIT_X * 2 && mval[0] < te->xend) { do_item_rename(ar, te, tselem, reports); - return 1; } -return 0; } for (te = te->subtree.first; te; te = te->next) { -if (do_outliner_item_rename(reports, ar, te, mval)) { - return 1; -} +do_outliner_item_rename(reports, ar, te, mval); } - return 0; } static int outliner_item_rename(bContext *C, wmOperator *op, const wmEvent *event) @@ -416,25 +411,34 @@ static int outliner_item_rename(bContext *C, wmOperator *op, const wmEvent *even SpaceOutliner *soops = CTX_wm_space_outliner(C); TreeElement *te; float fmval[2]; - bool changed = false; - UI_view2d_region_to_view(>v2d, event->mval[0], event->mval[1], [0], [1]); + /* Rename active element if key pressed, otherwise rename element at cursor coordinates */ + if (event->val == KM_PRESS) { +TreeElement *active_element = outliner_find_element_with_flag(>tree, TSE_ACTIVE); - for (te = soops->tree.first; te; te = te->next) { -if (do_outliner_item_rename(op->reports, ar, te, fmval)) { - changed = true; - break; +if (active_element) { + do_item_rename(ar, active_element, TREESTORE(active_element), op->reports); +} +else { + BKE_report(op->reports, RPT_WARNING, "No active item to rename"); } } + else { +UI_view2d_region_to_view(>v2d, event->mval[0], event->mval[1], [0], [1]); - return changed ? OPERATOR_FINISHED : OPERATOR_PASS_THROUGH; +for (te = soops->tree.first; te; te = te->next) { + do_outliner_item_rename(op->reports, ar, te, fmval); +} + } + + return OPERATOR_FINISHED; } void OUTLINER_OT_item_rename(wmOperatorType *ot) { ot->name = "Rename"; ot->idname = "OUTLINER_OT_item_rename"; - ot->description = "Rename item under cursor"; + ot->description = "Rename the active element"; ot->invoke = outliner_item_rename; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0a903e7ab10] master: Collections: change active if hidden or excluded
Commit: 0a903e7ab101a27b4bba47dd12005311147e7b1a Author: Nathan Craddock Date: Thu Aug 8 13:27:19 2019 -0600 Branches: master https://developer.blender.org/rB0a903e7ab101a27b4bba47dd12005311147e7b1a Collections: change active if hidden or excluded When the active collection is hidden or excluded, change the active collection to the first visible parent collection. This behavior existed previously for excluding collections, and is now expanded to also switch the active collection when viewport hidden or restricted. This does not prevent viewport hidden or restricted collections from being reactivated later. This could be added as a separate commit. Excluded collections cannot be activated, so it may make sense to extend this behavior to hiding collections. === M source/blender/blenkernel/intern/layer.c === diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 40608285785..de105b9b62a 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -493,6 +493,36 @@ static LayerCollection *collection_from_index(ListBase *lb, const int number, in return NULL; } +/** + * Determine if a collection is hidden, viewport visibility restricted, or excluded + */ +static bool layer_collection_hidden(ViewLayer *view_layer, LayerCollection *lc) +{ + if (lc->flag & LAYER_COLLECTION_EXCLUDE) { +return true; + } + + /* Check visiblilty restriction flags */ + if (lc->flag & LAYER_COLLECTION_HIDE || lc->collection->flag & COLLECTION_RESTRICT_VIEWPORT) { +return true; + } + else { +/* Restriction flags stay set, so we need to check parents */ +CollectionParent *parent = lc->collection->parents.first; + +if (parent) { + lc = BKE_layer_collection_first_from_scene_collection(view_layer, parent->collection); + + return lc && layer_collection_hidden(view_layer, lc); +} +else { + return false; +} + } + + return false; +} + /** * Get the collection for a given index */ @@ -537,8 +567,9 @@ LayerCollection *BKE_layer_collection_activate_parent(ViewLayer *view_layer, Lay lc = NULL; } - if (lc && (lc->flag & LAYER_COLLECTION_EXCLUDE)) { -/* Don't activate excluded collections. */ + /* Don't activate excluded or hidden collections to prevent creating objects in a hidden + * collection from the UI */ + if (lc && layer_collection_hidden(view_layer, lc)) { return BKE_layer_collection_activate_parent(view_layer, lc); } @@ -817,8 +848,7 @@ void BKE_layer_collection_sync(const Scene *scene, ViewLayer *view_layer) /* Always set a valid active collection. */ LayerCollection *active = view_layer->active_collection; - - if (active && (active->flag & LAYER_COLLECTION_EXCLUDE)) { + if (active && layer_collection_hidden(view_layer, active)) { BKE_layer_collection_activate_parent(view_layer, active); } else if (active == NULL) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [35a5dee2ef7] master: Eyedropper: Support datadropper in the outliner
Commit: 35a5dee2ef7303124259e660f85c337289b78403 Author: Nathan Craddock Date: Thu Aug 8 13:40:00 2019 -0600 Branches: master https://developer.blender.org/rB35a5dee2ef7303124259e660f85c337289b78403 Eyedropper: Support datadropper in the outliner Adds support for using the eyedropper in the outliner in addition to the 3D view. === M source/blender/editors/include/ED_outliner.h M source/blender/editors/interface/interface_eyedropper_datablock.c M source/blender/editors/space_outliner/outliner_utils.c === diff --git a/source/blender/editors/include/ED_outliner.h b/source/blender/editors/include/ED_outliner.h index a28b1b8483a..30e2624604c 100644 --- a/source/blender/editors/include/ED_outliner.h +++ b/source/blender/editors/include/ED_outliner.h @@ -30,6 +30,8 @@ bool ED_outliner_collections_editor_poll(struct bContext *C); void ED_outliner_selected_objects_get(const struct bContext *C, struct ListBase *objects); +Base *ED_outliner_give_base_under_cursor(struct bContext *C, const int mval[2]); + void ED_outliner_select_sync_from_object_tag(struct bContext *C); void ED_outliner_select_sync_from_edit_bone_tag(struct bContext *C); void ED_outliner_select_sync_from_pose_bone_tag(struct bContext *C); diff --git a/source/blender/editors/interface/interface_eyedropper_datablock.c b/source/blender/editors/interface/interface_eyedropper_datablock.c index 658aa4f67f9..efbe5922aa5 100644 --- a/source/blender/editors/interface/interface_eyedropper_datablock.c +++ b/source/blender/editors/interface/interface_eyedropper_datablock.c @@ -51,6 +51,7 @@ #include "ED_space_api.h" #include "ED_screen.h" #include "ED_view3d.h" +#include "ED_outliner.h" #include "interface_intern.h" #include "interface_eyedropper_intern.h" @@ -67,6 +68,7 @@ typedef struct DataDropper { ID *init_id; /* for resetting on cancel */ + ScrArea *cursor_area; /* Area under the cursor */ ARegionType *art; void *draw_handle_pixel; char name[200]; @@ -103,6 +105,7 @@ static int datadropper_init(bContext *C, wmOperator *op) ddr->is_undo = UI_but_flag_is_set(but, UI_BUT_UNDO); + ddr->cursor_area = CTX_wm_area(C); ddr->art = art; ddr->draw_handle_pixel = ED_region_draw_cb_activate( art, datadropper_draw_cb, ddr, REGION_DRAW_POST_PIXEL); @@ -141,7 +144,7 @@ static void datadropper_exit(bContext *C, wmOperator *op) /* *** datadropper id helper functions *** */ /** - * \brief get the ID from the screen. + * \brief get the ID from the 3D view or outliner. */ static void datadropper_id_sample_pt(bContext *C, DataDropper *ddr, int mx, int my, ID **r_id) { @@ -155,7 +158,7 @@ static void datadropper_id_sample_pt(bContext *C, DataDropper *ddr, int mx, int ddr->name[0] = '\0'; if (sa) { -if (sa->spacetype == SPACE_VIEW3D) { +if (ELEM(sa->spacetype, SPACE_VIEW3D, SPACE_OUTLINER)) { ARegion *ar = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my); if (ar) { const int mval[2] = {mx - ar->winrct.xmin, my - ar->winrct.ymin}; @@ -167,7 +170,13 @@ static void datadropper_id_sample_pt(bContext *C, DataDropper *ddr, int mx, int /* grr, always draw else we leave stale text */ ED_region_tag_redraw(ar); -base = ED_view3d_give_base_under_cursor(C, mval); +if (sa->spacetype == SPACE_VIEW3D) { + base = ED_view3d_give_base_under_cursor(C, mval); +} +else { + base = ED_outliner_give_base_under_cursor(C, mval); +} + if (base) { Object *ob = base->object; ID *id = NULL; @@ -232,6 +241,36 @@ static void datadropper_cancel(bContext *C, wmOperator *op) datadropper_exit(C, op); } +/* To switch the draw callback when region under mouse event changes */ +static void datadropper_set_draw_callback_region(bContext *C, + DataDropper *ddr, + const int mx, + const int my) +{ + bScreen *screen = CTX_wm_screen(C); + ScrArea *sa = BKE_screen_find_area_xy(screen, -1, mx, my); + + if (sa) { +/* If spacetype changed */ +if (sa->spacetype != ddr->cursor_area->spacetype) { + /* Remove old callback */ + ED_region_draw_cb_exit(ddr->art, ddr->draw_handle_pixel); + + /* Redraw old area */ + ARegion *ar = BKE_area_find_region_type(ddr->cursor_area, RGN_TYPE_WINDOW); + ED_region_tag_redraw(ar); + + /* Set draw callback in new region */ + ARegionType *art = BKE_regiontype_from_id(sa->type, RGN_TYPE_WINDOW); + + ddr->cursor_area = sa; + ddr->art = art; + ddr->draw_handle_pixel = ED_region_draw_cb_activate( + art, datadropper_draw_cb, ddr, REGION_DRAW_POST_PIXEL); +} + } +} + /* main modal status check */ static int
[Bf-blender-cvs] [71eb6532807] master: Outliner: Synced selection and active element highlighting
Commit: 71eb65328078d3b3ca440a9a23a7aa08238a6710 Author: Nathan Craddock Date: Wed Aug 7 22:27:07 2019 -0600 Branches: master https://developer.blender.org/rB71eb65328078d3b3ca440a9a23a7aa08238a6710 Outliner: Synced selection and active element highlighting Adds a toggle to the filter menu for outliner synced selection. Enabled by default, this ensures selection is synced between objects, bones, and sequences. An active outliner element theme color is added to indicate which element is active. Synced selection is controlled on the operator level. Each operator that modifies selection for objects, bones, sequences, or outliner elements needs to call the respective ED_outliner_select_sync_from.. function to tag outliners to be synced. Syncing is done lazily on outliner draw. === M release/datafiles/userdef/userdef_default_theme.c M release/scripts/presets/interface_theme/blender_light.xml M release/scripts/startup/bl_ui/space_outliner.py M source/blender/blenloader/intern/versioning_280.c M source/blender/blenloader/intern/versioning_userdef.c M source/blender/editors/armature/armature_select.c M source/blender/editors/armature/pose_select.c M source/blender/editors/include/ED_outliner.h M source/blender/editors/include/UI_resources.h M source/blender/editors/interface/resources.c M source/blender/editors/object/object_add.c M source/blender/editors/object/object_select.c M source/blender/editors/space_outliner/CMakeLists.txt M source/blender/editors/space_outliner/outliner_draw.c M source/blender/editors/space_outliner/outliner_edit.c M source/blender/editors/space_outliner/outliner_intern.h M source/blender/editors/space_outliner/outliner_select.c A source/blender/editors/space_outliner/outliner_sync.c M source/blender/editors/space_outliner/space_outliner.c M source/blender/editors/space_sequencer/sequencer_select.c M source/blender/editors/space_view3d/view3d_select.c M source/blender/makesdna/DNA_outliner_types.h M source/blender/makesdna/DNA_space_types.h M source/blender/makesdna/DNA_windowmanager_types.h M source/blender/makesrna/intern/rna_space.c M source/blender/makesrna/intern/rna_userdef.c === diff --git a/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c index 8611a9ae881..9f037fa4793 100644 --- a/release/datafiles/userdef/userdef_default_theme.c +++ b/release/datafiles/userdef/userdef_default_theme.c @@ -748,7 +748,8 @@ const bTheme U_theme_default = { .outline_width = 1, .facedot_size = 4, .match = RGBA(0x337f334c), -.selected_highlight = RGBA(0x314e784c), +.selected_highlight = RGBA(0x223a5bff), +.active = RGBA(0x3b5689ff), .selected_object = RGBA(0xe96a00ff), .active_object = RGBA(0xffaf29ff), .edited_object = RGBA(0x00806266), diff --git a/release/scripts/presets/interface_theme/blender_light.xml b/release/scripts/presets/interface_theme/blender_light.xml index dc0bb6b629e..49b01ec3309 100644 --- a/release/scripts/presets/interface_theme/blender_light.xml +++ b/release/scripts/presets/interface_theme/blender_light.xml @@ -974,6 +974,7 @@ armatures) { arm->flag &= ~(ARM_FLAG_UNUSED_6); } + +/* Marks each outliner as dirty so a sync will occur as an outliner draws. */ +for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { +for (SpaceLink *space = sa->spacedata.first; space; space = space->next) { + if (space->spacetype == SPACE_OUTLINER) { +SpaceOutliner *soutliner = (SpaceOutliner *)space; +soutliner->sync_select_dirty |= WM_OUTLINER_SYNC_SELECT_FROM_ALL; +soutliner->flag |= SO_SYNC_SELECT; + } +} + } +} } if (!MAIN_VERSION_ATLEAST(bmain, 281, 1)) { diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index e987a623d0b..b01d2765963 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -141,6 +141,9 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme) FROM_DEFAULT_V4_UCHAR(space_outliner.row_alternate); } + FROM_DEFAULT_V4_UCHAR(space_outliner.selected_highlight); + FROM_DEFAULT_V4_UCHAR(space_outliner.active); + /** * Include next version bump. */ diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c index 23ddf77e63d..eff621d7b71 100644 --- a/source/blender/editors/armature/armature_select.c +++ b/source/blender/editors/armature/armature_select.c
[Bf-blender-cvs] [bb2080c139d] temp-soc-2019-outliner-sync: Outliner: Fix range select not activating
Commit: bb2080c139d53e51932d19b1a5ba2e530dfdfc3f Author: Nathan Craddock Date: Fri Aug 16 11:26:23 2019 -0600 Branches: temp-soc-2019-outliner-sync https://developer.blender.org/rBbb2080c139d53e51932d19b1a5ba2e530dfdfc3f Outliner: Fix range select not activating === M source/blender/editors/space_outliner/outliner_select.c === diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 4575a9bc000..19fd4511e50 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -253,9 +253,7 @@ static eOLDrawState active_viewlayer(bContext *C, } /** - * Select object tree: - * ALT+LMB: Select/Deselect object and all children. - * CTRL+ALT+LMB: Add/Remove object and all children. + * Select object tree */ static void do_outliner_object_select_recursive(ViewLayer *view_layer, Object *ob_parent, @@ -1271,13 +1269,14 @@ static void do_outliner_range_select_recursive(ListBase *lb, } /* Select a range of items between cursor and active element */ -static void do_outliner_range_select(SpaceOutliner *soops, TreeElement *cursor) +static void do_outliner_range_select(bContext *C, SpaceOutliner *soops, TreeElement *cursor) { TreeElement *active = outliner_find_element_with_flag(>tree, TSE_ACTIVE); outliner_flag_set(>tree, TSE_ACTIVE_WALK, false); if (!active) { -TREESTORE(cursor)->flag |= TSE_SELECTED | TSE_ACTIVE | TSE_ACTIVE_WALK; +outliner_item_select(soops, cursor, false, false); +outliner_item_do_activate_from_tree_element(C, cursor, TREESTORE(cursor), false, false); return; } @@ -1294,8 +1293,8 @@ static void do_outliner_range_select(SpaceOutliner *soops, TreeElement *cursor) /* If active is not selected, just select the element under the cursor */ if (!active_selected || !outliner_is_element_visible(active)) { -tselem->flag &= ~TSE_ACTIVE; -TREESTORE(cursor)->flag |= TSE_SELECTED | TSE_ACTIVE | TSE_ACTIVE_WALK; +outliner_item_select(soops, cursor, false, false); +outliner_item_do_activate_from_tree_element(C, cursor, TREESTORE(cursor), false, false); return; } @@ -1381,7 +1380,7 @@ static int outliner_item_do_activate_from_cursor(bContext *C, TreeStoreElem *activate_tselem = TREESTORE(activate_te); if (use_range) { - do_outliner_range_select(soops, activate_te); + do_outliner_range_select(C, soops, activate_te); } else { outliner_item_select(soops, activate_te, extend, extend); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [60a74015111] temp-soc-2019-outliner-sync: Outliner: Synced selection fixes
Commit: 60a74015111884dc8d0877fe422497913f94fd03 Author: Nathan Craddock Date: Fri Aug 16 11:16:33 2019 -0600 Branches: temp-soc-2019-outliner-sync https://developer.blender.org/rB60a74015111884dc8d0877fe422497913f94fd03 Outliner: Synced selection fixes Fix outliner select on items linked between collections not syncing. Adds more control to from-outliner select syncing, to only sync data within the current interaction mode. Deselect all non-synced data on syncing to outliner. Fix edit bone outliner syncing not tagging for updates === M source/blender/editors/space_outliner/outliner_sync.c === diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c index 42068dfff1e..a8aeb7ea4e1 100644 --- a/source/blender/editors/space_outliner/outliner_sync.c +++ b/source/blender/editors/space_outliner/outliner_sync.c @@ -30,6 +30,9 @@ #include "DNA_sequence_types.h" #include "DNA_space_types.h" +#include "BLI_compiler_compat.h" +#include "BLI_ghash.h" + #include "BKE_armature.h" #include "BKE_context.h" #include "BKE_layer.h" @@ -112,15 +115,22 @@ typedef struct SyncSelectTypes { bool sequence; } SyncSelectTypes; -/** Set which types of data to sync when syncing selection from the outliner. */ -static void outliner_sync_select_from_outliner_set_types(SpaceOutliner *soops, +/** + * Set which types of data to sync when syncing selection from the outliner based on object + * interaction mode and outliner display mode + */ +static void outliner_sync_select_from_outliner_set_types(bContext *C, + SpaceOutliner *soops, SyncSelectTypes *sync_types) { + Object *obact = CTX_data_active_object(C); + Object *obedit = CTX_data_edit_object(C); + const bool sequence_view = soops->outlinevis == SO_SEQUENCE; - sync_types->object = !sequence_view; - sync_types->edit_bone = !sequence_view; - sync_types->pose_bone = !sequence_view; + sync_types->object = !sequence_view && (obact && obact->mode == OB_MODE_OBJECT); + sync_types->edit_bone = !sequence_view && (obedit && obedit->type == OB_ARMATURE); + sync_types->pose_bone = !sequence_view && (obact && obact->mode == OB_MODE_POSE); sync_types->sequence = sequence_view; } @@ -128,24 +138,77 @@ static void outliner_sync_select_from_outliner_set_types(SpaceOutliner *soops, * Current dirty flags and outliner display mode determine which type of syncing should occur. * This is to ensure sync flag data is not lost on sync in the wrong display mode. */ -static void outliner_sync_select_to_outliner_set_types(SpaceOutliner *soops, +static void outliner_sync_select_to_outliner_set_types(const bContext *C, + SpaceOutliner *soops, SyncSelectTypes *sync_types) { + Object *obact = CTX_data_active_object(C); + Object *obedit = CTX_data_edit_object(C); + const bool sequence_view = soops->outlinevis == SO_SEQUENCE; - sync_types->object = !sequence_view && + sync_types->object = !sequence_view && (obact && obact->mode == OB_MODE_OBJECT) && (soops->sync_select_dirty & WM_OUTLINER_SYNC_SELECT_FROM_OBJECT); - sync_types->edit_bone = !sequence_view && + sync_types->edit_bone = !sequence_view && (obedit && obedit->type == OB_ARMATURE) && (soops->sync_select_dirty & WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE); - sync_types->pose_bone = !sequence_view && + sync_types->pose_bone = !sequence_view && (obact && obact->mode == OB_MODE_POSE) && (soops->sync_select_dirty & WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE); sync_types->sequence = sequence_view && (soops->sync_select_dirty & WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE); } +/** + * Stores items selected from a sync from the outliner. Prevents syncing the selection + * state of the last instance of an object linked in multiple collections. + */ +typedef struct SelectedItems { + GSet *objects; + GSet *edit_bones; + GSet *pose_bones; +} SelectedItems; + +static void selected_items_init(SelectedItems *selected_items) +{ + selected_items->objects = BLI_gset_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, __func__); + selected_items->edit_bones = BLI_gset_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, __func__); + selected_items->pose_bones = BLI_gset_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, __func__); +} + +static void selected_items_free(SelectedItems *selected_items) +{ + BLI_gset_free(selected_items->objects, NULL); + BLI_gset_free(selected_items->edit_bones, NULL); + BLI_gset_free(selected_items->pose_bones, NULL); +} + +/* Check if an instance of this
[Bf-blender-cvs] [3b44bb9a4ea] temp-soc-2019-outliner-sync: Outliner: Don't show duplicates in merge search
Commit: 3b44bb9a4ea0ac4f58d19687d1c1b2119e3ef88a Author: Nathan Craddock Date: Fri Aug 16 11:01:13 2019 -0600 Branches: temp-soc-2019-outliner-sync https://developer.blender.org/rB3b44bb9a4ea0ac4f58d19687d1c1b2119e3ef88a Outliner: Don't show duplicates in merge search === M source/blender/editors/space_outliner/outliner_tools.c === diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 190e859e189..582a9cad312 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -63,6 +63,7 @@ #include "ED_armature.h" #include "ED_object.h" +#include "ED_outliner.h" #include "ED_scene.h" #include "ED_screen.h" #include "ED_sequencer.h" @@ -493,14 +494,19 @@ static void merged_element_search_cb_recursive( int iconid; for (TreeElement *te = tree->first; te; te = te->next) { -if (tree_element_id_type_to_index(te) == type && tselem_type == TREESTORE(te)->type) { +TreeStoreElem *tselem = TREESTORE(te); + +if (tree_element_id_type_to_index(te) == type && tselem_type == tselem->type) { if (BLI_strcasestr(te->name, str)) { BLI_strncpy(name, te->name, 64); -iconid = tree_element_get_icon(TREESTORE(te), te).icon; +iconid = tree_element_get_icon(tselem, te).icon; -if (!UI_search_item_add(items, name, te, iconid)) { - break; +/* Don't allow duplicate named items */ +if (UI_search_items_find_index(items, name) == -1) { + if (!UI_search_item_add(items, name, te, iconid)) { +break; + } } } } @@ -527,9 +533,15 @@ static void merged_element_search_cb(const bContext *UNUSED(C), /* Activate an element from the merged element search menu */ static void merged_element_search_call_cb(struct bContext *C, void *UNUSED(arg1), void *element) { + SpaceOutliner *soops = CTX_wm_space_outliner(C); TreeElement *te = (TreeElement *)element; + outliner_item_select(soops, te, false, false); outliner_item_do_activate_from_tree_element(C, te, te->store_elem, false, false); + + if (soops->flag & SO_SYNC_SELECT) { +ED_outliner_select_sync_from_outliner(C, soops); + } } /** Merged element search menu ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b0faec9ad7c] temp-soc-2019-outliner-sync: Outliner: fix contrast for selected and active highlights
Commit: b0faec9ad7ce5aa78565588b552a706ad922edc1 Author: Nathan Craddock Date: Fri Aug 16 10:55:54 2019 -0600 Branches: temp-soc-2019-outliner-sync https://developer.blender.org/rBb0faec9ad7ce5aa78565588b552a706ad922edc1 Outliner: fix contrast for selected and active highlights === M release/datafiles/userdef/userdef_default_theme.c M source/blender/blenloader/intern/versioning_userdef.c === diff --git a/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c index fa3f865b5b9..9f037fa4793 100644 --- a/release/datafiles/userdef/userdef_default_theme.c +++ b/release/datafiles/userdef/userdef_default_theme.c @@ -748,8 +748,8 @@ const bTheme U_theme_default = { .outline_width = 1, .facedot_size = 4, .match = RGBA(0x337f334c), -.selected_highlight = RGBA(0x314e784c), -.active = RGBA(0x59749d4c), +.selected_highlight = RGBA(0x223a5bff), +.active = RGBA(0x3b5689ff), .selected_object = RGBA(0xe96a00ff), .active_object = RGBA(0xffaf29ff), .edited_object = RGBA(0x00806266), diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index ce2fa1b7852..b01d2765963 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -141,6 +141,7 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme) FROM_DEFAULT_V4_UCHAR(space_outliner.row_alternate); } + FROM_DEFAULT_V4_UCHAR(space_outliner.selected_highlight); FROM_DEFAULT_V4_UCHAR(space_outliner.active); /** ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fb06b3fa01a] temp-soc-2019-outliner-sync: Outliner: Fix openclose behavior
Commit: fb06b3fa01a7a30f33b7dc0339672e7a0bf140b9 Author: Nathan Craddock Date: Fri Aug 16 11:24:24 2019 -0600 Branches: temp-soc-2019-outliner-sync https://developer.blender.org/rBfb06b3fa01a7a30f33b7dc0339672e7a0bf140b9 Outliner: Fix openclose behavior Fixes click+drag on disclosure triangles not behaving as expected. Now the dragged elements will be either closed or opened depending on the state of the first clicked+dragged. Also removed walk in and out for arrow left and right. === M source/blender/editors/space_outliner/outliner_edit.c M source/blender/editors/space_outliner/outliner_intern.h M source/blender/editors/space_outliner/outliner_select.c === diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 1fe2b4f0fce..318d90d0dca 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -141,42 +141,25 @@ void OUTLINER_OT_highlight_update(wmOperatorType *ot) /* Toggle Open/Closed --- */ /* Open or close a tree element, optionally toggling all children recursively */ -bool outliner_item_openclose(TreeElement *te, bool toggle_all) +void outliner_item_openclose(TreeElement *te, bool open, bool toggle_all) { TreeStoreElem *tselem = TREESTORE(te); - if (toggle_all) { -/* Open all children if this element is closed, or if any children are closed */ -const bool open = (tselem->flag & TSE_CLOSED) || - (outliner_flag_is_any_test(>subtree, TSE_CLOSED, 1)); - -if (open) { - tselem->flag &= ~TSE_CLOSED; -} -else { - tselem->flag |= TSE_CLOSED; -} - -outliner_flag_set(>subtree, TSE_CLOSED, !open); - -return true; + if (open) { +tselem->flag &= ~TSE_CLOSED; } else { -if (tselem->flag & TSE_CLOSED) { - tselem->flag &= ~TSE_CLOSED; -} -else { - tselem->flag |= TSE_CLOSED; -} - -return true; +tselem->flag |= TSE_CLOSED; } - return false; + if (toggle_all) { +outliner_flag_set(>subtree, TSE_CLOSED, !open); + } } typedef struct OpenCloseData { TreeStoreElem *prev_tselem; + bool open; int x_location; } OpenCloseData; @@ -198,9 +181,8 @@ static int outliner_item_openclose_modal(bContext *C, wmOperator *op, const wmEv /* Only toggle openclose on the same level as the first clicked element */ if (te->xs == data->x_location) { -if (outliner_item_openclose(te, false)) { - ED_region_tag_redraw(ar); -} +outliner_item_openclose(te, data->open, false); +ED_region_tag_redraw(ar); } } @@ -233,7 +215,12 @@ static int outliner_item_openclose_invoke(bContext *C, wmOperator *op, const wmE TreeElement *te = outliner_find_item_at_y(soops, >tree, view_mval[1]); if (te && outliner_item_is_co_within_close_toggle(te, view_mval[0])) { -outliner_item_openclose(te, toggle_all); +TreeStoreElem *tselem = TREESTORE(te); + +const bool open = (tselem->flag & TSE_CLOSED) || + (toggle_all && (outliner_flag_is_any_test(>subtree, TSE_CLOSED, 1))); + +outliner_item_openclose(te, open, toggle_all); ED_region_tag_redraw(ar); /* Only toggle once for single click toggling */ @@ -243,7 +230,8 @@ static int outliner_item_openclose_invoke(bContext *C, wmOperator *op, const wmE /* Store last expanded tselem and x coordinate of disclosure triangle */ OpenCloseData *toggle_data = MEM_callocN(sizeof(OpenCloseData), "open_close_data"); -toggle_data->prev_tselem = TREESTORE(te); +toggle_data->prev_tselem = tselem; +toggle_data->open = open; toggle_data->x_location = te->xs; /* Store the first clicked on element */ diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index 2dc0276e9a3..e37f3519653 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -354,7 +354,7 @@ void item_object_mode_exit_cb(struct bContext *C, void outliner_set_coordinates(struct ARegion *ar, struct SpaceOutliner *soops); -bool outliner_item_openclose(TreeElement *te, bool toggle_all); +void outliner_item_openclose(TreeElement *te, bool open, bool toggle_all); /* outliner_dragdrop.c */ void outliner_dropboxes(void); diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index f96a78b1fc1..4575a9bc000 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -1313,7 +1313,7 @@ static bool outliner_is_co_within_restrict_columns(const
[Bf-blender-cvs] [1e9f84c0d3e] temp-soc-2019-outliner-sync: Outliner: Move synced select toggle
Commit: 1e9f84c0d3e2c797c7a7b287f3d02daeb8feac25 Author: Nathan Craddock Date: Fri Aug 16 10:57:46 2019 -0600 Branches: temp-soc-2019-outliner-sync https://developer.blender.org/rB1e9f84c0d3e2c797c7a7b287f3d02daeb8feac25 Outliner: Move synced select toggle Move below Sort Alphabetically and use a checkbox instead of a button. === M release/scripts/startup/bl_ui/space_outliner.py M source/blender/makesrna/intern/rna_space.c === diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index f3e8d322a7b..7bf203d8e39 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -48,7 +48,7 @@ class OUTLINER_HT_header(Header): if display_mode == 'SEQUENCE': row = layout.row(align=True) -row.prop(space, "use_sync_select", text="") +row.prop(space, "use_sync_select", icon="UV_SYNC_SELECT", text="") row = layout.row(align=True) if display_mode in {'SCENES', 'VIEW_LAYER'}: @@ -307,10 +307,6 @@ class OUTLINER_PT_filter(Panel): space = context.space_data display_mode = space.display_mode -row = layout.row(align=True) -row.prop(space, "use_sync_select", text="Sync Selection") -layout.separator() - if display_mode == 'VIEW_LAYER': layout.label(text="Restriction Toggles:") row = layout.row(align=True) @@ -336,6 +332,10 @@ class OUTLINER_PT_filter(Panel): col.prop(space, "use_sort_alpha") layout.separator() +row = layout.row(align=True) +row.prop(space, "use_sync_select", text="Sync Selection") +layout.separator() + col = layout.column(align=True) col.label(text="Search:") col.prop(space, "use_filter_complete", text="Exact Match") diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 3aeaf0ba397..ef4406db84d 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2820,7 +2820,6 @@ static void rna_def_space_outliner(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", SO_SYNC_SELECT); RNA_def_property_ui_text( prop, "Sync Outliner Selection", "Sync outliner selection with other editors"); - RNA_def_property_ui_icon(prop, ICON_UV_SYNC_SELECT, 0); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); /* Granular restriction column option. */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5e266cd03e6] temp-soc-2019-outliner-sync: Outliner: Remove set parent popup
Commit: 5e266cd03e6608bfbaac506ccd889e8bf55f61fb Author: Nathan Craddock Date: Fri Aug 16 11:00:00 2019 -0600 Branches: temp-soc-2019-outliner-sync https://developer.blender.org/rB5e266cd03e6608bfbaac506ccd889e8bf55f61fb Outliner: Remove set parent popup The popup did not allow operator reports with multi object support. === M source/blender/editors/space_outliner/outliner_dragdrop.c === diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c index b58a0f34703..6031ba5cffc 100644 --- a/source/blender/editors/space_outliner/outliner_dragdrop.c +++ b/source/blender/editors/space_outliner/outliner_dragdrop.c @@ -336,7 +336,7 @@ static void parent_drop_set_parents( Scene *scene = (Scene *)outliner_search_back(soops, te, ID_SCE); if (scene == NULL) { -/* currently outlier organized in a way, that if there's no parent scene +/* currently outliner organized in a way, that if there's no parent scene * element for object it means that all displayed objects belong to * active scene and parenting them is allowed (sergey) */ @@ -345,13 +345,15 @@ static void parent_drop_set_parents( } bool parent_set = false; + bool linked_objects = false; + for (wmDragID *drag_id = drag; drag_id; drag_id = drag_id->next) { if (GS(drag_id->id->name) == ID_OB) { Object *object = (Object *)drag_id->id; /* Do nothing to linked data */ if (ID_IS_LINKED(object)) { -BKE_report(reports, RPT_INFO, "Can't edit library linked object"); +linked_objects = true; continue; } @@ -362,6 +364,10 @@ static void parent_drop_set_parents( } } + if (linked_objects) { +BKE_report(reports, RPT_INFO, "Can't edit library linked object(s)"); + } + if (parent_set) { DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); @@ -369,210 +375,6 @@ static void parent_drop_set_parents( } } -typedef struct ParentDropData { - Object *parent; - ListBase *drag_items; - short type; -} ParentDropData; - -static void parent_drop_menu_callback(bContext *C, void *data, int event) -{ - ParentDropData *drag_data = (ParentDropData *)data; - - wmDragID *drag = drag_data->drag_items->first; - parent_drop_set_parents(C, NULL, drag, drag_data->parent, event); - - BLI_freelistN(drag_data->drag_items); - MEM_freeN(drag_data->drag_items); - MEM_freeN(drag_data); -} - -static uiBlock *parent_drop_menu(bContext *C, ARegion *ar, void *data) -{ - uiBlock *block; - ParentDropData *drag_data = (ParentDropData *)data; - - block = UI_block_begin(C, ar, __func__, UI_EMBOSS); - UI_block_flag_enable(block, UI_BLOCK_MOVEMOUSE_QUIT); - UI_block_func_butmenu_set(block, parent_drop_menu_callback, drag_data); - - short menu_width = 10 * UI_UNIT_X; - short y_position = 0; - - uiDefBut(block, - UI_BTYPE_LABEL, - 0, - IFACE_("Set Parent To"), - 0, - y_position, - menu_width, - UI_UNIT_Y, - NULL, - 0.0, - 0.0, - 0, - 0, - ""); - - uiDefBut(block, - UI_BTYPE_BUT_MENU, - 0, - IFACE_("Object"), - 0, - y_position -= UI_UNIT_Y, - menu_width, - UI_UNIT_Y, - NULL, - 0.0, - 0.0, - 0, - PAR_OBJECT, - ""); - - if (drag_data->type == OB_ARMATURE) { -uiDefBut(block, - UI_BTYPE_BUT_MENU, - 0, - IFACE_("Armature Deform"), - 0, - y_position -= UI_UNIT_Y, - menu_width, - UI_UNIT_Y, - NULL, - 0.0, - 0.0, - 0, - PAR_ARMATURE, - ""); - -uiDefBut(block, - UI_BTYPE_BUT_MENU, - 0, - IFACE_(" With Empty Groups"), - 0, - y_position -= UI_UNIT_Y, - menu_width, - UI_UNIT_Y, - NULL, - 0.0, - 0.0, - 0, - PAR_ARMATURE_NAME, - ""); - -uiDefBut(block, - UI_BTYPE_BUT_MENU, - 0, - IFACE_(" With Envelope Weights"), - 0, - y_position -= UI_UNIT_Y, - menu_width, - UI_UNIT_Y, - NULL, - 0.0, - 0.0, - 0, - PAR_ARMATURE_ENVELOPE, - ""); - -uiDefBut(block, - UI_BTYPE_BUT_MENU, - 0, - IFACE_(" With Automatic Weights"), - 0, - y_position -= UI_UNIT_Y, - menu_width, - UI_UNIT_Y, - NULL, - 0.0, -
[Bf-blender-cvs] [723d05070ad] soc-2019-outliner: Outliner: Includes cleanup
Commit: 723d05070ade0b983b7e2fdbb54f1789dc9e2953 Author: Nathan Craddock Date: Fri Aug 16 11:21:34 2019 -0600 Branches: soc-2019-outliner https://developer.blender.org/rB723d05070ade0b983b7e2fdbb54f1789dc9e2953 Outliner: Includes cleanup === M source/blender/editors/space_outliner/outliner_sync.c === diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c index 63c7b7fe4a0..a8aeb7ea4e1 100644 --- a/source/blender/editors/space_outliner/outliner_sync.c +++ b/source/blender/editors/space_outliner/outliner_sync.c @@ -23,8 +23,6 @@ #include -#include "MEM_guardedalloc.h" - #include "DNA_armature_types.h" #include "DNA_layer_types.h" #include "DNA_outliner_types.h" ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7ba2720a70c] master: Fix T68103: bevel sometimes infinite loops with patch miter.
Commit: 7ba2720a70c83eb41f577aae4eb5a3403f6bb6b9 Author: Howard Trickey Date: Fri Aug 16 13:20:48 2019 -0400 Branches: master https://developer.blender.org/rB7ba2720a70c83eb41f577aae4eb5a3403f6bb6b9 Fix T68103: bevel sometimes infinite loops with patch miter. Needed to null terminate list of chain to process width adjustments on. === M source/blender/bmesh/tools/bmesh_bevel.c === diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c index 94935f2090b..797e2ca864e 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.c +++ b/source/blender/bmesh/tools/bmesh_bevel.c @@ -3122,6 +3122,7 @@ static void adjust_offsets(BevelParams *bp, BMesh *bm) } if (!iscycle) { /* right->left direction, changing vchainstart at each step */ +v->adjchain = NULL; v = vchainstart; bvcur = bv; do { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e77dd1273fb] temp-soc-2019-outliner-sync: Merge branch 'master' into temp-soc-2019-outliner-sync
Commit: e77dd1273fb691be46197c3f377d7c6f35d99445 Author: Nathan Craddock Date: Wed Aug 14 11:58:32 2019 -0600 Branches: temp-soc-2019-outliner-sync https://developer.blender.org/rBe77dd1273fb691be46197c3f377d7c6f35d99445 Merge branch 'master' into temp-soc-2019-outliner-sync === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e024d8d228a] temp-soc-2019-outliner-sync: Merge branch 'master' into temp-soc-2019-outliner-sync
Commit: e024d8d228a6b807555b583183691e01b49cb114 Author: Nathan Craddock Date: Fri Aug 16 10:50:46 2019 -0600 Branches: temp-soc-2019-outliner-sync https://developer.blender.org/rBe024d8d228a6b807555b583183691e01b49cb114 Merge branch 'master' into temp-soc-2019-outliner-sync === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0e2b56ed710] soc-2019-outliner: Merge branch 'master' into soc-2019-outliner
Commit: 0e2b56ed7108a460b851147f5c4742b22bed1994 Author: Nathan Craddock Date: Fri Aug 16 09:32:29 2019 -0600 Branches: soc-2019-outliner https://developer.blender.org/rB0e2b56ed7108a460b851147f5c4742b22bed1994 Merge branch 'master' into soc-2019-outliner === === diff --cc source/blender/editors/space_outliner/outliner_select.c index 531dd583d34,c932766ab93..19fd4511e50 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@@ -1358,43 -1292,21 +1358,36 @@@ static int outliner_item_do_activate_fr changed = true; } } - else if (outliner_item_is_co_within_close_toggle(te, view_mval[0])) { -outliner_item_toggle_closed(te, extend); -changed = true; -rebuild_tree = true; + /* Don't allow toggle on scene collection */ + else if ((TREESTORE(te)->type != TSE_VIEW_COLLECTION_BASE) && + outliner_item_is_co_within_close_toggle(te, view_mval[0])) { +return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH; } else { -Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); -/* the row may also contain children, if one is hovered we want this instead of current te */ -TreeElement *activate_te = outliner_find_item_at_x_in_row(soops, te, view_mval[0]); + +/* The row may also contain children, if one is hovered we want this instead of current te */ +bool merged_elements = false; +TreeElement *activate_te = outliner_find_item_at_x_in_row( +soops, te, view_mval[0], _elements); + +/* If the selected icon was an aggregate of multiple elements, run the search popup */ +if (merged_elements) { + merged_element_search_menu_invoke(C, te, activate_te); + return OPERATOR_CANCELLED; +} + TreeStoreElem *activate_tselem = TREESTORE(activate_te); -outliner_item_select(soops, activate_te, extend, extend); -do_outliner_item_activate_tree_element( -C, scene, view_layer, soops, activate_te, activate_tselem, extend, recursive); +if (use_range) { + do_outliner_range_select(C, soops, activate_te); +} +else { + outliner_item_select(soops, activate_te, extend, extend); - - /* Only change modes when clicking on the icon/text, -* otherwise we can't easily select without changing modes. */ - if ((te->flag & TE_ICONROW) == 0) { - if (view_mval[0] >= te->xs && view_mval[0] <= te->xend) { - do_outliner_item_activate_tree_element( - C, scene, view_layer, soops, activate_te, activate_tselem, extend, false); - } - } ++ do_outliner_item_activate_tree_element( ++ C, scene, view_layer, soops, activate_te, activate_tselem, extend, false); +} + changed = true; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b57d386dc1a] master: Fix T68009: Recognize X.Org/AMD as GPU_DEVICE_ATI and open source driver
Commit: b57d386dc1aed3945b9f4a85e37d38ac552a9626 Author: Rémi Verschelde Date: Fri Aug 16 18:36:39 2019 +0200 Branches: master https://developer.blender.org/rBb57d386dc1aed3945b9f4a85e37d38ac552a9626 Fix T68009: Recognize X.Org/AMD as GPU_DEVICE_ATI and open source driver Reviewed By: #gpu_viewport, fclem Differential Revision: https://developer.blender.org/D5392 === M source/blender/gpu/intern/gpu_extensions.c === diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 99dbff05453..5839b34cd19 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -309,6 +309,7 @@ void gpu_extensions_init(void) } else if ((strstr(renderer, "Mesa DRI R")) || (strstr(renderer, "Radeon") && strstr(vendor, "X.Org")) || + (strstr(renderer, "AMD") && strstr(vendor, "X.Org")) || (strstr(renderer, "Gallium ") && strstr(renderer, " on ATI ")) || (strstr(renderer, "Gallium ") && strstr(renderer, " on AMD "))) { GG.device = GPU_DEVICE_ATI; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [25f1783673d] master: Fix T68702: Input socket in the Normal node isn't drawn properly.
Commit: 25f1783673de636a6f0ca4457df8c05bc685981a Author: OmarSquircleArt Date: Fri Aug 16 17:59:12 2019 +0200 Branches: master https://developer.blender.org/rB25f1783673de636a6f0ca4457df8c05bc685981a Fix T68702: Input socket in the Normal node isn't drawn properly. The Normal vector socket in the Normal node wasn't drawn properly and couldn't be controlled. Additionally, the socket name was drawn over it. This happened because the socket had a default value of a zero vector. To fix this, we set the default value to the unit vector `(0, 0, 1)`. Moreover, we don't draw the UI name if the subtype is `PROP_DIRECTION`. Reviewers: brecht Differential Revision: https://developer.blender.org/D5503 === M source/blender/editors/space_node/drawnode.c M source/blender/nodes/shader/nodes/node_shader_normal.c === diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 748e485f614..c3ecc34aaf4 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3358,8 +3358,13 @@ static void std_node_socket_draw( uiTemplateComponentMenu(layout, ptr, "default_value", text); } else { -uiLayout *column = uiLayoutColumn(layout, true); -uiItemR(column, ptr, "default_value", 0, text, 0); +if (sock->typeinfo->subtype == PROP_DIRECTION) { + uiItemR(layout, ptr, "default_value", 0, "", ICON_NONE); +} +else { + uiLayout *column = uiLayoutColumn(layout, true); + uiItemR(column, ptr, "default_value", 0, text, ICON_NONE); +} } break; case SOCK_RGBA: diff --git a/source/blender/nodes/shader/nodes/node_shader_normal.c b/source/blender/nodes/shader/nodes/node_shader_normal.c index 074cc3dd87f..9dd89258446 100644 --- a/source/blender/nodes/shader/nodes/node_shader_normal.c +++ b/source/blender/nodes/shader/nodes/node_shader_normal.c @@ -25,7 +25,7 @@ /* NORMAL */ static bNodeSocketTemplate sh_node_normal_in[] = { -{SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_DIRECTION}, +{SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 1.0f, 0.0f, -1.0f, 1.0f, PROP_DIRECTION}, {-1, 0, ""}, }; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [39288768b57] master: Revert "Outliner: only activate outliner items when clicking on icon/text"
Commit: 39288768b5740fa621a1355334ffa878bfaa33b0 Author: Campbell Barton Date: Sat Aug 17 01:25:06 2019 +1000 Branches: master https://developer.blender.org/rB39288768b5740fa621a1355334ffa878bfaa33b0 Revert "Outliner: only activate outliner items when clicking on icon/text" The soc-2019-outliner branch relied on the previous behavior, since this is going to be merged soon, postpone this change. This reverts commit 9dab57a9f829881dad1e659b53413ded15ec085e. === M source/blender/editors/space_outliner/outliner_select.c === diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 7f45c4d22fa..c932766ab93 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -1305,15 +1305,8 @@ static int outliner_item_do_activate_from_cursor(bContext *C, TreeStoreElem *activate_tselem = TREESTORE(activate_te); outliner_item_select(soops, activate_te, extend, extend); - -/* Only change modes when clicking on the icon/text, - * otherwise we can't easily select without changing modes. */ -if ((te->flag & TE_ICONROW) == 0) { - if (view_mval[0] >= te->xs && view_mval[0] <= te->xend) { -do_outliner_item_activate_tree_element( -C, scene, view_layer, soops, activate_te, activate_tselem, extend, recursive); - } -} +do_outliner_item_activate_tree_element( +C, scene, view_layer, soops, activate_te, activate_tselem, extend, recursive); changed = true; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [66bd96e0bb9] master: Cleanup: remove gawain reference
Commit: 66bd96e0bb927f9cd529048a4a2219fede956c6e Author: Campbell Barton Date: Sat Aug 17 01:17:30 2019 +1000 Branches: master https://developer.blender.org/rB66bd96e0bb927f9cd529048a4a2219fede956c6e Cleanup: remove gawain reference === M source/blender/draw/DRW_engine.h M source/blender/draw/engines/eevee/eevee_lightcache.c M source/blender/draw/intern/draw_manager.c === diff --git a/source/blender/draw/DRW_engine.h b/source/blender/draw/DRW_engine.h index 6cae9ceb7d6..58cf0c2a8e0 100644 --- a/source/blender/draw/DRW_engine.h +++ b/source/blender/draw/DRW_engine.h @@ -166,8 +166,8 @@ void DRW_opengl_context_disable_ex(bool restore); void DRW_opengl_render_context_enable(void *re_gl_context); void DRW_opengl_render_context_disable(void *re_gl_context); -void DRW_gawain_render_context_enable(void *re_gpu_context); -void DRW_gawain_render_context_disable(void *re_gpu_context); +void DRW_gpu_render_context_enable(void *re_gpu_context); +void DRW_gpu_render_context_disable(void *re_gpu_context); void DRW_deferred_shader_remove(struct GPUMaterial *mat); diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c index c82a112b343..275e185a0e4 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.c +++ b/source/blender/draw/engines/eevee/eevee_lightcache.c @@ -80,8 +80,8 @@ extern void DRW_opengl_context_disable(void); extern void DRW_opengl_render_context_enable(void *re_gl_context); extern void DRW_opengl_render_context_disable(void *re_gl_context); -extern void DRW_gawain_render_context_enable(void *re_gpu_context); -extern void DRW_gawain_render_context_disable(void *re_gpu_context); +extern void DRW_gpu_render_context_enable(void *re_gpu_context); +extern void DRW_gpu_render_context_disable(void *re_gpu_context); typedef struct EEVEE_LightBake { Depsgraph *depsgraph; @@ -412,7 +412,7 @@ static void eevee_lightbake_context_enable(EEVEE_LightBake *lbake) if (lbake->gpu_context == NULL) { lbake->gpu_context = GPU_context_create(0); } -DRW_gawain_render_context_enable(lbake->gpu_context); +DRW_gpu_render_context_enable(lbake->gpu_context); } else { DRW_opengl_context_enable(); @@ -422,7 +422,7 @@ static void eevee_lightbake_context_enable(EEVEE_LightBake *lbake) static void eevee_lightbake_context_disable(EEVEE_LightBake *lbake) { if (lbake->gl_context) { -DRW_gawain_render_context_disable(lbake->gpu_context); +DRW_gpu_render_context_disable(lbake->gpu_context); DRW_opengl_render_context_disable(lbake->gl_context); } else { @@ -654,7 +654,7 @@ static void eevee_lightbake_delete_resources(EEVEE_LightBake *lbake) if (lbake->gl_context) { DRW_opengl_render_context_enable(lbake->gl_context); -DRW_gawain_render_context_enable(lbake->gpu_context); +DRW_gpu_render_context_enable(lbake->gpu_context); } else if (!lbake->resource_only) { DRW_opengl_context_enable(); @@ -675,8 +675,8 @@ static void eevee_lightbake_delete_resources(EEVEE_LightBake *lbake) } if (lbake->gpu_context) { -DRW_gawain_render_context_disable(lbake->gpu_context); -DRW_gawain_render_context_enable(lbake->gpu_context); +DRW_gpu_render_context_disable(lbake->gpu_context); +DRW_gpu_render_context_enable(lbake->gpu_context); GPU_context_discard(lbake->gpu_context); } diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index a2bbb368caa..b03240886ca 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1864,7 +1864,7 @@ void DRW_render_gpencil(struct RenderEngine *engine, struct Depsgraph *depsgraph DRW_opengl_render_context_enable(re_gl_context); /* We need to query gpu context after a gl context has been bound. */ re_gpu_context = RE_gpu_context_get(render); -DRW_gawain_render_context_enable(re_gpu_context); +DRW_gpu_render_context_enable(re_gpu_context); } else { DRW_opengl_context_enable(); @@ -1949,7 +1949,7 @@ void DRW_render_to_image(RenderEngine *engine, struct Depsgraph *depsgraph) DRW_opengl_render_context_enable(re_gl_context); /* We need to query gpu context after a gl context has been bound. */ re_gpu_context = RE_gpu_context_get(render); -DRW_gawain_render_context_enable(re_gpu_context); +DRW_gpu_render_context_enable(re_gpu_context); } else { DRW_opengl_context_enable(); @@ -2040,7 +2040,7 @@ void DRW_render_to_image(RenderEngine *engine, struct Depsgraph *depsgraph) /* Changing Context */ if (re_gl_context != NULL) { -DRW_gawain_render_context_disable(re_gpu_context); +DRW_gpu_render_context_disable(re_gpu_context); DRW_opengl_render_context_disable(re_gl_context); } else { @@
[Bf-blender-cvs] [d489aa29553] master: Cleanup: clang-format
Commit: d489aa295534ec008c1a0a504247afbfed5c21dd Author: Campbell Barton Date: Sat Aug 17 01:17:11 2019 +1000 Branches: master https://developer.blender.org/rBd489aa295534ec008c1a0a504247afbfed5c21dd Cleanup: clang-format === M source/blender/editors/interface/interface_templates.c M source/blender/windowmanager/intern/wm_window.c === diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 0cd048323f1..ae0823eb550 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -6393,16 +6393,16 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) } but = uiDefButO(block, - UI_BTYPE_BUT, - "SCREEN_OT_info_log_show", - WM_OP_INVOKE_REGION_WIN, - report->message, - UI_UNIT_X + 5, - 0, - UI_UNIT_X + width, - UI_UNIT_Y, - "Show in Info Log"); -rgba_float_to_uchar(but->col, rti->col); + UI_BTYPE_BUT, + "SCREEN_OT_info_log_show", + WM_OP_INVOKE_REGION_WIN, + report->message, + UI_UNIT_X + 5, + 0, + UI_UNIT_X + width, + UI_UNIT_Y, + "Show in Info Log"); + rgba_float_to_uchar(but->col, rti->col); } void uiTemplateInputStatus(uiLayout *layout, struct bContext *C) diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 9443dddb59a..19fa0e87e50 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -894,7 +894,7 @@ wmWindow *WM_window_open_temp(bContext *C, int x, int y, int sizex, int sizey, i ED_area_newspace(C, sa, SPACE_GRAPH, false); } else if (type == WM_WINDOW_INFO) { -ED_area_newspace(C,sa, SPACE_INFO,false); +ED_area_newspace(C, sa, SPACE_INFO, false); } else { ED_area_newspace(C, sa, SPACE_USERPREF, false); @@ -920,7 +920,7 @@ wmWindow *WM_window_open_temp(bContext *C, int x, int y, int sizex, int sizey, i else if (sa->spacetype == SPACE_GRAPH) { title = IFACE_("Blender Drivers Editor"); } - else if (sa->spacetype == SPACE_INFO){ + else if (sa->spacetype == SPACE_INFO) { title = IFACE_("Blender Info Log"); } else { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [27907408136] master: Cleanup: spelling
Commit: 27907408136cd3339beac5ea98318830ff837ab6 Author: Campbell Barton Date: Sat Aug 17 00:54:22 2019 +1000 Branches: master https://developer.blender.org/rB27907408136cd3339beac5ea98318830ff837ab6 Cleanup: spelling === M intern/cycles/bvh/bvh4.cpp M intern/cycles/kernel/filter/filter_transform.h M intern/cycles/kernel/kernel_shader.h M intern/cycles/render/stats.h M intern/cycles/util/util_vector.h M release/scripts/modules/bl_i18n_utils/utils.py M release/scripts/modules/bpy_extras/mesh_utils.py M release/scripts/startup/bl_operators/anim.py M source/blender/blenkernel/intern/armature_update.c M source/blender/blenkernel/intern/customdata.c M source/blender/blenkernel/intern/editmesh.c M source/blender/blenkernel/intern/library.c M source/blender/blenkernel/intern/mask.c M source/blender/blenkernel/intern/mball.c M source/blender/blenkernel/intern/mesh_evaluate.c M source/blender/blenkernel/intern/object_update.c M source/blender/blenkernel/intern/ocean.c M source/blender/blenkernel/intern/softbody.c M source/blender/blenlib/intern/BLI_ghash.c M source/blender/blenlib/intern/boxpack_2d.c M source/blender/blenlib/intern/math_geom.c M source/blender/blenloader/BLO_blend_defs.h M source/blender/blenloader/intern/readfile.c M source/blender/blenloader/intern/versioning_280.c M source/blender/blenloader/intern/writefile.c M source/blender/bmesh/intern/bmesh_mesh_conv.c M source/blender/bmesh/intern/bmesh_polygon.c M source/blender/bmesh/tools/bmesh_decimate_collapse.c M source/blender/bmesh/tools/bmesh_decimate_unsubdivide.c M source/blender/bmesh/tools/bmesh_region_match.c M source/blender/compositor/intern/COM_MemoryBuffer.h M source/blender/compositor/nodes/COM_ImageNode.cpp M source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cpp M source/blender/compositor/operations/COM_MaskOperation.cpp M source/blender/depsgraph/intern/depsgraph_tag.cc M source/blender/draw/intern/draw_cache.c M source/blender/draw/intern/draw_cache_extract_mesh.c M source/blender/editors/animation/anim_motion_paths.c M source/blender/editors/animation/keyingsets.c M source/blender/editors/armature/armature_add.c M source/blender/editors/curve/editcurve_paint.c M source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c M source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c M source/blender/editors/gpencil/gpencil_edit.c M source/blender/editors/interface/view2d_ops.c M source/blender/editors/mesh/editmesh_knife.c M source/blender/editors/screen/screen_edit.c M source/blender/editors/screen/screen_ops.c M source/blender/editors/sculpt_paint/paint_image_proj.c M source/blender/editors/space_view3d/view3d_edit.c M source/blender/editors/space_view3d/view3d_utils.c M source/blender/editors/transform/transform.c M source/blender/editors/transform/transform_input.c M source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h M source/blender/gpu/intern/gpu_vertex_format.c M source/blender/imbuf/IMB_imbuf.h M source/blender/imbuf/intern/scaling.c M source/blender/makesdna/DNA_meshdata_types.h M source/blender/makesdna/intern/dna_genfile.c M source/blender/makesrna/intern/rna_object.c M source/blender/makesrna/intern/rna_object_force.c M source/blender/makesrna/intern/rna_scene.c M source/blender/modifiers/intern/MOD_mask.c M source/blender/python/bmesh/bmesh_py_types_meshdata.c M source/blender/python/intern/bpy_app_translations.c M source/blender/python/mathutils/mathutils_Quaternion.c M source/blender/python/mathutils/mathutils_Vector.c M source/blender/python/mathutils/mathutils_geometry.c M source/blender/render/intern/source/pipeline.c M source/blender/windowmanager/intern/wm_files.c M source/blender/windowmanager/intern/wm_window.c M source/creator/creator.c === diff --git a/intern/cycles/bvh/bvh4.cpp b/intern/cycles/bvh/bvh4.cpp index 850bdf5b8b4..b6df9024ffa 100644 --- a/intern/cycles/bvh/bvh4.cpp +++ b/intern/cycles/bvh/bvh4.cpp @@ -43,8 +43,7 @@ BVHNode *bvh_node_merge_children_recursively(const BVHNode *node) if (node->is_leaf()) { return new LeafNode(*reinterpret_cast(node)); } - /* Collect nodes of one layer deeper, allowing us to have more childrem in - * an inner layer. */ + /* Collect nodes of one layer deeper, allowing us to have more children in an inner layer. */ assert(node->num_children() <= 2); const BVHNode *children[4]; const BVHNode *child0 = node->get_child(0); diff --git
[Bf-blender-cvs] [05edcf63295] master: Cleanup: unused args/vars
Commit: 05edcf632950a81adb4a165340e01c5c92f1c578 Author: Campbell Barton Date: Sat Aug 17 00:53:18 2019 +1000 Branches: master https://developer.blender.org/rB05edcf632950a81adb4a165340e01c5c92f1c578 Cleanup: unused args/vars === M source/blender/blenloader/intern/versioning_280.c M source/blender/editors/screen/screen_ops.c === diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index a80fa9f8f3d..078fbb2c5f6 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -825,7 +825,7 @@ static void do_versions_material_convert_legacy_blend_mode(bNodeTree *ntree, cha } } -void do_versions_after_linking_280(Main *bmain, ReportList *reports) +void do_versions_after_linking_280(Main *bmain, ReportList *UNUSED(reports)) { bool use_collection_compat_28 = true; diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 272c5623dc6..42f502f6511 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -4780,17 +4780,12 @@ static void SCREEN_OT_drivers_editor_show(struct wmOperatorType *ot) static int info_log_show_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - PointerRNA ptr = {{NULL}}; - PropertyRNA *prop = NULL; - int sizex = 900 * UI_DPI_FAC; int sizey = 580 * UI_DPI_FAC; int shift_y = 480; /* changes context! */ - if (WM_window_open_temp(C, event->x, event->y+shift_y, sizex, sizey, WM_WINDOW_INFO) != NULL) { -ScrArea *area = CTX_wm_area(C); -ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_HEADER); + if (WM_window_open_temp(C, event->x, event->y + shift_y, sizex, sizey, WM_WINDOW_INFO) != NULL) { return OPERATOR_FINISHED; } else { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [145f8517316] master: UI: click on status bar report message now opens window with Info editor
Commit: 145f851731655910f653763f4122288bc12c5629 Author: Brecht Van Lommel Date: Fri Aug 16 16:24:16 2019 +0200 Branches: master https://developer.blender.org/rB145f851731655910f653763f4122288bc12c5629 UI: click on status bar report message now opens window with Info editor Patch by Valentin (Poulpator) Differential Revision: https://developer.blender.org/D5468 === M source/blender/editors/interface/interface_templates.c M source/blender/editors/screen/screen_ops.c M source/blender/windowmanager/WM_api.h M source/blender/windowmanager/intern/wm_window.c === diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 37eb1770f68..0cd048323f1 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -6392,22 +6392,17 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) block, UI_BTYPE_LABEL, 0, icon, 2, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); } - UI_block_emboss_set(block, UI_EMBOSS); - - uiDefBut(block, - UI_BTYPE_LABEL, - 0, + but = uiDefButO(block, + UI_BTYPE_BUT, + "SCREEN_OT_info_log_show", + WM_OP_INVOKE_REGION_WIN, report->message, UI_UNIT_X + 5, 0, UI_UNIT_X + width, UI_UNIT_Y, - NULL, - 0.0f, - 0.0f, - 0, - 0, - ""); + "Show in Info Log"); +rgba_float_to_uchar(but->col, rti->col); } void uiTemplateInputStatus(uiLayout *layout, struct bContext *C) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 8377fd0e128..272c5623dc6 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -4774,6 +4774,45 @@ static void SCREEN_OT_drivers_editor_show(struct wmOperatorType *ot) /** \} */ +/* */ +/** \name Show Info Log Operator + * \{ */ + +static int info_log_show_invoke(bContext *C, wmOperator *op, const wmEvent *event) +{ + PointerRNA ptr = {{NULL}}; + PropertyRNA *prop = NULL; + + int sizex = 900 * UI_DPI_FAC; + int sizey = 580 * UI_DPI_FAC; + int shift_y = 480; + + /* changes context! */ + if (WM_window_open_temp(C, event->x, event->y+shift_y, sizex, sizey, WM_WINDOW_INFO) != NULL) { +ScrArea *area = CTX_wm_area(C); +ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_HEADER); +return OPERATOR_FINISHED; + } + else { +BKE_report(op->reports, RPT_ERROR, "Failed to open window!"); +return OPERATOR_CANCELLED; + } +} + +static void SCREEN_OT_info_log_show(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Show Info Log"; + ot->description = "Show info log in a separate window"; + ot->idname = "SCREEN_OT_info_log_show"; + + /* api callbacks */ + ot->invoke = info_log_show_invoke; + ot->poll = ED_operator_screenactive; +} + +/** \} */ + /* */ /** \name New Screen Operator * \{ */ @@ -5241,6 +5280,7 @@ void ED_operatortypes_screen(void) WM_operatortype_append(SCREEN_OT_screenshot); WM_operatortype_append(SCREEN_OT_userpref_show); WM_operatortype_append(SCREEN_OT_drivers_editor_show); + WM_operatortype_append(SCREEN_OT_info_log_show); WM_operatortype_append(SCREEN_OT_region_blend); WM_operatortype_append(SCREEN_OT_space_type_set_or_cycle); WM_operatortype_append(SCREEN_OT_space_context_cycle); diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index cf87afa2a34..0f0d74c259b 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -162,6 +162,7 @@ enum { WM_WINDOW_RENDER = 1, WM_WINDOW_USERPREFS, WM_WINDOW_DRIVERS, + WM_WINDOW_INFO, // WM_WINDOW_FILESEL // UNUSED }; diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index d17b8817691..dc9a7b29bb2 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -893,6 +893,9 @@ wmWindow *WM_window_open_temp(bContext *C, int x, int y, int sizex, int sizey, i else if (type == WM_WINDOW_DRIVERS) { ED_area_newspace(C, sa, SPACE_GRAPH, false); } + else if (type == WM_WINDOW_INFO) { +ED_area_newspace(C,sa, SPACE_INFO,false); + } else { ED_area_newspace(C, sa, SPACE_USERPREF, false); } @@ -917,6 +920,9 @@ wmWindow *WM_window_open_temp(bContext *C, int x, int y, int sizex, int sizey, i else if (sa->spacetype == SPACE_GRAPH) { title = IFACE_("Blender Drivers Editor"); } +
[Bf-blender-cvs] [42cee6ab213] master: Fix part of T62917: selected edge not highlighted with black and white overlays
Commit: 42cee6ab213406814aae62ff28845559fbd5f4f1 Author: EitanSomething Date: Fri Aug 16 16:23:02 2019 +0200 Branches: master https://developer.blender.org/rB42cee6ab213406814aae62ff28845559fbd5f4f1 Fix part of T62917: selected edge not highlighted with black and white overlays Differential Revision: https://developer.blender.org/D5369 === M source/blender/editors/uvedit/uvedit_draw.c === diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index d97714061c0..f485b440692 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -367,33 +367,33 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit, Depsgraph * break; } case SI_UVDT_BLACK: - case SI_UVDT_WHITE: { -GPU_line_width(1.0f); -GPU_batch_program_set_builtin(edges, GPU_SHADER_2D_UNIFORM_COLOR); -if (sima->dt_uv == SI_UVDT_WHITE) { - GPU_batch_uniform_4f(edges, "color", 1.0f, 1.0f, 1.0f, 1.0f); -} -else { - GPU_batch_uniform_4f(edges, "color", 0.0f, 0.0f, 0.0f, 1.0f); -} -GPU_batch_draw(edges); -break; - } + case SI_UVDT_WHITE: case SI_UVDT_OUTLINE: { /* We could modify the vbo's data filling * instead of modifying the provoking vert. */ glProvokingVertex(GL_FIRST_VERTEX_CONVENTION); -UI_GetThemeColor4fv(TH_WIRE_EDIT, col1); UI_GetThemeColor4fv(TH_EDGE_SELECT, col2); GPU_batch_program_set_builtin( edges, (interpedges) ? GPU_SHADER_2D_UV_EDGES_SMOOTH : GPU_SHADER_2D_UV_EDGES); -/* Black Outline. */ -GPU_line_width(3.0f); -GPU_batch_uniform_4f(edges, "edgeColor", 0.0f, 0.0f, 0.0f, 1.0f); -GPU_batch_uniform_4f(edges, "selectColor", 0.0f, 0.0f, 0.0f, 1.0f); -GPU_batch_draw(edges); + +if (sima->dt_uv == SI_UVDT_OUTLINE) { + /* Black Outline. */ + GPU_line_width(3.0f); + GPU_batch_uniform_4f(edges, "edgeColor", 0.0f, 0.0f, 0.0f, 1.0f); + GPU_batch_uniform_4f(edges, "selectColor", 0.0f, 0.0f, 0.0f, 1.0f); + GPU_batch_draw(edges); + + UI_GetThemeColor4fv(TH_WIRE_EDIT, col1); +} +else if (sima->dt_uv == SI_UVDT_WHITE) { + copy_v4_fl4(col1, 1.0f, 1.0f, 1.0f, 1.0f); +} +else { + copy_v4_fl4(col1, 0.0f, 0.0f, 0.0f, 1.0f); +} + /* Inner Line. Use depth test to insure selection is drawn on top. */ GPU_depth_test(true); GPU_line_width(1.0f); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ea8e0df6727] master: Fix T55054: possible use of unsupported instructions in Cycles texture code
Commit: ea8e0df672713a7b3ff408242c940e1f5e78c9c1 Author: Lazydodo Date: Fri Aug 16 16:27:15 2019 +0200 Branches: master https://developer.blender.org/rBea8e0df672713a7b3ff408242c940e1f5e78c9c1 Fix T55054: possible use of unsupported instructions in Cycles texture code Differential Revision: https://developer.blender.org/D5326 === M intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h === diff --git a/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h b/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h index 4289e2bbb85..8f311baf010 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h +++ b/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h @@ -19,6 +19,10 @@ CCL_NAMESPACE_BEGIN +/* Make template functions private so symbols don't conflict between kernels with different + * instruction sets. */ +namespace { + template struct TextureInterpolator { #define SET_CUBIC_SPLINE_WEIGHTS(u, t) \ { \ @@ -523,6 +527,8 @@ ccl_device float4 kernel_tex_image_interp_3d( } } +} /* Namespace. */ + CCL_NAMESPACE_END #endif // __KERNEL_CPU_IMAGE_H__ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4f03217dade] master: Fix Unreported crash when opening linked material using nodegroups
Commit: 4f03217dade97bcd9045aeb9150c89038ce9 Author: Clément Foucault Date: Fri Aug 16 16:41:59 2019 +0200 Branches: master https://developer.blender.org/rB4f03217dade97bcd9045aeb9150c89038ce9 Fix Unreported crash when opening linked material using nodegroups This removes the recursive conversion of material using old blend modes. With the approval of @brecht === M source/blender/blenloader/intern/versioning_280.c === diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 8cf98761919..a80fa9f8f3d 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -735,13 +735,9 @@ static void do_versions_seq_alloc_transform_and_crop(ListBase *seqbase) } /* Return true if there is something to convert. */ -static bool do_versions_material_convert_legacy_blend_mode(bNodeTree *ntree, - char blend_method, - GSet *nodegrp_tree_set, - GSet *nooutput_tree_set) +static void do_versions_material_convert_legacy_blend_mode(bNodeTree *ntree, char blend_method) { bool need_update = false; - bool do_conversion = false; /* Iterate backwards from end so we don't encounter newly added links. */ bNodeLink *prevlink; @@ -754,31 +750,6 @@ static bool do_versions_material_convert_legacy_blend_mode(bNodeTree *ntree, bNode *tonode = link->tonode; bNodeSocket *tosock = link->tosock; -if (nodegrp_tree_set) { - if (fromnode->type == NODE_GROUP && fromnode->id != NULL) { -bNodeTree *group_ntree = (bNodeTree *)fromnode->id; -if (BLI_gset_add(nodegrp_tree_set, group_ntree)) { - /* Recursive but not convert (blend_method = -1). Conversion happens after. */ - if (!do_versions_material_convert_legacy_blend_mode( - group_ntree, -1, nodegrp_tree_set, nooutput_tree_set)) { -/* There is no output to convert in the tree. */ -BLI_gset_add(nooutput_tree_set, group_ntree); - } -} - } - if (tonode->type == NODE_GROUP && tonode->id != NULL) { -bNodeTree *group_ntree = (bNodeTree *)tonode->id; -if (BLI_gset_add(nodegrp_tree_set, group_ntree)) { - /* Recursive but not convert (blend_method = -1). Conversion happens after. */ - if (!do_versions_material_convert_legacy_blend_mode( - group_ntree, -1, nodegrp_tree_set, nooutput_tree_set)) { -/* There is no output to convert in the tree. */ -BLI_gset_add(nooutput_tree_set, group_ntree); - } -} - } -} - if (!(tonode->type == SH_NODE_OUTPUT_MATERIAL && STREQ(tosock->identifier, "Surface"))) { continue; } @@ -788,8 +759,6 @@ static bool do_versions_material_convert_legacy_blend_mode(bNodeTree *ntree, continue; } -do_conversion = true; - if (blend_method == 1 /* MA_BM_ADD */) { nodeRemLink(ntree, link); @@ -854,8 +823,6 @@ static bool do_versions_material_convert_legacy_blend_mode(bNodeTree *ntree, if (need_update) { ntreeUpdateTree(NULL, ntree); } - - return do_conversion; } void do_versions_after_linking_280(Main *bmain, ReportList *reports) @@ -1259,74 +1226,20 @@ void do_versions_after_linking_280(Main *bmain, ReportList *reports) * now that we use dualsource blending. */ /* We take care of doing only nodetrees that are always part of materials * with old blending modes. */ -GSet *ntrees_additive = BLI_gset_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, __func__); -GSet *ntrees_multiply = BLI_gset_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, __func__); -GSet *ntrees_nolegacy = BLI_gset_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, __func__); -GSet *ntrees_nooutput = BLI_gset_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, __func__); for (Material *ma = bmain->materials.first; ma; ma = ma->id.next) { bNodeTree *ntree = ma->nodetree; if (ma->blend_method == 1 /* MA_BM_ADD */) { if (ma->use_nodes) { - do_versions_material_convert_legacy_blend_mode( - ntree, ma->blend_method, ntrees_additive, ntrees_nooutput); + do_versions_material_convert_legacy_blend_mode(ntree, 1 /* MA_BM_ADD */); } ma->blend_method = MA_BM_BLEND; } else if (ma->blend_method == 2 /* MA_BM_MULTIPLY */) { if (ma->use_nodes) { - do_versions_material_convert_legacy_blend_mode( - ntree, ma->blend_method, ntrees_multiply, ntrees_nooutput); + do_versions_material_convert_legacy_blend_mode(ntree, 2 /* MA_BM_MULTIPLY
[Bf-blender-cvs] [e4b2ae0fb62] soc-2019-embree-gpu: Add support for curve and unaligned nodes
Commit: e4b2ae0fb62addc6f1b34db934d1785f960833bf Author: MATILLAT Quentin Date: Fri Aug 16 16:31:12 2019 +0200 Branches: soc-2019-embree-gpu https://developer.blender.org/rBe4b2ae0fb62addc6f1b34db934d1785f960833bf Add support for curve and unaligned nodes === M intern/cycles/bvh/bvh_embree.cpp M intern/cycles/bvh/bvh_embree_converter.cpp M intern/cycles/bvh/bvh_embree_converter.h === diff --git a/intern/cycles/bvh/bvh_embree.cpp b/intern/cycles/bvh/bvh_embree.cpp index 6a1c2c90489..c3bc8dd3509 100644 --- a/intern/cycles/bvh/bvh_embree.cpp +++ b/intern/cycles/bvh/bvh_embree.cpp @@ -487,8 +487,8 @@ void BVHEmbree::build(Progress , Stats *stats_) progress.set_substatus("Packing geometry"); if(this->bvh_layout == BVH_LAYOUT_EMBREE_CONVERTED) { -BVHEmbreeConverter conv(scene, objects, this->params); -conv.fillPack(this->pack, this->objects); +BVHEmbreeConverter conv(this->scene, this->objects, this->params); +conv.fillPack(this->pack); } else { pack_primitives(); @@ -817,7 +817,7 @@ void BVHEmbree::add_curves(Object *ob, int i) rtcReleaseGeometry(geom_id); } -void BVHEmbree::pack_nodes(const BVHNode *r) +void BVHEmbree::pack_nodes(const BVHNode *) { /* Quite a bit of this code is for compatibility with Cycles' native BVH. */ if (!params.top_level) { diff --git a/intern/cycles/bvh/bvh_embree_converter.cpp b/intern/cycles/bvh/bvh_embree_converter.cpp index fe851b8074f..ed804f59adf 100644 --- a/intern/cycles/bvh/bvh_embree_converter.cpp +++ b/intern/cycles/bvh/bvh_embree_converter.cpp @@ -14,9 +14,6 @@ * limitations under the License. */ -/* This class implements a converter from Embree internal data structure to - * Blender's internal structure - */ #ifdef WITH_EMBREE @@ -28,296 +25,355 @@ CCL_NAMESPACE_BEGIN /* Utility functions */ +void packPush(PackedBVH *pack, const size_t packIdx, + const int object_id, const int prim_id, + const int prim_type, const uint visibility, + const uint tri_index) +{ + pack->prim_index.resize(packIdx + 1); + pack->prim_type.resize(packIdx + 1); + pack->prim_object.resize(packIdx + 1); + pack->prim_visibility.resize(packIdx + 1); + pack->prim_tri_index.resize(packIdx + 1); + + pack->prim_index[packIdx] = prim_id; + pack->prim_type[packIdx] = prim_type; + pack->prim_object[packIdx] = object_id; + pack->prim_visibility[packIdx] = visibility; + pack->prim_tri_index[packIdx] = tri_index; -void packPush(PackedBVH *pack, const size_t packIdx, const int object_id, const int prim_id, const int prim_type, const uint visibility, const uint tri_index) { -pack->prim_index.resize(packIdx + 1); -pack->prim_type.resize(packIdx + 1); -pack->prim_object.resize(packIdx + 1); -pack->prim_visibility.resize(packIdx + 1); -pack->prim_tri_index.resize(packIdx + 1); +} -pack->prim_index[packIdx] = prim_id; -pack->prim_type[packIdx] = prim_type; -pack->prim_object[packIdx] = object_id; -pack->prim_visibility[packIdx] = visibility; -pack->prim_tri_index[packIdx] = tri_index; +BoundBox RTCBoundBoxToCCL(const RTCBounds ) +{ + return BoundBox(make_float3(bound.lower_x, bound.lower_y, bound.lower_z), + make_float3(bound.upper_x, bound.upper_y, bound.upper_z)); } -ccl::BoundBox RTCBoundBoxToCCL(const RTCBounds ) { -return ccl::BoundBox( -make_float3(bound.lower_x, bound.lower_y, bound.lower_z), -make_float3(bound.upper_x, bound.upper_y, bound.upper_z)); +Transform transformSpaceFromBound(const BoundBox ) { + Transform space = transform_identity(); -} + space.x.w -= bounds.min.x; + space.y.w -= bounds.min.y; + space.z.w -= bounds.min.z; + float3 dim = bounds.max - bounds.min; -BVHNode *bvh_shrink(BVHNode *root) { -if(root->is_leaf()) { -if(root->num_triangles() == 0) // Remove empty leafs -return nullptr; -else -return root; -} + return transform_scale(1.0f / max(1e-18f, dim.x), + 1.0f / max(1e-18f, dim.y), + 1.0f / max(1e-18f, dim.z)) * space; +} -InnerNode *node = dynamic_cast(root); -int num_children = 0; -BVHNode* children[4]; +BVHNode *merge(BVHNode *oldRoot, BVHNode *n0, BVHNode *n1) { + BoundBox childBB = merge(n0->bounds, n1->bounds); + BVHNode *root = new InnerNode(childBB, n0, n1); -for(int i = 0; i < node->num_children(); ++i) { -BVHNode *child = bvh_shrink(node->get_child(i)); -if(child != nullptr) -children[num_children++] = child; -} + /* If one of the child has linear bound, take the parents bound */ + if(n0->deltaBounds != nullptr || n1->deltaBounds != nullptr) { +root->bounds = oldRoot->bounds; +if(oldRoot->deltaBounds != nullptr) root->deltaBounds = new
[Bf-blender-cvs] [dc0376555fa] master: LibOverride: do not allow diffing on collections' `all_objects` member.
Commit: dc0376555fa948746c97a68cdf39ef4487505710 Author: Bastien Montagne Date: Fri Aug 16 15:34:04 2019 +0200 Branches: master https://developer.blender.org/rBdc0376555fa948746c97a68cdf39ef4487505710 LibOverride: do not allow diffing on collections' `all_objects` member. This is useless (as diffing on `objects` + `children` shall be enough), and potentially very time consuming in case of heavy hierarchy of collections. === M source/blender/makesrna/intern/rna_collection.c === diff --git a/source/blender/makesrna/intern/rna_collection.c b/source/blender/makesrna/intern/rna_collection.c index 5a37c4c0e6f..691803e0de1 100644 --- a/source/blender/makesrna/intern/rna_collection.c +++ b/source/blender/makesrna/intern/rna_collection.c @@ -403,6 +403,7 @@ void RNA_def_collections(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Object"); RNA_def_property_ui_text( prop, "All Objects", "Objects that are in this collection and its child collections"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); RNA_def_property_collection_funcs(prop, "rna_Collection_all_objects_begin", "rna_iterator_listbase_next", ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d8bb429964d] master: Fix T68651: LibOverride: Fix bad handling of RNA collections pointers.
Commit: d8bb429964df170d27fe4a89e1c5ef754f0d018a Author: Bastien Montagne Date: Fri Aug 16 16:19:52 2019 +0200 Branches: master https://developer.blender.org/rBd8bb429964df170d27fe4a89e1c5ef754f0d018a Fix T68651: LibOverride: Fix bad handling of RNA collections pointers. We were storing the 'item' part in the RNA path of the override op itself, which will not work with IDs because overriding local one might not have the same name as the linked one (when some local ID with same name already exists). Now we are properly handling this using the expected actual override operation, which stores necessary data (names or indices) from both local and linked data. === M source/blender/makesrna/intern/rna_access.c M source/blender/makesrna/intern/rna_rna.c === diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 330d45c2fa5..b78a3304cc7 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -8860,6 +8860,80 @@ static void rna_property_override_apply_ex(Main *bmain, } continue; } + +/* Note: will have to think about putting that logic into its own function maybe? + * Would be nice to have it in a single place... */ +PointerRNA private_ptr_item_local, private_ptr_item_override, private_ptr_item_storage; +if (opop->subitem_local_name != NULL || opop->subitem_reference_name != NULL || +opop->subitem_local_index != -1 || opop->subitem_reference_index != -1) { + RNA_POINTER_INVALIDATE(_ptr_item_local); + RNA_POINTER_INVALIDATE(_ptr_item_override); + RNA_POINTER_INVALIDATE(_ptr_item_storage); + if (opop->subitem_local_name != NULL) { +RNA_property_collection_lookup_string( +ptr_local, prop_local, opop->subitem_local_name, _ptr_item_local); +if (opop->subitem_reference_name != NULL) { + RNA_property_collection_lookup_string(ptr_override, +prop_override, +opop->subitem_reference_name, +_ptr_item_override); +} +else { + RNA_property_collection_lookup_string( + ptr_override, prop_override, opop->subitem_local_name, _ptr_item_override); +} + } + else if (opop->subitem_reference_name != NULL) { +RNA_property_collection_lookup_string( +ptr_local, prop_local, opop->subitem_reference_name, _ptr_item_local); +RNA_property_collection_lookup_string( +ptr_override, prop_override, opop->subitem_reference_name, _ptr_item_override); + } + else if (opop->subitem_local_index != -1) { +RNA_property_collection_lookup_int( +ptr_local, prop_local, opop->subitem_local_index, _ptr_item_local); +if (opop->subitem_reference_index != -1) { + RNA_property_collection_lookup_int(ptr_override, + prop_override, + opop->subitem_reference_index, + _ptr_item_override); +} +else { + RNA_property_collection_lookup_int( + ptr_override, prop_override, opop->subitem_local_index, _ptr_item_override); +} + } + else if (opop->subitem_reference_index != -1) { +RNA_property_collection_lookup_int( +ptr_local, prop_local, opop->subitem_reference_index, _ptr_item_local); +RNA_property_collection_lookup_int(ptr_override, + prop_override, + opop->subitem_reference_index, + _ptr_item_override); + } + if (prop_storage != NULL) { +if (opop->subitem_local_name != NULL) { + RNA_property_collection_lookup_string( + ptr_storage, prop_storage, opop->subitem_local_name, _ptr_item_storage); +} +else if (opop->subitem_reference_name != NULL) { + RNA_property_collection_lookup_string( + ptr_storage, prop_storage, opop->subitem_reference_name, _ptr_item_storage); +} +else if (opop->subitem_local_index != -1) { + RNA_property_collection_lookup_int( + ptr_storage, prop_storage, opop->subitem_local_index, _ptr_item_storage); +} +else if (opop->subitem_reference_index != -1) { + RNA_property_collection_lookup_int( + ptr_storage, prop_storage, opop->subitem_reference_index, _ptr_item_storage); +} + } + ptr_item_local = _ptr_item_local; + ptr_item_override = _ptr_item_override; + ptr_item_storage = _ptr_item_storage; +}
[Bf-blender-cvs] [d436d67fcc4] master: Cleanup: proper use of UNUSED_VARS_NDEBUG instead of random hack.
Commit: d436d67fcc47b877da3844b5b1a441c5e6574c82 Author: Bastien Montagne Date: Fri Aug 16 16:18:48 2019 +0200 Branches: master https://developer.blender.org/rBd436d67fcc47b877da3844b5b1a441c5e6574c82 Cleanup: proper use of UNUSED_VARS_NDEBUG instead of random hack. === M source/blender/makesrna/intern/rna_collection.c === diff --git a/source/blender/makesrna/intern/rna_collection.c b/source/blender/makesrna/intern/rna_collection.c index 691803e0de1..4700df5352f 100644 --- a/source/blender/makesrna/intern/rna_collection.c +++ b/source/blender/makesrna/intern/rna_collection.c @@ -130,9 +130,9 @@ static bool rna_Collection_objects_override_apply(Main *bmain, PointerRNA *UNUSED(ptr_item_storage), IDOverrideLibraryPropertyOperation *opop) { - (void)opop; BLI_assert(opop->operation == IDOVERRIDE_LIBRARY_OP_REPLACE && "Unsupported RNA override operation on collections' objects"); + UNUSED_VARS_NDEBUG(opop); Collection *coll_dst = ptr_dst->id.data; @@ -233,9 +233,9 @@ static bool rna_Collection_children_override_apply(Main *bmain, PointerRNA *UNUSED(ptr_item_storage), IDOverrideLibraryPropertyOperation *opop) { - (void)opop; BLI_assert(opop->operation == IDOVERRIDE_LIBRARY_OP_REPLACE && "Unsupported RNA override operation on collections' objects"); + UNUSED_VARS_NDEBUG(opop); Collection *coll_dst = ptr_dst->id.data; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a8eb9448e74] functions: Merge branch 'master' into functions
Commit: a8eb9448e74aadf75eab41a6faa97bc28e5a4709 Author: Jacques Lucke Date: Fri Aug 16 15:03:06 2019 +0200 Branches: functions https://developer.blender.org/rBa8eb9448e74aadf75eab41a6faa97bc28e5a4709 Merge branch 'master' into functions === === diff --cc source/blender/editors/object/object_ops.c index e160f73e3aa,38c06319450..0a9915679f1 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@@ -258,7 -258,7 +258,8 @@@ void ED_operatortypes_object(void WM_operatortype_append(OBJECT_OT_hide_view_set); WM_operatortype_append(OBJECT_OT_hide_collection); + WM_operatortype_append(OBJECT_OT_voxel_remesh); + WM_operatortype_append(OBJECT_OT_bparticles_clear_cache); } void ED_operatormacros_object(void) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [078d02f5574] master: User Preferences: Added "Enabled add-ons only" preference
Commit: 078d02f55743cd34c51c4dd7ca710b22441a12da Author: Sybren A. Stüvel Date: Thu Aug 15 10:21:04 2019 +0200 Branches: master https://developer.blender.org/rB078d02f55743cd34c51c4dd7ca710b22441a12da User Preferences: Added "Enabled add-ons only" preference This checkbox replaces the "Disabled" and "Enabled" entries in the filter drop-down. As a result, it now takes a single click to limit the shown entries to enabled add-ons only. This is also an actual flag in the preferences, and thus its state is saved between runs on Blender (in contrast to the filter, which is always reset to "All"). Reviewed by: brecht, billreynish === M release/scripts/startup/bl_operators/userpref.py M release/scripts/startup/bl_ui/__init__.py M release/scripts/startup/bl_ui/space_userpref.py M source/blender/makesdna/DNA_userdef_types.h M source/blender/makesrna/intern/rna_userdef.c === diff --git a/release/scripts/startup/bl_operators/userpref.py b/release/scripts/startup/bl_operators/userpref.py index 034aa9fff6c..6ec6855296c 100644 --- a/release/scripts/startup/bl_operators/userpref.py +++ b/release/scripts/startup/bl_operators/userpref.py @@ -667,6 +667,7 @@ class PREFERENCES_OT_addon_install(Operator): info = addon_utils.module_bl_info(mod) # show the newly installed addon. +context.preferences.view.show_addons_enabled_only = False context.window_manager.addon_filter = 'All' context.window_manager.addon_search = info["name"] break @@ -796,6 +797,7 @@ class PREFERENCES_OT_addon_show(Operator): info["show_expanded"] = True context.preferences.active_section = 'ADDONS' +context.preferences.view.show_addons_enabled_only = False context.window_manager.addon_filter = 'All' context.window_manager.addon_search = info["name"] bpy.ops.screen.userpref_show('INVOKE_DEFAULT') diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 690a922b0d5..5daacbb2e44 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -126,8 +126,6 @@ def register(): items = [ ('All', "All", "All Add-ons"), ('User', "User", "All Add-ons Installed by User"), -('Enabled', "Enabled", "All Enabled Add-ons"), -('Disabled', "Disabled", "All Disabled Add-ons"), ] items_unique = set() diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 87baea9cdd8..ce4a6fb835e 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -1744,6 +1744,7 @@ class USERPREF_PT_addons(Panel): row.operator("preferences.addon_refresh", icon='FILE_REFRESH', text="Refresh") row = layout.row() +row.prop(context.preferences.view, "show_addons_enabled_only") row.prop(context.window_manager, "addon_filter", text="") row.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM') @@ -1770,6 +1771,7 @@ class USERPREF_PT_addons(Panel): "(see console for details)", ) +show_enabled_only = context.preferences.view.show_addons_enabled_only filter = context.window_manager.addon_filter search = context.window_manager.addon_search.lower() support = context.window_manager.addon_support @@ -1786,13 +1788,15 @@ class USERPREF_PT_addons(Panel): continue # check if addon should be visible with current filters -if ( -(filter == "All") or -(filter == info["category"]) or -(filter == "Enabled" and is_enabled) or -(filter == "Disabled" and not is_enabled) or -(filter == "User" and (mod.__file__.startswith(addon_user_dirs))) -): +is_visible = ( +(filter == "All") or +(filter == info["category"]) or +(filter == "User" and (mod.__file__.startswith(addon_user_dirs))) +) +if show_enabled_only: +is_visible = is_visible and is_enabled + +if is_visible: if search and search not in info["name"].lower(): if info["author"]: if search not in info["author"].lower(): diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index b8914c7a74f..3cb96ce8bf8 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -868,6 +868,7 @@ typedef enum
[Bf-blender-cvs] [ecc3b033a7d] master: Fix T68715 Hidden polygon Edit mode are hidden in Object level
Commit: ecc3b033a7d2bc71f3c75cd8152a647d18457ba1 Author: Clément Foucault Date: Fri Aug 16 15:00:38 2019 +0200 Branches: master https://developer.blender.org/rBecc3b033a7d2bc71f3c75cd8152a647d18457ba1 Fix T68715 Hidden polygon Edit mode are hidden in Object level === M source/blender/draw/intern/draw_cache_extract_mesh.c === diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c b/source/blender/draw/intern/draw_cache_extract_mesh.c index 95b984747bd..e735554b1f2 100644 --- a/source/blender/draw/intern/draw_cache_extract_mesh.c +++ b/source/blender/draw/intern/draw_cache_extract_mesh.c @@ -505,7 +505,7 @@ static void extract_tris_looptri_mesh(const MeshRenderData *mr, void *_data) { const MPoly *mpoly = >mpoly[mlt->poly]; - if (!(mpoly->flag & ME_HIDE)) { + if (!(mr->use_hide && (mpoly->flag & ME_HIDE))) { MeshExtract_Tri_Data *data = _data; int *mat_tri_ofs = data->tri_mat_end; GPU_indexbuf_set_tri_verts( ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ee8aad79c15] master: Fix T56408: Hair children recalc on every frame on Alembic mesh
Commit: ee8aad79c1590cd0e98ba67961909ebfa8f6a803 Author: Sybren A. Stüvel Date: Fri Aug 16 14:52:08 2019 +0200 Branches: master https://developer.blender.org/rBee8aad79c1590cd0e98ba67961909ebfa8f6a803 Fix T56408: Hair children recalc on every frame on Alembic mesh This fixes the glitching hairs described in T56408, T63534, and possibly also T63534. The fix consists of returning the original mesh (i.e. as visible in edit mode) when constructing the ORCO mesh. This allows a static set of coordinates to be used when computing the child hair positions. The original mesh is only returned when it has the same topology (at least same number of vertices, loops, and polys. It's up the author of the Alembic file to ensure stable geometry when it's desired to be compatible with Blender's hair system. Reviewers: mont29, brecht Differential Revision: https://developer.blender.org/D5492 === M source/blender/alembic/ABC_alembic.h M source/blender/alembic/intern/abc_mesh.cc M source/blender/alembic/intern/abc_mesh.h M source/blender/alembic/intern/abc_object.cc M source/blender/alembic/intern/abc_object.h M source/blender/alembic/intern/alembic_capi.cc M source/blender/modifiers/intern/MOD_meshsequencecache.c === diff --git a/source/blender/alembic/ABC_alembic.h b/source/blender/alembic/ABC_alembic.h index 653382017d6..696e0ff1810 100644 --- a/source/blender/alembic/ABC_alembic.h +++ b/source/blender/alembic/ABC_alembic.h @@ -117,6 +117,12 @@ struct Mesh *ABC_read_mesh(struct CacheReader *reader, const char **err_str, int flags); +bool ABC_mesh_topology_changed(struct CacheReader *reader, + struct Object *ob, + struct Mesh *existing_mesh, + const float time, + const char **err_str); + void CacheReader_incref(struct CacheReader *reader); void CacheReader_free(struct CacheReader *reader); diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc index 6647ca83bd6..be2793e38f7 100644 --- a/source/blender/alembic/intern/abc_mesh.cc +++ b/source/blender/alembic/intern/abc_mesh.cc @@ -1131,6 +1131,31 @@ bool AbcMeshReader::accepts_object_type( return true; } +bool AbcMeshReader::topology_changed(Mesh *existing_mesh, const ISampleSelector _sel) +{ + IPolyMeshSchema::Sample sample; + try { +sample = m_schema.getValue(sample_sel); + } + catch (Alembic::Util::Exception ) { +printf("Alembic: error reading mesh sample for '%s/%s' at time %f: %s\n", + m_iobject.getFullName().c_str(), + m_schema.getName().c_str(), + sample_sel.getRequestedTime(), + ex.what()); +// A similar error in read_mesh() would just return existing_mesh. +return false; + } + + const P3fArraySamplePtr = sample.getPositions(); + const Alembic::Abc::Int32ArraySamplePtr _indices = sample.getFaceIndices(); + const Alembic::Abc::Int32ArraySamplePtr _counts = sample.getFaceCounts(); + + return positions->size() != existing_mesh->totvert || + face_counts->size() != existing_mesh->totpoly || + face_indices->size() != existing_mesh->totloop; +} + Mesh *AbcMeshReader::read_mesh(Mesh *existing_mesh, const ISampleSelector _sel, int read_flag, @@ -1162,10 +1187,7 @@ Mesh *AbcMeshReader::read_mesh(Mesh *existing_mesh, ImportSettings settings; settings.read_flag |= read_flag; - bool topology_changed = positions->size() != existing_mesh->totvert || - face_counts->size() != existing_mesh->totpoly || - face_indices->size() != existing_mesh->totloop; - if (topology_changed) { + if (topology_changed(existing_mesh, sample_sel)) { new_mesh = BKE_mesh_new_nomain_from_template( existing_mesh, positions->size(), 0, 0, face_indices->size(), face_counts->size()); diff --git a/source/blender/alembic/intern/abc_mesh.h b/source/blender/alembic/intern/abc_mesh.h index 859ab121eb6..77686a0204e 100644 --- a/source/blender/alembic/intern/abc_mesh.h +++ b/source/blender/alembic/intern/abc_mesh.h @@ -110,6 +110,8 @@ class AbcMeshReader : public AbcObjectReader { const Alembic::Abc::ISampleSelector _sel, int read_flag, const char **err_str); + bool topology_changed(Mesh *existing_mesh, +const Alembic::Abc::ISampleSelector _sel) override; private: void readFaceSetsSample(Main *bmain, diff --git a/source/blender/alembic/intern/abc_object.cc b/source/blender/alembic/intern/abc_object.cc index f863fe4fee7..ebebbc0da1e 100644 ---
[Bf-blender-cvs] [c70f975d5c3] master: Fix T67999: calling Mesh.materials.clear() crashes Blender
Commit: c70f975d5c3b961e0c77eba3a35c8a892f39214d Author: Sybren A. Stüvel Date: Fri Aug 16 14:36:57 2019 +0200 Branches: master https://developer.blender.org/rBc70f975d5c3b961e0c77eba3a35c8a892f39214d Fix T67999: calling Mesh.materials.clear() crashes Blender The `BKE_material_pop_id()` and `BKE_material_clear_id()` functions had a parameter `update_data` that, when `false`, would cause the mesh polys to keep their material index, even when the indexed material slots were removed. This behaviour was never used in the C code and not supported by the drawing code, making polygons disappear and causing crashes. The Python binding in RNA, however, defaulted to `update_data=False`. This commit removes the `update_data` parameter altogether, and makes the functions always fix up the material indices. Reviewed by: mont29, brecht === M source/blender/blenkernel/BKE_material.h M source/blender/blenkernel/intern/material.c M source/blender/editors/mesh/editmesh_tools.c M source/blender/makesrna/intern/rna_ID.c === diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h index 5bb69c7166e..44a8f98e994 100644 --- a/source/blender/blenkernel/BKE_material.h +++ b/source/blender/blenkernel/BKE_material.h @@ -104,9 +104,8 @@ void BKE_material_append_id(struct Main *bmain, struct ID *id, struct Material * struct Material *BKE_material_pop_id(struct Main *bmain, struct ID *id, /* index is an int because of RNA. */ - int index, - bool update_data); -void BKE_material_clear_id(struct Main *bmain, struct ID *id, bool update_data); + int index); +void BKE_material_clear_id(struct Main *bmain, struct ID *id); /* rendering */ void ramp_blend(int type, float r_col[3], const float fac, const float col[3]); diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index b01c1189fd1..1545ae4f48f 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -461,7 +461,7 @@ void BKE_material_append_id(Main *bmain, ID *id, Material *ma) } } -Material *BKE_material_pop_id(Main *bmain, ID *id, int index_i, bool update_data) +Material *BKE_material_pop_id(Main *bmain, ID *id, int index_i) { short index = (short)index_i; Material *ret = NULL; @@ -489,10 +489,7 @@ Material *BKE_material_pop_id(Main *bmain, ID *id, int index_i, bool update_data test_all_objects_materials(bmain, id); } - if (update_data) { -/* decrease mat_nr index */ -material_data_index_remove_id(id, index); - } + material_data_index_remove_id(id, index); DEG_id_tag_update(id, ID_RECALC_COPY_ON_WRITE); DEG_relations_tag_update(bmain); @@ -502,7 +499,7 @@ Material *BKE_material_pop_id(Main *bmain, ID *id, int index_i, bool update_data return ret; } -void BKE_material_clear_id(Main *bmain, ID *id, bool update_data) +void BKE_material_clear_id(Main *bmain, ID *id) { Material ***matar; if ((matar = give_matarar_id(id))) { @@ -516,12 +513,9 @@ void BKE_material_clear_id(Main *bmain, ID *id, bool update_data) MEM_freeN(*matar); *matar = NULL; } -test_all_objects_materials(bmain, id); -if (update_data) { - /* decrease mat_nr index */ - material_data_index_clear_id(id); -} +test_all_objects_materials(bmain, id); +material_data_index_clear_id(id); DEG_id_tag_update(id, ID_RECALC_COPY_ON_WRITE); DEG_relations_tag_update(bmain); diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index f57e8141f27..4e58fee61a2 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -4040,7 +4040,7 @@ static void mesh_separate_material_assign_mat_nr(Main *bmain, Object *ob, const ma_obdata = NULL; } -BKE_material_clear_id(bmain, obdata, true); +BKE_material_clear_id(bmain, obdata); BKE_material_resize_object(bmain, ob, 1, true); BKE_material_resize_id(bmain, obdata, 1, true); @@ -4051,7 +4051,7 @@ static void mesh_separate_material_assign_mat_nr(Main *bmain, Object *ob, const id_us_plus((ID *)ma_obdata); } else { -BKE_material_clear_id(bmain, obdata, true); +BKE_material_clear_id(bmain, obdata); BKE_material_resize_object(bmain, ob, 0, true); BKE_material_resize_id(bmain, obdata, 0, true); } diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 57cdbbadeb8..7996750a1b8 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++
[Bf-blender-cvs] [82e719ff876] master: Fix T64998: Multi window spin tool crash
Commit: 82e719ff8764da6c48ba3de4e5c11226953002e8 Author: Campbell Barton Date: Fri Aug 16 21:25:48 2019 +1000 Branches: master https://developer.blender.org/rB82e719ff8764da6c48ba3de4e5c11226953002e8 Fix T64998: Multi window spin tool crash There could be a more direct way to initialize a gizmo in a view, for now this resolves the crash. === M source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c === diff --git a/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c index 74700e59e99..7155348fed5 100644 --- a/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c +++ b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c @@ -1008,8 +1008,17 @@ static void gizmo_mesh_spin_redo_setup(const bContext *C, wmGizmoGroup *gzgroup) }); } - /* Become modal as soon as it's started. */ - gizmo_mesh_spin_redo_modal_from_setup(C, gzgroup); + wmWindow *win = CTX_wm_window(C); + if (win && win->active) { +bScreen *screen = WM_window_get_active_screen(win); +if (screen->active_region) { + ARegion *ar = CTX_wm_region(C); + if (screen->active_region == ar) { +/* Become modal as soon as it's started. */ +gizmo_mesh_spin_redo_modal_from_setup(C, gzgroup); + } +} + } } static void gizmo_mesh_spin_redo_draw_prepare(const bContext *UNUSED(C), wmGizmoGroup *gzgroup) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8e4f55aba6d] master: build_env: Added OpenImageDenoise to install_deps.sh
Commit: 8e4f55aba6d5ed2eca7d11fb7e6fc942e4a4d492 Author: Stefan Werner Date: Fri Aug 16 11:25:31 2019 +0200 Branches: master https://developer.blender.org/rB8e4f55aba6d5ed2eca7d11fb7e6fc942e4a4d492 build_env: Added OpenImageDenoise to install_deps.sh Building OIDN still needs to be enabled explicitly with --with-oidn. It will fail with older versions of CMake or TBB, so I can't make any guarantees for various Linux distributions or versions. === M build_files/build_environment/install_deps.sh === diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh index 1324616ca35..a9118be93c7 100755 --- a/build_files/build_environment/install_deps.sh +++ b/build_files/build_environment/install_deps.sh @@ -26,17 +26,17 @@ ARGS=$( \ getopt \ -o s:i:t:h \ --long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,\ -with-all,with-opencollada,with-jack,with-embree,\ +with-all,with-opencollada,with-jack,with-embree,with-oidn,\ ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,\ force-all,force-python,force-numpy,force-boost,\ force-ocio,force-openexr,force-oiio,force-llvm,force-osl,force-osd,force-openvdb,\ -force-ffmpeg,force-opencollada,force-alembic,force-embree,\ +force-ffmpeg,force-opencollada,force-alembic,force-embree,force-oidn,\ build-all,build-python,build-numpy,build-boost,\ build-ocio,build-openexr,build-oiio,build-llvm,build-osl,build-osd,build-openvdb,\ -build-ffmpeg,build-opencollada,build-alembic,build-embree,\ +build-ffmpeg,build-opencollada,build-alembic,build-embree,build-oidn,\ skip-python,skip-numpy,skip-boost,\ skip-ocio,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-osd,skip-openvdb,\ -skip-ffmpeg,skip-opencollada,skip-alembic,skip-embree \ +skip-ffmpeg,skip-opencollada,skip-alembic,skip-embree,skip-oidn \ -- "$@" \ ) @@ -57,6 +57,7 @@ WITH_ALL=false # Do not yet enable opencollada or embree, use --with-opencollada/--with-embree (or --with-all) option to try it. WITH_OPENCOLLADA=false WITH_EMBREE=false +WITH_OIDN=false THREADS=$(nproc) @@ -69,6 +70,7 @@ Number of threads for building: \$THREADS (automatically detected, use --threads Full install: \$WITH_ALL (use --with-all option to enable it). Building OpenCOLLADA: \$WITH_OPENCOLLADA (use --with-opencollada option to enable it). Building Embree: \$WITH_EMBREE (use --with-embree option to enable it). +Building OpenImageDenoise: \$WITH_OIDN (use --with-oidn option to enable it). Example: Full install without OpenCOLLADA: --with-all --skip-opencollada @@ -118,6 +120,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS: --with-embree Build and install the Embree libraries. +--with-oidn +Build and install the OpenImageDenoise libraries. + --with-jack Install the jack libraries. @@ -185,6 +190,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS: --build-embree Force the build of Embree. +--build-oidn +Force the build of OpenImageDenoise. + --build-ffmpeg Force the build of FFMpeg. @@ -240,6 +248,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS: --force-embree Force the rebuild of Embree. +--force-oidn +Force the rebuild of OpenImageDenoise. + --force-ffmpeg Force the rebuild of FFMpeg. @@ -288,6 +299,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS: --skip-Embree Unconditionally skip Embree installation/building. +--skip-oidn +Unconditionally skip OpenImageDenoise installation/building. + --skip-ffmpeg Unconditionally skip FFMpeg installation/building.\"" @@ -390,6 +404,11 @@ EMBREE_FORCE_BUILD=false EMBREE_FORCE_REBUILD=false EMBREE_SKIP=false +OIDN_VERSION="1.0.0" +OIDN_FORCE_BUILD=false +OIDN_FORCE_REBUILD=false +OIDN_SKIP=false + FFMPEG_VERSION="4.0.2" FFMPEG_VERSION_MIN="2.8.4" FFMPEG_FORCE_BUILD=false @@ -526,6 +545,9 @@ while true; do --with-embree) WITH_EMBREE=true; shift; continue ;; +--with-oidn) + WITH_OIDN=true; shift; continue +;; --with-jack) WITH_JACK=true; shift; continue; ;; @@ -572,6 +594,7 @@ while true; do OPENVDB_FORCE_BUILD=true OPENCOLLADA_FORCE_BUILD=true EMBREE_FORCE_BUILD=true + OIDN_FORCE_BUILD=true FFMPEG_FORCE_BUILD=true ALEMBIC_FORCE_BUILD=true shift; continue @@ -616,6 +639,9 @@ while true; do --build-embree) EMBREE_FORCE_BUILD=true; shift; continue ;; +--build-oidn) + OIDN_FORCE_BUILD=true; shift; continue +;; --build-ffmpeg) FFMPEG_FORCE_BUILD=true; shift; continue ;; @@ -635,6 +661,7 @@ while true; do OPENVDB_FORCE_REBUILD=true OPENCOLLADA_FORCE_REBUILD=true EMBREE_FORCE_REBUILD=true + OIDN_FORCE_REBUILD=true
[Bf-blender-cvs] [13c9df10a8f] master: Fix T68710: crash on applying modifier after removing all shape keys
Commit: 13c9df10a8fda7b5370edf1c87e4f4da15e4b33b Author: Philipp Oeser Date: Fri Aug 16 12:52:40 2019 +0200 Branches: master https://developer.blender.org/rB13c9df10a8fda7b5370edf1c87e4f4da15e4b33b Fix T68710: crash on applying modifier after removing all shape keys This was a mistake in rB87629b2a7443 `BKE_object_shapekey_free` would never return `true`, so DEG updates would not happen... So `ob->shapenr` was not up-to-date etc., leading to crash in `BKE_mesh_nomain_to_mesh` shapekey handling... Reviewers: brecht Maniphest Tasks: T68710 Differential Revision: https://developer.blender.org/D5501 === M source/blender/blenkernel/intern/object.c === diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index d95c02cdf7f..ae091f32fbf 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -3587,7 +3587,7 @@ bool BKE_object_shapekey_free(Main *bmain, Object *ob) BKE_id_free_us(bmain, key); - return false; + return true; } bool BKE_object_shapekey_remove(Main *bmain, Object *ob, KeyBlock *kb) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f8920bd8c77] master: Cleanup: fix compiler warnings
Commit: f8920bd8c7757af976404572697b69372f542df2 Author: Brecht Van Lommel Date: Fri Aug 16 12:44:06 2019 +0200 Branches: master https://developer.blender.org/rBf8920bd8c7757af976404572697b69372f542df2 Cleanup: fix compiler warnings === M source/blender/editors/object/object_remesh.c M source/blender/editors/space_view3d/view3d_draw_legacy.c === diff --git a/source/blender/editors/object/object_remesh.c b/source/blender/editors/object/object_remesh.c index 1bcac9b4739..bc94b3f7875 100644 --- a/source/blender/editors/object/object_remesh.c +++ b/source/blender/editors/object/object_remesh.c @@ -108,7 +108,7 @@ static int voxel_remesh_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - Mesh *obj_mesh_copy; + Mesh *obj_mesh_copy = NULL; if (mesh->flag & ME_REMESH_REPROJECT_PAINT_MASK) { obj_mesh_copy = BKE_mesh_new_nomain_from_template(mesh, mesh->totvert, 0, 0, 0, 0); CustomData_copy( diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c index 02ad481e6ce..d5772e5052a 100644 --- a/source/blender/editors/space_view3d/view3d_draw_legacy.c +++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c @@ -162,6 +162,7 @@ static void validate_object_select_id( Object *obact_eval = DEG_get_evaluated_object(depsgraph, obact); BLI_assert(ar->regiontype == RGN_TYPE_WINDOW); + UNUSED_VARS_NDEBUG(ar); if (obact_eval && (obact_eval->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT) || BKE_paint_select_face_test(obact_eval))) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4e9bcffc397] greasepencil-object: Merge branch 'master' into greasepencil-object
Commit: 4e9bcffc39731072d80e0996ef8932993fa7010a Author: Antonio Vazquez Date: Fri Aug 16 12:35:57 2019 +0200 Branches: greasepencil-object https://developer.blender.org/rB4e9bcffc39731072d80e0996ef8932993fa7010a Merge branch 'master' into greasepencil-object === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bdf8450713b] master: Transform: use a kd-tree to calculate proportional distances
Commit: bdf8450713bef28f6cfc68dfb13b6e994f285bff Author: Campbell Barton Date: Fri Aug 16 18:20:53 2019 +1000 Branches: master https://developer.blender.org/rBbdf8450713bef28f6cfc68dfb13b6e994f285bff Transform: use a kd-tree to calculate proportional distances While speedup is non-linear, it gives ~30% speedup for ~6 million verts. D3993 by @Al with edits. === M source/blender/editors/transform/transform_conversions.c === diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index ef9d23d1db8..2fb9e2b9591 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -52,6 +52,7 @@ #include "BLI_string.h" #include "BLI_bitmap.h" #include "BLI_rect.h" +#include "BLI_kdtree.h" #include "BKE_action.h" #include "BKE_animsys.h" @@ -235,8 +236,9 @@ static void sort_trans_data_selected_first(TransInfo *t) } } -/* distance calculated from not-selected vertex to nearest selected vertex - * warning; this is loops inside loop, has minor N^2 issues, but by sorting list it is OK */ +/** + * Distance calculated from not-selected vertex to nearest selected vertex. + */ static void set_prop_dist(TransInfo *t, const bool with_dist) { int a; @@ -255,54 +257,124 @@ static void set_prop_dist(TransInfo *t, const bool with_dist) } } + /* Count number of selected. */ + int td_table_len = 0; FOREACH_TRANS_DATA_CONTAINER (t, tc) { -TransData *tob = tc->data; -for (a = 0; a < tc->data_len; a++, tob++) { +TransData *td = tc->data; +for (a = 0; a < tc->data_len; a++, td++) { + if (td->flag & TD_SELECTED) { +td_table_len++; + } + else { +/* By definition transform-data has selected items in beginning. */ +break; + } +} + } - tob->rdist = 0.0f; // init, it was mallocced + /* Pointers to selected's #TransData. + * Used to find #TransData from the index returned by #BLI_kdtree_find_nearest. */ + TransData **td_table = MEM_mallocN(sizeof(*td_table) * td_table_len, __func__); - if ((tob->flag & TD_SELECTED) == 0) { -TransData *td; -int i; -float dist_sq, vec[3]; + /* Create and fill kd-tree of selected's positions - in global or proj_vec space. */ + KDTree_3d *td_tree = BLI_kdtree_3d_new(td_table_len); -tob->rdist = -1.0f; // signal for next loop + int td_table_index = 0; + FOREACH_TRANS_DATA_CONTAINER (t, tc) { +TransData *td = tc->data; +for (a = 0; a < tc->data_len; a++, td++) { + if (td->flag & TD_SELECTED) { +/* Initialize, it was mallocced. */ +float vec[3]; +td->rdist = 0.0f; + +if (use_island) { + if (tc->use_local_mat) { +mul_v3_m4v3(vec, tc->mat, td->iloc); + } + else { +mul_v3_m3v3(vec, td->mtx, td->iloc); + } +} +else { + if (tc->use_local_mat) { +mul_v3_m4v3(vec, tc->mat, td->center); + } + else { +mul_v3_m3v3(vec, td->mtx, td->center); + } +} -for (i = 0, td = tc->data; i < tc->data_len; i++, td++) { - if (td->flag & TD_SELECTED) { -if (use_island) { - sub_v3_v3v3(vec, tob->iloc, td->iloc); -} -else { - sub_v3_v3v3(vec, tob->center, td->center); -} -mul_m3_v3(tob->mtx, vec); +if (proj_vec) { + float vec_p[3]; + project_v3_v3v3(vec_p, vec, proj_vec); + sub_v3_v3(vec, vec_p); +} -if (proj_vec) { - float vec_p[3]; - project_v3_v3v3(vec_p, vec, proj_vec); - sub_v3_v3(vec, vec_p); -} +BLI_kdtree_3d_insert(td_tree, td_table_index, vec); +td_table[td_table_index++] = td; + } + else { +/* By definition transform-data has selected items in beginning. */ +break; + } +} + } + BLI_assert(td_table_index == td_table_len); -dist_sq = len_squared_v3(vec); -if ((tob->rdist == -1.0f) || (dist_sq < SQUARE(tob->rdist))) { - tob->rdist = sqrtf(dist_sq); - if (use_island) { -copy_v3_v3(tob->center, td->center); -copy_m3_m3(tob->axismtx, td->axismtx); - } -} + BLI_kdtree_3d_balance(td_tree); + + /* For each non-selected vertex, find distance to the nearest selected vertex. */ + FOREACH_TRANS_DATA_CONTAINER (t, tc) { +TransData *td = tc->data; +for (a = 0; a < tc->data_len; a++, td++) { + if ((td->flag & TD_SELECTED) == 0) { +float vec[3]; + +if (use_island) { + if (tc->use_local_mat) { +
[Bf-blender-cvs] [afac2afbfcd] soc-2019-npr: Merge remote-tracking branch 'origin/master' into soc-2019-npr
Commit: afac2afbfcdb06a2d2655e63d0b8bc35b1aba18e Author: YimingWu Date: Fri Aug 16 14:27:04 2019 +0800 Branches: soc-2019-npr https://developer.blender.org/rBafac2afbfcdb06a2d2655e63d0b8bc35b1aba18e Merge remote-tracking branch 'origin/master' into soc-2019-npr === === diff --cc source/blender/draw/CMakeLists.txt index 8bb309d72d9,1112a7a87db..fc91ac371cb --- a/source/blender/draw/CMakeLists.txt +++ b/source/blender/draw/CMakeLists.txt @@@ -127,14 -129,8 +129,13 @@@ set(SR engines/gpencil/gpencil_engine.h engines/gpencil/gpencil_render.c engines/gpencil/gpencil_shader_fx.c + engines/lanpr/lanpr_dpix.c + engines/lanpr/lanpr_engine.c + # engines/lanpr/lanpr_snake.c deprecated for now. + engines/lanpr/lanpr_cpu.c + engines/lanpr/lanpr_chain_draw.c - engines/select/select_engine.c engines/select/select_draw_utils.c - engines/select/select_buffer.c + engines/select/select_engine.c DRW_engine.h DRW_select_buffer.h ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs