Learn how to use NodeCanvas

Using the Graph Refactor

When a graph element (Task, Node) class, or reflection reference (in case you use reflection tasks) is renamed or missing, NodeCanvas retains the original serialization and provides the Graph Refactor utility window to allow you to batch refactor those missing or renamed elements and references to the new correct ones, while also retaining the original serialization of the element, like for example its serialized properties, and BBParameters! Other tools either silently remove the missing nodes/tasks, or provide no means to recover at all, with the only option given to delete the missing elements and re-add the new elements which obviously destroys the graph design and requires a lot of manual work.

Let’s take this example graph, which is using a task named “MyAction” 3 times and another one named “MyTransformAction” once.

If we later decide to rename the task class names to something different like for example “HisAction” and “HisTransformAction”, those tasks will be missing and as such the graph will now inform us of this fact.

If you have the Graph Console opened as well, this fact will also be logged there and thus by clicking the console logs you will be able to automatically open the related graph and focus on the related node as usual with all logs in the Graph Console!

The Graph Refactor

To fix these renames quickly the Graph Refactor comes to the rescue (“Tools/ParadoxNotion/NodeCanvas/Graph Refactor”) or simply by the “{ }” button in the Graph Editor toolbar. Once you open up the Graph Refactor window and hit the “Gather” button, information about the currently open graph in the editor will be gathered.

As the help text in the Graph Refactor window suggests, we simply have to rename the Type Name in this case, to the new type names (“HisAction” and “HisTransformAction”). Once we do that and hit the “Save” button our graph will batch recover all occurencies along with any serialized data that the tasks originally had as well (for example serialized properties, BBParameters, etc).

This works exactly the same for Task and Nodes, as well as reflection references (methods, properties, etc) used in the graph (that would usually be the Reflection-based tasks).

Yes No Suggest edit
4 of 4 users found this section helpful
Suggest Edit