Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug [Workaround] for 20.3/21.2 Edit Mode Broken after clicking save.

Discussion in 'Visual Effect Graph' started by peeweekVFX, Jan 8, 2022.

  1. peeweekVFX

    peeweekVFX

    Joined:
    Oct 19, 2015
    Posts:
    14
    Hello,

    I'm dropping that small snippet since it did do the job for me in the meantime the regression is fixed in both LTS 20.3 and 21.2. (Issue seem fixed in 2022.1, but not yet backported)

    TL;DR Problem:

    - Clicking save on the toolbar of a VFX saves it in runtime mode (which makes edits of values in graph *not* previewed real-time, but require instead saving to see changes). Using the force edit mode in preferences does not work around the problem, only closing and reopening the vfx graph window (until save is pressed again, to trigger the bug)

    The Workaround:
    - An asset postprocessor that is triggered upon save (reimport), checks the file name and compares to the one currently opened in VFX Graph, then sets it back to Edit mode automatically.

    How to install/remove:
    You can import the package in your project, then remove the workaround once it will be fixed.


    Not itdeal though, as it's "one more" asset postprocessor for your project.
    But hope that helps anyway,

    Edit: Seemed it had some problems with 2020.3, I uploaded an updated version
     

    Attached Files:

    Last edited: Jan 8, 2022
  2. peeweekVFX

    peeweekVFX

    Joined:
    Oct 19, 2015
    Posts:
    14
    Quick update: I have made some fixes to prevent exceptions to happen (especially when VFX is removed from project)
     

    Attached Files: