Graph becomes empty after a custom node compilation error

My environment

Unity: 2021.3.2f1
UVS: 1.7.8
OS: macOS 12.4.

I’m evaluating UVS to see if building workflows using custom nodes is a viable solution. But I’m hit with an annoying issue:

  • Create a GameObject, add a Script Machine and attach a Script Graph to it.
  • Create a custom node that compiles fine and shows up correctly in the above Graph.
  • Build a simple graph with the custom node, such as OnStartEvent => MyNode.
  • Edit the node’s C# script a bit to make it break during compilation.
  • Quit Unity and reopen the project, select Ignore to force open with the compilation error present.
  • Fix the script and make it compile.
  • Find the Graph and activate it.
  • Now the Graph is completely empty!

No refreshing could fix it while Unity is open the entire time.
The workaround I found is to quit Unity and reopen the project once again after Step 6 above, and then the Graph works again.

Another more serious trouble: After I rename the custom node class from MyNode to MyOtherNode, then this time the Graph becomes empty and completely unrecoverable over a deserialization error! I tried all the reopening/refreshing tricks and also tried regenerating the nodes from Project Settings, but no effect.

This looks like a showstopper to me.

Is this by design or am I missing anything obvious?
For one, I’ve never found a way to explicitly save/export the graphs through the Editor UI, other than creating the Graph as an asset in the Project window. However, the Graph is always correctly loaded after a clean close-and-reopening cycle if no errors are in my custom node script.

1 Like

Yes, the tool was never designed with a custom node workflow in mind. It was marketed purely at Unity/coding newbies and didn’t even have its custom node API documented before Unity acquired it. Hence the issues.

They’re redesigning the tool from the ground up for Unity 2023. In the meantime, I wouldn’t expect for things to improve in this regard.

Yes, we are aware of this issue. you can follow it with this link.

Thx for adding the repro steps, I will try our freshly created branch with the fix to see if the second issue is also fixed.

1 Like

You can rename the custom node directly in the serialised file. Also use RenamedFrom attributes in your code. Although i prefer the first option. When you rename then it no longer exists, yet your graph refers to it.

1 Like

Sorry for the long delay. I was able to test the fix with the removal of a script, with a node renamed with the Attribute
[RenamedFrom(“MyNode”)] on top of the class. Pretty much all use cases should be fine when the fix is pushed.