Page MenuHome

Node Wrangler: Add ability to unview node by clicking on empty space
Needs ReviewPublic

Authored by Roman Kornev (RomanKornev) on Apr 11 2020, 2:07 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Adds the ability to "unview" the preview node by Ctrl+Shift clicking on empty space.
It assumes that rightmost shader node (excluding Viewer) is the "main" shader and connects it to the output directly (similar to how a user would do it), which works surprisingly well.

Diff Detail

Event Timeline

Roman Kornev (RomanKornev) requested review of this revision.Apr 11 2020, 2:07 AM
Roman Kornev (RomanKornev) created this revision.

This looks like it could be a nice addition! Thx already.
Sorry this has been lying around, could you rebase? (applying the patch fails for me atm...)

CC @Greg Zaal (gregzaal)

Rebased to a fresh version.
Also fixed an issue with frames and their relative offsets. Now using absolute node locations, just like they're displayed on the screen.
Not sure why the diff looks so weird, I only changed the top part in invoke and unindented the rest.

There was another commit in this area yesterday: 1bc96468a144 your patch probably needs another rebase, bad timing :/
Functionality wise i'm not sure if simply picking the rightmost shader is too much of an assumption, i imagine this would fail in some common cases (e.g. main shader is inside a group or main shader is not the most right shader). Maybe it would be possible to rather store the "main" shader node before deconnecting it and then reconnecting that node, however this would probably be more complicated.

I think the right-most shader that has a shader-type output socket would be good, since it'd be either shader node, group, or any other suitable custom node.

Ideally it'd also be good to add similar functionality to the compositor node tree too - connecting the rightmost node to the viewer node (but maybe not to the actual output node, not sure).