[ADDON] Node Wrangler (aka Nodes Efficiency Tools)

Great addon! I think Lukas has just given you python access to nodes width:
http://www.mail-archive.com/[email protected]/msg38316.html

You should ask him to change the reroute node, so it shows its label if there is one. I know the switch is probably well implemented and doesn’t do much calculations, and you can hide the unused inputs (could you do this by default?), but it still stresses my OCD brain a little.

One sugesstion. I usually group add nodes like this:


which basically are:


Maybe it is overkill for this addon, becouse its not used more than one or two times in a node tree, but anyway.

I was initially thinking about grouping those mix nodes, but decided to leave it to the user. From scripting point of view it’s just one line of code, but I will not do it anyway.

In the meantime I uploaded version 1.3 with some additions and little changes:

Added several options for Cycles Materials nodes. We can automatically “Merge” shaders, i.e. add “Mix Shader”, or “Add Shader” to selected.
We can also select any node like shader nodes and Ctrl-T to add image texture input together with vector-Mapping and Input-Texture coordinates - all properly connected.

I decided to make a little change that you won’t probably be happy about, but we had a keyboard shortcuts conflict.
I had to change “Copy Active’s Settings to Selected” from simpler Ctrl-C, to more “difficult” Ctrl-Shift-C, as Ctrl-C is for “copy node”.

Please check the latest version:
http://cg.bartekskorupa.com/nodes-efficiency-tools/

Thank you so much for this add-on!
I haven’t gotten to use it just yet (I’ve just finished watching the presentation video), but I can say I’d already miss it from my workflow.
Huge bump in efficiency. Thanks again!

Thank you so much for this add-on!
I haven’t gotten to use it just yet (I’ve just finished watching the presentation video), but I can say I’d already miss it from my workflow.
Huge bump in efficiency. Thanks again!

Uploaded this Add On to blender’s repository.
Here’s a link to wiki page:
http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Nodes/Nodes_Efficiency_Tools
Please download the latest versions from there. You’ll find all of the keyboard shortcuts and instructions on the above page.
Current version is 1.4.

New Feature:

Added possibility to change “Factor” of Mix node and Mix Shader using keyboard.
alt LEFT/RIGHT ARROW - increase/decrease factor by 0.1
alt shift LEFT/RIGHT ARROW - increase/decrease factor by 0.01
It works on all selected nodes of the above types.

Other changes:
UI changed a bit. Please comment on the changes. I think that now UI is a bit more user friendly.
When adding “Mix”, “Math” or “Mix/Add Shader” nodes and link them to selected nodes we do what is called “MERGE” in other compositing apps. This is the term that I decided to use for this operation.

POSSIBILITY TO INCLUDE ADD-ON IN BLENDER:
Please leave comments. If we want this addon to be included in Blender - we have to convince the main developers that it’s worth it. In the tracker I have linked to this thread, so all comments given here will have the influence on decision weather we should or should not have this addition in official blender releases.
Link to tracker:
http://projects.blender.org/tracker/index.php?func=detail&aid=33543&group_id=153&atid=467

OMG it must be official! It is a huge improvement to performance and efficiency of workflow. The script doesn’t force a particular mode of working, it just streamlines a lot of manual labour. I might even use EXR files now as they are easier to use with this addon.

It should definitely be included in blender! Great work Bartek!

I am thinking about changing one little thing, but I’d like to know your opinion first:

Merging nodes:

At the moment we have 3 options:
Let’s assume that we would like to ADD.

  1. Ctrl +
    Merge using “Mix Nodes”

  2. Ctrl Shift +
    Merge using “Math Nodes”

  3. Ctrl Alt +
    Merge using “Add Shader”

How about doing it a bit differently. When using Ctrl + we have “automatic” merge basing on the kind of outputs, i.e - if the outputs have “image” type (yellow socket) - “Mix Nodes” are used, when they are gray (value) - “Math Nodes” are used, when they are green (Shader) - “Add Shader” is used.

So I’d remap keyboard shortcuts with Ctrl to automatic output kind detection.

