Search Unity

Stripped classes in animation.rigging package

Discussion in 'Animation Rigging' started by WhereIsMyCarDude, Aug 21, 2020.

  1. WhereIsMyCarDude

    WhereIsMyCarDude

    Joined:
    Jun 17, 2015
    Posts:
    26
    Hello,
    Seems like unity/C#/IL2CPP is stripping some classes in the
    com.unity.animation.rigging package when I build to standalone. I have managed stripping level to Low and C++ compiler configuration to Release. I fixed/haxed it by placing some
    var overrideTransform = gameObject.GetComponent<UnityEngine.Animations.Rigging.OverrideTransform>(); in my main assembly for the classes that are stripped. The classes that are stripped is:
    Code (CSharp):
    1. UnityEngine.Animations.Rigging.OverrideTransform
    2. UnityEngine.Animations.Rigging.Rig
    3. UnityEngine.Animations.Rigging.MultiParentConstraint
    4. UnityEngine.Animations.Rigging.MultiReferentialConstraint
    5. UnityEngine.Animations.Rigging.BoneRenderer
    6. UnityEngine.Animations.Rigging.RigBuilder
    7. UnityEngine.Animations.Rigging.RigTransform
    8. UnityEngine.Animations.Rigging.TwoBoneIKConstraint
    Would be nice if they get slapped with a [Preserve] attribute maybe :)

    Regards
     
  2. WhereIsMyCarDude

    WhereIsMyCarDude

    Joined:
    Jun 17, 2015
    Posts:
    26
    forgot to say that my unity version is 2019.4.6f1 and animation.rigging is preview 0.2.7
     
  3. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    295
    I can't seem to reproduce your issue when generating a standalone IL2CPP mac build with low level code stripping.
    Do you mind logging a bug report for that? You can do so using the Unity Bug Reporter in Unity.
     
  4. WhereIsMyCarDude

    WhereIsMyCarDude

    Joined:
    Jun 17, 2015
    Posts:
    26
    Will see if I can repro it in a smaller project.
    Though I have all models and animation stuff in assetbundles. So that could be why it stripps the classes
     
    Last edited: Aug 24, 2020
  5. WhereIsMyCarDude

    WhereIsMyCarDude

    Joined:
    Jun 17, 2015
    Posts:
    26
    I managed to repro it.
    I have the animations in a AssetBundle and my PlayerSettings have:
    Scripting Backend: IL2CPP
    Api Compatability Level: .NET 4.x
    C++ Compiler Configuration: Release
    Managed Stripping Level: Low

    I got the repro when I switched to ".NET 4.x" I had already made so that it loads the model via AssetBundles.
    When I switch to ".NET Standard 2.0" it starts to work again. I guess it is different compilers so they might stripp differently?
     
  6. WhereIsMyCarDude

    WhereIsMyCarDude

    Joined:
    Jun 17, 2015
    Posts:
    26
    I have now uploaded a bug report: 1272602
    I remade the project and noticed that it was bugged on both .NET 4.x and .NET Standard 2.0 in the new project.
     
  7. WhereIsMyCarDude

    WhereIsMyCarDude

    Joined:
    Jun 17, 2015
    Posts:
    26
    I guess that it is most likely an assetbundle problem right? Hard for the compiler to find dependencies in already built bundles maybe?
     
  8. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    295
    Thank you for submitting a bug report. Indeed this seems to be caused by how asset bundles handle their dependencies (matter on which I'm not very knowledgeable unfortunately).

    The team handling the asset bundles have taken over the bug!

    Cheers!
     
  9. WhereIsMyCarDude

    WhereIsMyCarDude

    Joined:
    Jun 17, 2015
    Posts:
    26
    Awesome!
    Good to know that my bug report is helping :)
     
  10. IARI

    IARI

    Joined:
    May 8, 2014
    Posts:
    70
    For us, animation Rigging
    - works in the Editor (both when loading a Scene directly, and when loading a prefab via AssetBundle)
    - works on Android/iOS Devices the App when loaded directly from a Scene
    - does not work on Android/iOS Devices when Loaded via AssetBundle.
    We get the following:
    Bildschirmfoto 2021-04-20 um 16.21.35.png
    Could this be related?
    I just found the issue in the Tracker - will try the suggested solution there...
    https://issuetracker.unity3d.com/is...ging-scripts-when-building-with-asset-bundles

    However: The info in this Issue is not exactly very detailed.
    So if i understand correctly everyone who wants to use the animation-rigging package with AssetBundles will have to somehow fiddle with the Manifest maually and Add File references there?
    Sounds rather like monkeypatching than a real solution to me - so maybe I'm missing the bigger picture, or misunderstood the solution?
     
    Last edited: Apr 20, 2021
  11. jos_valentin

    jos_valentin

    Joined:
    Aug 4, 2020
    Posts:
    23
    Any solution for this? i'm having this issue, should i use addressables?