Renaming Already Made Nodes

FlowCanvas Forums Support Renaming Already Made Nodes

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #3016
    grove
    Participant

    Hi, is there any way to safely rename an already made node without making them missing reference in the flow? Currently, I decided to rename one of my node and it broke many of my flows because those flows use the renamed node. It would be time consuming to fix them again one-by-one so a way to not make it lose reference would be nice.

    #3017
    Gavalakis
    Keymaster

    Hello there,

    While renaming the type name of type used in the graph via reflection node, please note that FlowCanvas does have a refactoring tool (Graph Refactor accessible in the graph editor toolbar), which let you batch refactor missing reflection nodes quite easily. Have you tried this tool and if so does it not work for you?

    Another way is to use the [DeserializeFrom] attribute above your changed name type and provide the attribute argument with the full name of the previous type (that means including namespace).

    Please let me know.

    Thank you!

    Join us on Discord: https://discord.gg/97q2Rjh

    #3019
    grove
    Participant

    Hi, maybe missing references is a wrong word to use in this case. The right term maybe is the renamed namespace node was changed into a wrong node so the refactoring tool won’t do much in this case. I attached an example image of the case. The wrong node used to be Set Effector Data but was changed into Is State Name Data when I renamed the namespace.

    Attachments:
    You must be logged in to view attached files.
    #3031
    Gavalakis
    Keymaster

    Hello again and sorry for the late reply!

    Hmm. I cant see how the node changed to point to “Is State Name Data” considering that it has a completely different name than “Set Effector Data”. Did this change simply happened on its own after you changed the class namespace, or did you previously used the Refactor Tool?

    Right now since the node does not point to anything missing, indeed the Refactoring tool cant do much since nothing is missing. A possible solution to change existing nodes to point to a different “reference” is to export the graph in JSON (from the Graph Editor toolbar), manually change the json and finally import that JSON back into the graph (from the toolbar).

    I am still however very puzzled by how the node reference method changed to some other method with a completely different name in the first place. This is something that definitely should not happen automatically.

    Let me know. Thank you.

    Join us on Discord: https://discord.gg/97q2Rjh

    #3040
    grove
    Participant

    Ok, I can give you an example project https://drive.google.com/file/d/1W0vtUKoIx1c1dRKq8i17O0siPdPFEIZZ/view?usp=sharing

    Import the package to a new Unity project. There’s a simple scene. Go to main camera, there will be a bound flowscript controller attached. Inside, you can find 2 nodes. Try renaming the namespace for my custom node, save it, and you can see that the node will be changed to my other node. Tested it a couple of times and it always happened to me.

    Attachments:
    You must be logged in to view attached files.
    #3054
    Gavalakis
    Keymaster

    Hello again and sorry for the late reply.

    I’ve checked your project. The problem here is that you have dozens of classes named exactly the same “SetData”, so when you change the namespace of one of those, since the namespace can no longer be found, the systems fallbacks to another class named “SetData” and since it finds one, the node changes to that newly found node whos class name also is “SetData”. I’d highly recommend against using so mane classes named exactly the same and only differentiated by their namespace (which seems like you are using instead of class naming since each each ‘SetData’ class is in a separate namespace called StartLadderClimbDataNode, IsLadderAbovePlayerDataNode etc).

    Thank you.

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.