0
$\begingroup$

I'm troubleshooting a model in which I have an Image Texture node with a generated image 119,617 pixels in width. As the node accepts the pixel coordinates in normalized form only (from 0 to 1), I have to divide the pixel indices (0,1,2...119616) by their total number (119,617).

I'm getting unexpected results, in which the colors of the image texture are offset by a certain number of pixels (in some cases upward, in other cases downward), which led me to suspect this was a numerical error, maybe a rounding error due to limited precision of the Math node.

In other words, maybe the number of decimal places kept in the division result (e.g., of 1/119617) was too small to precisely capture the pixel positions (and therefore to correctly locate them in the image texture).

As answered here, this does not seem to be the problem (though not knowing the cause just yet I can't be 100% sure).

To better troubleshoot this issue, I'd like to look at the vector input values of the Image Texture node. These are the normalized pixel positions. I know that the Data-Blocks field of the Outliner panel has a lot of data, but the Input section for the Image Texture node doesn't show the vector values themselves.

Knowing that things that can't be done interactively in Blender often can be done with Python code, I'm wondering: is there a way to access those input vector values with some Python commands?

Many thanks in advance if you know the answer and care to share!

$\endgroup$
1
$\begingroup$

To view the vector values, you can plug what goes to the texture node to Emission shader and render those vectors as colors.

You can check only values stored in input fields from python, the nodes are not processed when querying these values. Value outputs will just give 0.0. The shader node tree gets executed when rendering.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.