Pink Nodes

If you have out of date nodes in your graphs that need updating, uScript will turn them a bright pink color.

 

 

 

Why Nodes Turn Pink

Before getting into how to fix out of date nodes, it is first important to understand why nodes might be out of date.

 

uScript has many nodes and each of these nodes is actually just a C-Sharp script (.cs) that performs a specific function. Other nodes are just part of uScript's reflection system. In both cases uScript just visualizes all this programming script code as visual nodes in the uScript Editor. Because uScript is not in full control of all these visualized scripts, it is important that it has a system in place to handle the case where code it is visualizing as nodes can detect changes that might have been made by someone working on your project.

 

The primary goal to detect these potential modifications to is to try and handle the changes that were made and preserve as much data in your graphs as possible. This is really important when,for example, you might have a variable in uScript hooked up to a socket on a node and; that node no longer has that socket, the socket has been named differently in the programming code, the socket now takes a different type of variable than before, etc. By not just auto-updating existing nodes on your graph (which could wipe out data you had set on the in the node's Properties Panel) we are able to preserve important node data and settings you might want to have access to before performing the node upgrade.

 

However, before uScript can rebuild your graphs generated source code and to take advantage of the changes made to either a node or some other reflected code, you must perform the upgrade on the node(s) and make sure everything is set up properly to handle the new code and properties that might have been introduced.

 

Note! - Some simple changes to a node's source code will not cause the node to turn pink because uScript will be smart enough to know how to handle the updated source code and automatically fix everything for you.

 

Nodes may need to be upgraded for several reasons:

 

Unity Compile Errors

Because of how Unity's editor tools architecture works, if Unity can not fully compile all the source code of the project due to any compile error, it will not be able to fully compile the uScript Editor itself. When this happens, there is a chance that all nodes on your canvas will show up as pink because uScript is not able to fully function and validate all the projects code to ensure it was the same as before (becauseUnity couldn't compile it all).

 

When this happens it is important to discover what is causing the error and fix it before using the uScript Editor. If the cause is uScript generated code (which can easily happen if a node you are using in existing graphs has been modified in major ways), you can safely delete that generated code, then run uScript, upgrade the pink node(s) in the offending graph(s) and then regenerate the code.

 

Updated Node Source Code

As mentioned above, if a node has been modified in such a way as to change the sockets, or properties required by the node, uScript will need to mark it for updating in an effort to preserve your old data so you can access it before updating the node on existing graphs. This also goes for any node created by uScript of existing project code or other middleware through reflection.

 

Node Marked Deprecated

If a node is deprecated through the Deprecate attribute in a node's source code it will be marked pink and in need of replacement or updating (see the uScript Development Guide's section on Attributes for more information).

 

When a node is marked for deprecation without specifying a new node to replace it with, the nodes will need to be removed from existing graphs and no new instances of that node may be placed. If a new node was specified in the Deprecate attribute, the node must be upgraded to the new node.

 

Identifying Nodes Needing Updating

The easiest way to know if your graph has any nodes that need updating is to look at the References Panel (see the Reference Panel section of "Editor Interface" for more information) with your graph open in uScript with no nodes selected. This will show you information about the open graph. Here you can see this graph has 1 node in need of updating (note the red text in the image). You can use the buttons there to focus on the node in the Canvas as well as fix it.

 

 

There are other ways to see and fix these nodes as well as shown in the next section.

 

 

Upgrading Nodes

There are three ways to upgrade pink nodes in your graph. The first is to Right-Click them and select "Upgrade Node" option.

 

 

 

You can also use the Upgrade button on pink nodes in the Contents Panel (See "Canvas Navigation" for more information about the Contents Panel):

 

 

 

Lastly, you can have uScript auto-upgrade all pink nodes on your graph by using the "Upgrade Deprecated Nodes" item in uScript's File Menu: