Move nodes into node pins

Forums: Move nodes into node pins
Forum for OctaneRender Lua scripting examples, discussion and support.

Move nodes into node pins

Postby roeland » Fri May 20, 2016 2:12 am

roeland Fri May 20, 2016 2:12 am
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 802 times


--
Roeland
User avatar
roeland
OctaneRender Team
OctaneRender Team
 
Posts: 1808
Joined: Wed Mar 09, 2011 10:09 pm

Re: Move nodes into node pins

Postby calus » Fri May 20, 2016 8:15 pm

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

Re: Move nodes into node pins

Postby calus » Mon Jun 06, 2016 8:23 am

calus Mon Jun 06, 2016 8:23 am
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
calus
Licensed Customer
Licensed Customer
 
Posts: 1308
Joined: Sat May 22, 2010 9:31 am
Location: Paris

Re: Move nodes into node pins

Postby roeland » Tue Jun 14, 2016 5:54 am

roeland Tue Jun 14, 2016 5:54 am
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
User avatar
roeland
OctaneRender Team
OctaneRender Team
 
Posts: 1808
Joined: Wed Mar 09, 2011 10:09 pm

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 8 guests

Fri Mar 29, 2024 1:04 am [ UTC ]