Search Unity

Editing any material in unity 2019 is incredibly slow

Discussion in 'Editor & General Support' started by greengremline, Jul 25, 2019.

  1. greengremline

    greengremline

    Joined:
    Sep 16, 2015
    Posts:
    183
    In Unity 2019.1, it takes around 5 seconds each time you change a material's parameter (from a texture to even changing the color of the albedo!!!), during which the editor freezes and you have to wait. This is a HUGE regression from previous versions, where it would immediately update as you changed it. Not sure what could be causing it as everything worked fine before we updated
     
    Last edited: Jul 25, 2019
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,292
    Hi, Could you please file a bug report?
     
    greengremline likes this.
  3. greengremline

    greengremline

    Joined:
    Sep 16, 2015
    Posts:
    183
    Done, filed 1172218
     
    karl_jones likes this.
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,292
    Hmm it may be tricky to do much with that bug report without an example project. Does this problem happen in an empty project? It could be linked to the size of your project or editor scripts you may have running in the project.
     
  5. greengremline

    greengremline

    Joined:
    Sep 16, 2015
    Posts:
    183
    It doesn't, our project is pretty large and has a lot of assets. I can post a link to a download of the project in the bug report, if it would help
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,292
    Hmm may not be a bug then. Can you try using the profiler in Edit mode to see what is taking so much time?
    Do you have any editor scripts running in the background or any AssetPostProcessors etc?
     
  7. greengremline

    greengremline

    Joined:
    Sep 16, 2015
    Posts:
    183
    Ah I didn't even think of that, so I went ahead and profiled it
    The lag seems to occur due to MaterialEditor.OnEnable() -> GC.Alloc: upload_2019-7-25_21-36-12.png
     
  8. futurewavecs

    futurewavecs

    Joined:
    Jul 26, 2012
    Posts:
    72
    I am experiencing a variation on this as well. 2019.3.f1. I have been editing blendshapes and making some useful tools. Some of which could be amazingly useful at runtime.

    However, the method

    Mesh.GetBlendShapeFrameVertices() is very slow. It locks everything up for around 15 seconds per blendshape.

    The Project this is in isn't something easy to share. If this is not resolved soon I'll try to write a project just to simply demonstrate this.
     
  9. futurewavecs

    futurewavecs

    Joined:
    Jul 26, 2012
    Posts:
    72
    Added details. The recent example of this that I encountered I was writing a method to grab the vertices and bake in the delta based upon the weight on the skinned mesh renderer before removing the blendshapes. This enables using blendshapes to alter the mesh and then bake in the results without needing the blendshapes any longer so ClearBlendShapes can then be used and the results of the blends are still retained. It works fine. However that single GetBlendShapeFrameVertices() command has been the bottleneck and is very slow. I've also played around with passing null for the deltaNormals and deltaTangents parameters to see if that increased the speed. It did not seem to make much of a difference.