xNode
xNode copied to clipboard
Changing Node Parameters Effects Other Nodes Parameter bug?
I have a simple node that renders noise texture, but if I put two of these nodes on the graph, when I change the a value eg. frequency it changes the other nodes values slightly?? It's very strange. I can see a preview texture that changes when it should not be.
Also, if I move the mouse over an output port sometimes the preview texture becomes garbage, and when I move over again it fixes it up? what could be going wrong? GetValue(NodePort port) messes things up, and ports loose references?
Sounds like you've been messing with custom node editors. Have you remembered using serializedObject.Update();
and serializedObject.ApplyModifiedProperties();
as stated in https://github.com/Siccity/xNode/wiki/Node-Editors?
Yes I did all that and many other combinations, even nodes without custom editor have problems. Please show example of a node with an editor that does some operation on two textures.
Also, when I restart unity, everything behaves differently again. When does object GetValue(NodePort port) get called and how often. eg. override void Init() is not called if I restart Unity, it only gets called when you first create node.
GetValue() is called when you call something like GetInput/OutputValue, or when you hover a port and the tooltip shows. That's about it.
Init() is called by OnEnable (after calling some internal functions). I actually just created a new test branch where I got rid of Init() entirely to alleviate some of the obscurity. In that branch you can just use OnEnable directly. Unity says OnEnable is called "when the object is loaded" https://docs.unity3d.com/ScriptReference/ScriptableObject.OnEnable.html