Then I’d use Ctrl Shift to “force” to use math, no matter what the output kind is and Ctrl Alt to “force” using “Mix Nodes” no matter what kind of the output.

I don’t think there is a need to use any “force” for shaders as I can’t imagine any situation when someone would want to use mixing shaders for outputs different that shader.

Please comment on this idea. I want to make it easier to use and think that this idea would make it so, but I’m not sure.

Agree, it’s a huge help. Clicking lots od stuff is never fun; this almost makes it fun. :stuck_out_tongue:

Its a good idea, I usually get the shortcuts mixed, and I end using Ctls+space. About the Add node, i usually use the Mix node, but I don’t know if it’s just me. In case it’s not, Mix could be the default.

Here goes the new version: 1.5.

Changes:

Some minor UI changes.

Keyboard shortcyts:
Ctrl 0, +, -, *, /
Marge nodes using Mix, Add, Multiply or Divide mode. Automatic selection of nodes used for merging depending on outputs’ types.
“Yellow” outputs will be marged using “Mix” nodes, “Grey” outputs - “Math” nodes, “Green” outputs - “Mix Shader” or “Add Shader” depending on mode.

Ctrl Shift +, -, *, /
Merge nodes forcing to use “Math” nodes

Ctrl Alt 0, +, -, *, /
Merge nodes forcing to use “Mix” nodes

Shift C
Call “Copy Attributes” menu. Possibility to chose between copying node’s settings or labels.

LINKS:
Wiki Page: http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Nodes/Nodes_Efficiency_Tools
Changelog: http://wiki.blender.org/index.php?title=Extensions:2.6/Py/Scripts/Nodes/Nodes_Efficiency_Tools/Changelog

I’d like to ask your opinion on the following:

In “Nodes Efficiency Tools” we have a tool that adds “SWITCH” nodes to the outputs of selected nodes and names them basing on node’s name, output’s name or both.

I use “SWITCH” instead of “REROUTE” nodes only because when using reroutes - we can’t see the name or label directly in node editor.
This is kind of a hack of mine, but in such cases we shouldn’t use switches.

Recently I came up with the following idea:
Maybe I should use “REROUTE” nodes, but to make the labels visible I’d “wrap” them individually into FRAMES and give labels to those frames.

Here’s how it would look like:


Do you think it’s a good idea?

If the only difference is visual, I think I prefer the second… it is more “slim” and in a complex node setup it can help keep things tidy.

I’ve made a test version of this solution and it doesn’t look good. All those extra frames produce a lot of mess. It begins to be hard to select the nodes, making links etc. At first it looked ok for me, but I think I’ll resign from this idea.

I’d better try to talk to the right people so that maybe in the near future we would have reroutes labels visible in the main node window. When it happens, I’ll gladly resign from switches. At the moment switches seem more useful.

Version 1.6: Improved behavior of “Align Nodes”.
Now nodes width and height are taken into account as well as all behaves correctly when nodes are wrapped into frames (Even complicated framing structures).

http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Nodes/Nodes_Efficiency_Tools

Nice work Bartek! Yes I think a different system would be better… both the solution are some kind of workaround. Anyway for now switches will do the work!

BTW I’m not sure about assigning names to routing nodes in comp view? Won’t they be about the same as a switch anyway?

Yes they would, but the purpose of switches is different than reroutes and IMHO they shouldn’t be used the way I use them.
The additional benefit of having names/labels of rerouting nodes in comp view would be that even without efficiency tools you’d have better view on your setup. In many cases you’d like to use Shift-drag to “cut” link with the reroute nodes, then label some of them if you wish and have those labels visible.
Reroute node speaks for itself. When you see reroute node, you immediately know that it does nothing. When you have collapsed switch you may sometimes have doubts if this is just “fake reroute” or maybe it has some meaning, maybe it’s some node that changes image.
It is all about knowing at once what’s going on.

WARNING:
I just spotted a bug. It’s about copying settings of nodes.
When using it - some links can be lost. I’m working on fixing it, but before I do please don’t use this option, as it’s risky.