Can I disable FlowScript Controller serializing Zoom and Translation?

FlowCanvas Forums Support Can I disable FlowScript Controller serializing Zoom and Translation?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #3480
    luizbeneton_labster
    Participant

    Hello there, my project intends to use Asset Bundles and Addressables to distribute content without needing to create a new app.
    Some of these assets will be Prefabs, and they will have a FlowScript Controller in them.
    Currently, the ZoomFactor and Translation of the viewport of FlowScript Canvas is serialized in the prefab. This means that just by looking inside the Graph I will have a change in my prefab (check picture) and this means that the hash for my asset bundle will change!

    This is pretty bad for my use case, as my players will have to redownload the bundles even if nothing really changed in them, only the zoom level that is only relevant in editor time. (check picture)

    Is there a way to not serialize these fields? I couldn’t find anything in the FlowCanvas configuration.

    Attachments:
    You must be logged in to view attached files.
    #3483
    luizbeneton_labster
    Participant

    Bump.


    @nuverian
    maybe?

    #3484
    Gavalakis
    Keymaster

    Hello there,

    I initially opted to serialize translation and zoom so that it is saved with the graph and thus a graph opens up at the same translation/zoom that it was left at. Furthermore serializing translation and zoom also allows for them to be part of an Undo (and thus being more clear what was undoed). With that said, you can open the GraphSource.cs and remove the serialization attributes from the ‘_translation’ and ‘_zoomFactor’ fields to not serialize them. I will also look into this and possibly change them to be serialized in EditorPrefs instead.

    Let me know if that works for you.

    Thanks!

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

    #3487
    luizbeneton_labster
    Participant

    Hey Gavalakis, thanks for the reply.
    I totally understand the motivation behind serializing these fields, and I appretiate if you look into use EditorPrefs, or any other solution to solve the problem. It may be worth checking how Unity Visual Scripting does it, or how other plugins do it. I believe Behaviour Designer solved this problem without serializing it to the Prefab object directly.

    And for the solution to comment out the attributes, it works for new graphs, but it totally breaks all previous Graphs I had :/
    I tried to drill down and check how to prevent this to be perceived as an error, but I couldn’t. Maybe you cna shed some light here?

    Attachments:
    You must be logged in to view attached files.
    #3490
    luizbeneton_labster
    Participant

    Interesting development.
    I decided to move forward and redo all my graphs and to my surprise, the second time I commented the serialization the Canvas window didn’t complain about bad serialization.

    All seems good now. I will update this thread if it starts complaining again.

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