I'm creating a new post instead of bumping the previous one since the subject starts to be different.
I'm trying to create a scriptgraph that reads an input texture (any kind of texture input) and stores the pixel value in an array.
For example, if I plug a black and white image of a checker 9*9 pixels, the array I get would be:
1, 0, 1, 0, 1, 0, 1, 0, 1
Multiple questions about that:
- I'm not sure where to fetch the right information to get the pixel color.
I'm using something like that at the moment. where IN_TEXT_MASK is the linker to the texture input.
- Code: Select all
local textMask = IN_TEXT_MASK:getInputNode(octane.P_INPUT):getAttribute(octane.A_BUFFER)
But the value that I get doesn't make sense for me. I realized they were values from 0 to 255 but when I check the invert option in the texture node, nothing happen. It looks like the Buffer attribute may be not the thing I'm looking for.
- How to print things with a script graph?
It would be very useful for me to check what kind of data I'm dealing with and it's very hard to check that easily. The print function doesn't work but I can see a Script Output windows. How to use it?
- I would love to make this thing works with procedural texture, like fractal node etc. But I image it would be a bit more complicated since they have no limit of size. Any idea how to do that?
Thank you very much for your help!