Move nodes into node pins

Forum for OctaneRender Lua scripting examples, discussion and support.
Post Reply
User avatar
roeland
OctaneRender Team
Posts: 1822
Joined: Wed Mar 09, 2011 10:09 pm

This script moves all the selected nodes into their destination pins if possible. To use, select the nodes to be moved (don't select the destination node) and run this script.

A node can be moved if:
  • The ouput is connected to exactly one destination pin,
  • All nodes connected to the input pins are either already inside the input pin, or they will be moved there by this script
Download:
Move nodes into pins.lua
(3.38 KiB) Downloaded 928 times
--
Roeland
calus
Licensed Customer
Posts: 1308
Joined: Sat May 22, 2010 9:31 am
Location: Paris

Very useful script, thanks !
Pascal ANDRE
calus
Licensed Customer
Posts: 1308
Joined: Sat May 22, 2010 9:31 am
Location: Paris

Hi Roeland,

I'm trying to make a "Move nodes out of node pins" script.
I want to unfold the graph except the "end of chain" value nodes and rgb node.

Do you think it's a good idea to start from this script and kind of reverse it, or should I use a different approach ?
Pascal ANDRE
User avatar
roeland
OctaneRender Team
Posts: 1822
Joined: Wed Mar 09, 2011 10:09 pm

You can look at this script for a start, you'll need to go over the nodes recursively in a similar way. The moving out case will be a bit easier since any internal node will definitely be moved out.

The terminal value nodes are easy to recognise because they don't have any input pins.

--
Roeland
Post Reply

Return to “Lua Scripting”