Search Unity

removing scale animation curves

Discussion in 'Scripting' started by sschoellhammer, Apr 13, 2017.

  1. sschoellhammer

    sschoellhammer

    Joined:
    Feb 15, 2013
    Posts:
    46
    Hello!

    We have a lot of character animation and a good deal of time spent int the animators update.
    I figured that here animation curves are sampled/interpolated etc. and my idea was to remove all scale animation curves (as we don't use any scale anywhere) but I'm having some problems with that.

    This is my code :
    https://pastebin.com/PQzPirS2

    This works but at the same time I now use a good deal more memory - does anybody know the reason for this?

    I thought this might have to do with unity creating a copy of assets when changing something? I tried to put in this:
    1. void OnPreprocessModel (){
    2. ((ModelImporter)assetImporter).isReadable = false;
    but that didn't change anything.

    Happy about any suggestions!!
    Seb