Search Unity

Bug No VFXs in build in 2022.2

Discussion in 'Visual Effect Graph' started by nehvaleem, Mar 21, 2023.

  1. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    436
    Hi,
    I have a CI set up that is building a player. I am using 2022.2.10f1 + HDRP.

    In my build script I have a call to:
    Code (csharp):
    1. EditorApplication.ExecuteMenuItem("Edit/VFX/Rebuild And Save All VFX Graphs");
    to ensure that all vfx'es are up to date and fully working.

    This worked just fine in 2021.3 LTS, but it doesn't do the trick in 2022.2.
    Some important things:
    1. When I clone my repository from scratch there are no vfx in the editor. I have to call this
    Edit/VFX/Rebuild And Save All VFX Graphs
    to get them working in the first place.
    2. After that - it seems that they work just fine. But when my CI builds the player and calls Rebuild on VFX Graph once again - it results that the player doesn't come with the visible vfx
    3. If I skip that step during the build - it seems that the vfx are working just fine, but it isn't reliable as mentioned in the 1st step - I still have to call rebuild after the initial clone of the repo

    I have disabled stripping of instanced shader variants. The only thing that makes a difference is the absence of rebuild vfx graphs call.

    Did anyone stumbled upon something similar?
     
  2. PaulDemeulenaere

    PaulDemeulenaere

    Unity Technologies

    Joined:
    Sep 29, 2016
    Posts:
    154
    Hello,
    It is an unexpected behavior. After cloning from scratch and open editor, can you take a look at your full Editor.log (located in %LOCALAPPDATA%\Unity\Editor\Editor.log), there is maybe an error during an import which could lead us to the actual cause of your failure. In the past, we already noticed issues with OnPostprocessAllAssets exception having side effect on the VisualEffectAsset import.

    In 22.2, there is also a known issue causing an asset loading failure, it randomly generates the error "This method should not be called on a disabled block" and cancels the compilation, the fix has already been identified.

    I'm confused by this part, the ExecuteMenuItem is making VFX work when you are calling it locally but it has the opposite side effect while running it in CI, Have I got that right?
     
  3. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    436
    Yes, exactly. Both cases are on the same machine (as I have a dedicated pc for the CI/CD). I have to call ExecuteMenuItem after the initial clone (and it is resulting in vfx present in the editor play mode), but with this call in the build script, there is no vfx in the built player.

    I'll try to isolate this case in a repro or at least narrow it down a bit. I didn't see anything relevant in the logs so far, but I'll take another look.
     
    PaulDemeulenaere likes this.