This is a followup to my previous question. While that answer tells me how to stack all nodes along the x axis, I now need to stack certain nodes along the y axis, at the same x axis point.
My code right now uses this loop:
for i in node_names:
print(i)
nodes[i].location.x = locx
locx += nodes[i].width + 50
nodes[i].location.y = 0
if nodes[i].type == "TEX_IMAGE":
nodes[i].location.y = locy
locy += nodes[i].height + 200
newlocx = nodes[i].location.x
nodes[i].location.x = newlocx
This gives me a result where the nodes "staircase" up the graph.
I think what I want is to remember the x value of the first image node, but only the first one, and save it to a variable. That way I can just pass that coord as the x value for the rest of them.
I have tried setting the image nodes as their own array and looping through it, but that throws an error because the blender's method doesn't process lists, it processes strings or ints.
I can provide more context if need be.
