From c204e0c385313570d63c12c2424601ffe53cbe3a Mon Sep 17 00:00:00 2001 From: Fabian Schempp Date: Sun, 25 Apr 2021 23:32:41 +0200 Subject: Fix T87170 Multi-Input socket activation zone error with lots of inputs Calculation of bounding rect for multi-input socket was wrong. Reviewer: Hans Goudey (HooglyBoogly) Differential Revision: https://developer.blender.org/D11077 --- source/blender/editors/space_node/node_edit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 7282ed4b667..d4780534a83 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1136,8 +1136,8 @@ static bool cursor_isect_multi_input_socket(const float cursor[2], const bNodeSo * But keep it smaller because for multi-input socket you * sometimes want to drag the link to the other side, if you may * accidentally pick the wrong link otherwise. */ - .ymin = socket->locy - node_socket_height * 0.5 - NODE_SOCKSIZE, - .ymax = socket->locy + node_socket_height * 0.5 + NODE_SOCKSIZE, + .ymin = socket->locy - node_socket_height, + .ymax = socket->locy + node_socket_height, }; if (BLI_rctf_isect_pt(&multi_socket_rect, cursor[0], cursor[1])) { return true; -- cgit v1.2.3 From db3b6100404219e2a02e8163e511e604ee137828 Mon Sep 17 00:00:00 2001 From: Fabian Schempp Date: Mon, 26 Apr 2021 00:55:55 +0200 Subject: Fix T87170 Multi-Input socket activation zone error with lots of inputs Calculation of bounding rect for multi-input socket was wrong. Reviewer: Hans Goudey (HooglyBoogly) Differential Revision: https://developer.blender.org/D11077 --- source/blender/editors/space_node/node_edit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 7282ed4b667..d4780534a83 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1136,8 +1136,8 @@ static bool cursor_isect_multi_input_socket(const float cursor[2], const bNodeSo * But keep it smaller because for multi-input socket you * sometimes want to drag the link to the other side, if you may * accidentally pick the wrong link otherwise. */ - .ymin = socket->locy - node_socket_height * 0.5 - NODE_SOCKSIZE, - .ymax = socket->locy + node_socket_height * 0.5 + NODE_SOCKSIZE, + .ymin = socket->locy - node_socket_height, + .ymax = socket->locy + node_socket_height, }; if (BLI_rctf_isect_pt(&multi_socket_rect, cursor[0], cursor[1])) { return true; -- cgit v1.2.3 From c76141e425aaeb14af6f8f9c62f78545fc4270f2 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Sun, 25 Apr 2021 17:55:00 -0700 Subject: UI: Adding Constraint to the Area Join Operations Removing mid-operation area re-targeting for safety and predictability. Differential Revision: https://developer.blender.org/D11066 Reviewed by Campbell Barton --- source/blender/editors/screen/screen_ops.c | 75 ++++++++++-------------------- 1 file changed, 25 insertions(+), 50 deletions(-) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index cc920aece0a..5b371ed2caa 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3262,8 +3262,9 @@ static void SCREEN_OT_screen_full_area(wmOperatorType *ot) */ typedef struct sAreaJoinData { - ScrArea *sa1; /* first area to be considered */ - ScrArea *sa2; /* second area to be considered */ + ScrArea *sa1; /* Potential source area (kept). */ + ScrArea *sa2; /* Potential target area (removed or reduced). */ + int dir; /* Direction of potential join. */ void *draw_callback; /* call 'ED_screen_draw_join_highlight' */ } sAreaJoinData; @@ -3273,7 +3274,7 @@ static void area_join_draw_cb(const struct wmWindow *UNUSED(win), void *userdata const wmOperator *op = userdata; sAreaJoinData *sd = op->customdata; - if (sd->sa1 && sd->sa2) { + if (sd->sa1 && sd->sa2 && (sd->dir != -1)) { ED_screen_draw_join_highlight(sd->sa1, sd->sa2); } } @@ -3296,6 +3297,7 @@ static bool area_join_init(bContext *C, wmOperator *op, ScrArea *sa1, ScrArea *s jd->sa1 = sa1; jd->sa2 = sa2; + jd->dir = -1; op->customdata = jd; @@ -3308,7 +3310,7 @@ static bool area_join_init(bContext *C, wmOperator *op, ScrArea *sa1, ScrArea *s static bool area_join_apply(bContext *C, wmOperator *op) { sAreaJoinData *jd = (sAreaJoinData *)op->customdata; - if (!jd) { + if (!jd || (jd->dir == -1)) { return false; } @@ -3410,61 +3412,30 @@ static int area_join_modal(bContext *C, wmOperator *op, const wmEvent *event) case MOUSEMOVE: { ScrArea *area = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, event->x, event->y); - int dir = -1; + jd->dir = area_getorientation(jd->sa1, jd->sa2); - if (area) { - if (jd->sa1 != area) { - dir = area_getorientation(jd->sa1, area); - if (dir != -1) { - jd->sa2 = area; - } - else { - /* we are not bordering on the previously selected area - * we check if area has common border with the one marked for removal - * in this case we can swap areas. - */ - dir = area_getorientation(area, jd->sa2); - if (dir != -1) { - jd->sa1 = jd->sa2; - jd->sa2 = area; - } - else { - jd->sa2 = NULL; - } - } - WM_event_add_notifier(C, NC_WINDOW, NULL); - } - else { - /* we are back in the area previously selected for keeping - * we swap the areas if possible to allow user to choose */ - if (jd->sa2 != NULL) { - jd->sa1 = jd->sa2; - jd->sa2 = area; - dir = area_getorientation(jd->sa1, jd->sa2); - if (dir == -1) { - printf("oops, didn't expect that!\n"); - } - } - else { - dir = area_getorientation(jd->sa1, area); - if (dir != -1) { - jd->sa2 = area; - } - } - WM_event_add_notifier(C, NC_WINDOW, NULL); - } + if (area == jd->sa1) { + /* Hovering current source, so change direction. */ + jd->sa1 = jd->sa2; + jd->sa2 = area; + jd->dir = area_getorientation(jd->sa1, jd->sa2); } + else if (area != jd->sa2) { + jd->dir = -1; + } + + WM_event_add_notifier(C, NC_WINDOW, NULL); - if (dir == 1) { + if (jd->dir == 1) { WM_cursor_set(win, WM_CURSOR_N_ARROW); } - else if (dir == 3) { + else if (jd->dir == 3) { WM_cursor_set(win, WM_CURSOR_S_ARROW); } - else if (dir == 2) { + else if (jd->dir == 2) { WM_cursor_set(win, WM_CURSOR_E_ARROW); } - else if (dir == 0) { + else if (jd->dir == 0) { WM_cursor_set(win, WM_CURSOR_W_ARROW); } else { @@ -3475,6 +3446,10 @@ static int area_join_modal(bContext *C, wmOperator *op, const wmEvent *event) } case LEFTMOUSE: if (event->val == KM_RELEASE) { + if (jd->dir == -1) { + area_join_cancel(C, op); + return OPERATOR_CANCELLED; + } ED_area_tag_redraw(jd->sa1); ED_area_tag_redraw(jd->sa2); -- cgit v1.2.3 From 534148206492cd3463cf75a8a8983acb6166b2a6 Mon Sep 17 00:00:00 2001 From: Pratik Borhade Date: Sun, 25 Apr 2021 18:39:32 -0700 Subject: Fix T87777: Fix typo in Prefs Scripts Dir tooltip Correction to Prefs tooltip mention of 'add-ons' folder in Scripts Dir. Differential Revision: https://developer.blender.org/D11064 Reviewed by Harley Acheson --- source/blender/makesrna/intern/rna_userdef.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 26887b51f81..bacd3943141 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -6160,7 +6160,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) prop, "Python Scripts Directory", "Alternate script path, matching the default layout with subdirectories: " - "startup, add-ons and modules (requires restart)"); + "startup, addons, modules, and presets (requires restart)"); /* TODO, editing should reset sys.path! */ prop = RNA_def_property(srna, "i18n_branches_directory", PROP_STRING, PROP_DIRPATH); -- cgit v1.2.3 From f2d70c02f88cc00266d330d89ea916e26c0ecf44 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Sun, 25 Apr 2021 21:41:59 -0500 Subject: Fix (unreported): Geometry nodes instance ids not copied or cleared Though to my knowledge we haven't had a report about this yet, this looks like a clear oversight-- the ids are just more data stored by the instances component, and should be cleared and copied like other data. This might have resulted in incorrect random IDs for instances in renderers in some cases where the component had to be copied. --- source/blender/blenkernel/intern/geometry_component_instances.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/blenkernel/intern/geometry_component_instances.cc b/source/blender/blenkernel/intern/geometry_component_instances.cc index 11526eda762..feb30e8575a 100644 --- a/source/blender/blenkernel/intern/geometry_component_instances.cc +++ b/source/blender/blenkernel/intern/geometry_component_instances.cc @@ -44,6 +44,7 @@ GeometryComponent *InstancesComponent::copy() const InstancesComponent *new_component = new InstancesComponent(); new_component->transforms_ = transforms_; new_component->instanced_data_ = instanced_data_; + new_component->ids_ = ids_; return new_component; } @@ -51,6 +52,7 @@ void InstancesComponent::clear() { instanced_data_.clear(); transforms_.clear(); + ids_.clear(); } void InstancesComponent::add_instance(Object *object, float4x4 transform, const int id) -- cgit v1.2.3