Need help to understand an code a scriptgraph

Forums: Need help to understand an code a scriptgraph
Forum for OctaneRender Lua scripting examples, discussion and support.

Need help to understand an code a scriptgraph

Postby Wallan » Fri Sep 18, 2015 12:46 pm

Wallan Fri Sep 18, 2015 12:46 pm
I think image explains quite well what I want to do.
That is a scriptgraph that takes an RGB image and an Transform Value as inputs and outputs a new image with the selected transform values.

From example code I have managed to figure out how to add the inputs and outputs but I cant figure out how to create new RGB Image as a copy of the one in the input.
I suppose that if I just can get some help to create the image and connect to the output then I can probably figure out how to change transform values by myself.

Would be really grateful for help on this .

Any tips on how to write and debug scripgraphs would also be appreciated.
Normally I would use print() and error() to help in debug in editor but using print() in the scriptgraph don't seem to show up anyware(not that strange) and error() crashes Octane (not that surprising).
Attachments
OctaneFlow.png
Windows 7 Ultimate 64bit 32Gb RAM. Intel Core i7-5820K [email protected] GHZ. Display uses a Gigabyte GTX 460 1Gb VRAM. Octane uses an EVGA GTX 970 4Gb VRAM.
Wallan
Licensed Customer
Licensed Customer
 
Posts: 47
Joined: Fri Jan 23, 2015 6:13 pm

Re: Need help to understand an code a scriptgraph

Postby bepeg4d » Fri Sep 18, 2015 3:51 pm

bepeg4d Fri Sep 18, 2015 3:51 pm
Hi,
since you have opened a new discussion in the right place, i will respond to you here ;)
Ok, here is my attempt:
Schermata 2015-09-18 alle 17.48.29.jpg

OffsetTex-01.lua
(2.09 KiB) Downloaded 299 times

It almost works as expected, If you use the first two output ports... but for some unknown reason (from me) the output ports are duplicated and inverted :roll:
Maybe you can find my mistake ;)
ciao beppe
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 6586
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: Need help to understand an code a scriptgraph

Postby Wallan » Fri Sep 18, 2015 4:38 pm

Wallan Fri Sep 18, 2015 4:38 pm
Thank's' will take a look. :)
Windows 7 Ultimate 64bit 32Gb RAM. Intel Core i7-5820K [email protected] GHZ. Display uses a Gigabyte GTX 460 1Gb VRAM. Octane uses an EVGA GTX 970 4Gb VRAM.
Wallan
Licensed Customer
Licensed Customer
 
Posts: 47
Joined: Fri Jan 23, 2015 6:13 pm

Re: Need help to understand how to code a scriptgraph

Postby Wallan » Fri Sep 18, 2015 6:23 pm

Wallan Fri Sep 18, 2015 6:23 pm
Well, it works but I found a problem.

First.
Looking at the code I can't see any reason for double outputs either.
Nice structured code that will helped me understand it.
Will try to rebuild it from scratch later on to see if that will help me figure out why and when double outputs appears.


But.
Problem is that when i reload the project, any connections made from the outputs to my materials are lost.
Same happen if I select the Scriptgraph and press refresh.
Any ideas?
Windows 7 Ultimate 64bit 32Gb RAM. Intel Core i7-5820K [email protected] GHZ. Display uses a Gigabyte GTX 460 1Gb VRAM. Octane uses an EVGA GTX 970 4Gb VRAM.
Wallan
Licensed Customer
Licensed Customer
 
Posts: 47
Joined: Fri Jan 23, 2015 6:13 pm

Re: Need help to understand an code a scriptgraph

Postby Wallan » Fri Sep 18, 2015 10:15 pm

Wallan Fri Sep 18, 2015 10:15 pm
OK.

Made some progress.
Did some rewrite and made the code look more like the example code from the API.
After fiddling around a little, mostly not really knowing what I did I did manage to get rid of the duplicate outputs, connections are no longer lost on project reload.

I'm not sure what made things work better.

The real mystery is that I tried to connect input[1] to output[1] but got did it wrong and got some errors so I removed the code part. But strangely, what's put in at input[1] comes out at output[1] without any connections has been made in code.
Is there something working behind the scenes here, that connect input[1] to output[1] automatically?
Well, I have no idea.

Anyone that knows?

I have attached the modified code if someone want to take a look.

bepeg4d:
Thank's for your help.
Most appreciated.
Attachments
TextureTransform.lua
(2.39 KiB) Downloaded 281 times
Windows 7 Ultimate 64bit 32Gb RAM. Intel Core i7-5820K [email protected] GHZ. Display uses a Gigabyte GTX 460 1Gb VRAM. Octane uses an EVGA GTX 970 4Gb VRAM.
Wallan
Licensed Customer
Licensed Customer
 
Posts: 47
Joined: Fri Jan 23, 2015 6:13 pm

Re: Need help to understand an code a scriptgraph

Postby bepeg4d » Fri Sep 18, 2015 11:48 pm

bepeg4d Fri Sep 18, 2015 11:48 pm
Hi Wallan,
thank you too for let me understand my mistake, now I have revisited my code and there are no more double connections ;)
OffsetTex-01.lua
(1.67 KiB) Downloaded 382 times

About the output 1, I guess there is any direct connection, I have revisited your code adding a Tex1 line:
TextureTransform.lua
(2.51 KiB) Downloaded 388 times


ciao beppe
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 6586
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 1 guest

Thu Sep 19, 2019 10:58 pm [ UTC ]