0

Node tree doesn't recalculate itself fully

behealed 8 years ago updated 8 years ago 2

If you work with a lerp that's got a vector4 attached to both its inputs, and then you switch those vector4's to vector3's.. the rest of the branch of nodes doesn't update. They all still think it's a vector4. Only way to fix it is to reattach nodes that are being affected, to get them to "realize" it isn't a vector4 anymore.


To recreate this behavior, create all these nodes in this order:


Lerp

append

vector3

vector1

component mask


Connect lerp to comp. mask[in]

Connect Vector1 to lerp[t]
Connect append to lerp[a] and [lerp]b
Connect vector1 to append[first input]
Connect vector3 to append[second input]
Connect component mask to anything.
Compile shader.

Notice it will only let you select channel R on component mask? That's the bug. The component mask didn't update when you connected the vector3 to the append node.

Reconnect append to lerp[a]. The bug goes away.

Now, delete the vector3 node.

Connect vector1 to both inputs on append node.

Append is now outputing a vector2, but lerp is still outputting a vector3... and the shader is now pink (generating an error).

Reconnect append to lerp, and the error goes away again.


Note: this error also can occur during undo/redo.

Oops, sorry, I forgot to mention: select alpha channel on the component mask before you delete the vector3 node. That'll help ensure you get the pink (generating an error) part of my bug report. :)

In the last week I've seen two examples of nodes of mine that simply refused to work correctly until I deleted them, and recreated them. I do believe this bug has to do with SF not recalculating its internal data fully. Deleting a node and recreating it seems to be the only solution in such cases.


Here's example:


1) Create two texture assets

2) Give them different names

3) Make one global

4) Link them up so that they are affecting the main node (doesn't matter how).

5) Change the global one to have the same name as the local one.

6) Set the local one to also be global (now they are both global, and both have same name)

7) Observe that during all this, no errors have occurred, even though two nodes with same name

8) Change the earlier local one back to local again.

9) Change the local one back to its old name.

10) Observe that the global one no longer functions, it only passes the default color of grey, and it won't pass its color anymore. You can mess with it all you want, re-link it even, and nothing.

11) Delete the global node, recreate it with the same name, and observe that it's working now again.