diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-04-29 12:59:38 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-04-29 12:59:38 +0400 |
commit | abf1df03ebd34d09e977e6996252eb2a7f62ca89 (patch) | |
tree | 8021d943baf11f58a17115ea6b0e8f365e75212d /source | |
parent | a4a29493090534caa6e9a732f11898db71e7ac0d (diff) |
Fix for #35134.
The node link operator had a feature to automatically expose sockets in node groups when ctrl+shift+clicking on a node socket, which would create a node group input/output node. This was intended as a shortcut but conflicts with other features such as socket selection and viewer creation. It is also hardly necessary now that input/output nodes have an extension socket, which is much easier to use. Removed this expose functionality completely.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_node/node_ops.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_relationships.c | 61 |
2 files changed, 2 insertions, 70 deletions
diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c index 782ea77ea59..b46584cda07 100644 --- a/source/blender/editors/space_node/node_ops.c +++ b/source/blender/editors/space_node/node_ops.c @@ -233,17 +233,10 @@ void node_keymap(struct wmKeyConfig *keyconf) /* each of these falls through if not handled... */ kmi = WM_keymap_add_item(keymap, "NODE_OT_link", LEFTMOUSE, KM_PRESS, 0, 0); - RNA_boolean_set(kmi->ptr, "detach", FALSE); - RNA_boolean_set(kmi->ptr, "expose", FALSE); + RNA_boolean_set(kmi->ptr, "detach", FALSE); kmi = WM_keymap_add_item(keymap, "NODE_OT_link", LEFTMOUSE, KM_PRESS, KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "detach", TRUE); - RNA_boolean_set(kmi->ptr, "expose", FALSE); - kmi = WM_keymap_add_item(keymap, "NODE_OT_link", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "detach", FALSE); - RNA_boolean_set(kmi->ptr, "expose", TRUE); - kmi = WM_keymap_add_item(keymap, "NODE_OT_link", LEFTMOUSE, KM_PRESS, KM_SHIFT | KM_CTRL, 0); - RNA_boolean_set(kmi->ptr, "detach", TRUE); - RNA_boolean_set(kmi->ptr, "expose", TRUE); + WM_keymap_add_item(keymap, "NODE_OT_resize", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "NODE_OT_add_reroute", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0); diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c index b552aff27f9..71989f3ee04 100644 --- a/source/blender/editors/space_node/node_relationships.c +++ b/source/blender/editors/space_node/node_relationships.c @@ -443,15 +443,12 @@ static int node_link_modal(bContext *C, wmOperator *op, const wmEvent *event) bNodeLink *link; LinkData *linkdata; int in_out; - int expose; in_out = nldrag->in_out; UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &snode->cursor[0], &snode->cursor[1]); - expose = RNA_boolean_get(op->ptr, "expose"); - switch (event->type) { case MOUSEMOVE: @@ -515,12 +512,6 @@ static int node_link_modal(bContext *C, wmOperator *op, const wmEvent *event) case RIGHTMOUSE: case MIDDLEMOUSE: { - /* XXX expose + detach could have some ugly corner cases and is not great. - * The first link will define the exposed socket type, which is arbitrary. - * Some of the resulting links may turn out to be invalid. - */ - bNode *ionode = NULL; - bNodeSocket *iosock = NULL, *gsock; for (linkdata = nldrag->links.first; linkdata; linkdata = linkdata->next) { link = linkdata->data; @@ -537,57 +528,6 @@ static int node_link_modal(bContext *C, wmOperator *op, const wmEvent *event) if (in_out == SOCK_OUT) node_remove_extra_links(snode, link->tosock, link); } - else if (expose) { - if (link->tosock) { - if (!ionode) { - ionode = nodeAddStaticNode(C, snode->edittree, NODE_GROUP_INPUT); - gsock = ntreeAddSocketInterfaceFromSocket(snode->edittree, link->tonode, link->tosock); - node_group_input_verify(snode->edittree, ionode, (ID *)snode->edittree); - iosock = node_group_input_find_socket(ionode, gsock->identifier); - - { - /* place the node at the mouse pointer */ - float sockx = 42.0f + 3 * HIDDEN_RAD; /* XXX totally arbitrary initial hidden node size ... */ - float socky = -HIDDEN_RAD; - - ionode->locx = snode->cursor[0] - sockx; - ionode->locy = snode->cursor[1] - socky; - } - } - link->fromnode = ionode; - link->fromsock = iosock; - - BLI_addtail(&ntree->links, link); - - ntree->update |= NTREE_UPDATE_GROUP_IN | NTREE_UPDATE_LINKS; - } - else if (link->fromsock) { - if (!ionode) { - ionode = nodeAddStaticNode(C, snode->edittree, NODE_GROUP_OUTPUT); - gsock = ntreeAddSocketInterfaceFromSocket(snode->edittree, link->fromnode, link->fromsock); - node_group_output_verify(snode->edittree, ionode, (ID *)snode->edittree); - iosock = node_group_output_find_socket(ionode, gsock->identifier); - - { - /* place the node at the mouse pointer */ - float sockx = 0; - float socky = -HIDDEN_RAD; - - ionode->locx = snode->cursor[0] - sockx; - ionode->locy = snode->cursor[1] - socky; - } - } - link->tonode = ionode; - link->tosock = iosock; - - BLI_addtail(&ntree->links, link); - - ntree->update |= NTREE_UPDATE_GROUP_OUT | NTREE_UPDATE_LINKS; - } - else { - nodeRemLink(snode->edittree, link); - } - } else nodeRemLink(ntree, link); } @@ -756,7 +696,6 @@ void NODE_OT_link(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; RNA_def_boolean(ot->srna, "detach", FALSE, "Detach", "Detach and redirect existing links"); - RNA_def_boolean(ot->srna, "expose", FALSE, "Expose", "Expose the socket as an interface node"); } /* ********************** Make Link operator ***************** */ |