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

AddBlendShapeFrame() reset between two editor runs

Discussion in 'Scripting' started by DavidPeicho, Feb 9, 2021.

  1. DavidPeicho

    DavidPeicho

    Joined:
    Nov 18, 2019
    Posts:
    14
    Hi,

    Is there an easy way to reset the editor's cache for blend shapes?

    Basically, I have a script fetching data and applying a blend shape at runtime on a mesh. After the first run, the sharedMesh itself gets changed (which makes sense), but I can't apply the blend shape anymore on other runs because it exists.

    Is there a way to either remove a blend shape programmatically, or clean the added blend shape through the editor?

    Thanks!
     
  2. GroZZleR

    GroZZleR

    Joined:
    Feb 1, 2015
    Posts:
    3,201
    I'll be honest that I don't know much about blendshapes, but if your intention is to make it runtime only, why not instantiate a copy of the mesh before modifying the data instead of using the shared mesh?
     
  3. DavidPeicho

    DavidPeicho

    Joined:
    Nov 18, 2019
    Posts:
    14
    Because I will need to duplicate the entire memory :/ I don't know how the blendshapes are stored anyway in the GPU context, so depending on that there also may be an entire duplication of the GPU memory.