Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Modifying a custom VFXType struct defined in C# does not reflect the changes in compiled VFX graph

Discussion in 'Visual Effect Graph' started by spajus, Aug 24, 2022.

  1. spajus

    spajus

    Joined:
    Jun 10, 2015
    Posts:
    43
    The only way to apply the modifications that I have found is to rename the struct. Even then the VFX graph shows the old struct and the new one. Is there a way to properly apply the changes, or is it a bug?
    I'm on 2021 LTS, the version of Visual Effect Graph is 12.1.7
     
  2. spajus

    spajus

    Joined:
    Jun 10, 2015
    Posts:
    43
    To fully illustrate the negative impact of this, imagine the situation:

    1. You create a custom struct, like ParticleData, which contains particle position and sprite id
    2. You create 50 different particle effects (.vfx files) that use this ParticleData struct which you feed in through a GraphicsBuffer
    3. You figure that you have to add color to ParticleData, if you just add color field, it won't work, because all 50 .vfx files will have the older version of the struct in their generated YAML.
    4. The only workaround is to copy the struct, rename it, add the new field in the renamed version, then go through all 50 files and manually switch the SampleGraphicsBuffer type, and rewire the connections.

    This is a nightmare.
     
    omony likes this.
  3. Mayumichi

    Mayumichi

    Joined:
    Mar 12, 2017
    Posts:
    31
    You have to click the arrow in the second image to show new members. Yeah it's not really intuitive... :D

    upload_2022-9-7_9-1-0.png

    upload_2022-9-7_9-3-50.png