Search Unity

Various issues with Alembic files, playback, differences between build and editor timing

Discussion in 'Asset Importing & Exporting' started by fherbst, Feb 13, 2019.

  1. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    Version: 1.0.0-preview.8

    Bug 1: It seems I can't properly make a build with this Package out of the box. Dropping an alembic file into the editor creates a copy of the file in StreamingAssets, but in a build, the path to the alembic file is wrong.
    File in Editor is at
    D:\Projects\Test\Assets\01_Assets/jumping_rabbit.abc


    Streaming Assets was automatically generated at
    D:\Projects\Test\Assets\StreamingAssets\01_Assets/jumping_rabbit.abc


    Error message in Build:
    failed to load alembic at D:/Projects/Test/Builds/Jumping Rabbit_Data/01_Assets/jumping_rabbit.abc


    I was able to resolve that by moving the file to
    D:/Projects/Test/Builds/Jumping Rabbit_Data/01_Assets/jumping_rabbit.abc

    (out of StreamingAssets folder).

    Bug 2: Seems it is not possible to control the Alembic time other than through timeline since everything is sealed away / internal. This is very confusing and especially very much not "Unity-like" to have fields visible in the Inspector that cannot be accessed by other scripts. Plus some extra confusion since the Timeline component is allowed to access it...

    Bug 3: Accessing one of the Alembic MeshFilters with
    GetComponent<MeshFilter>().mesh
    (just accessing!) immediately stops Alembic playback, but only in a build, not in the Editor - nothing plays anymore afterwards. Doing
    Instantiate(GetComponent<MeshFilter>().sharedMesh)
    does work though. Took me quite a while to figure that out...

    Bug 4: Frame timings differ between Editor and Build. I've got an abc file that contains exactly 60 looping frames at 25fps. When I calculated/adjusted values "mathematically correct" the Editor wasn't able to loop the file properly, while the build is. When I adjusted values to "look right" in the Editor, the build wasn't looping correctly anymore.

    Question 1: I read above that preview 8 shouldnt copy the file to StreamingAssets anymore, but still it does. Is that intended, or am I doing something wrong?

    Question 2: Is there an example of reading an external Alembic file (not first imported into Unity)? That would be an important functionality. Since all classes are marked as "internal" it's not possible to try anything without changing a lot of things in the package code first.
     
  2. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    189
    Thanks for the post

    Alembic version 1.0.0 was pushed into production last week. Soon enough it will be available for install through Packman UI for 2018.3.4+.
    I will respond one by one:
    Bug 1 This should fixed. If you do have a copy in the streamingAssets, you will have to delete by hand. Bear in mind you might still have issues that the actual ABC file might not be bundled with your build.
    Bug 2 Is unfortunately a known limitation. For now almost everything is internal since a proper cleanup pass has to be made for cleaning the API, as well as document it. If the timeline is dealbreaker for you, you can access it by reflection until we fix it.
    Bug 3-4 need to investigate them. So far, the Alembic integration, was used extensively in editors mostly.
    Question 1 try version 1.0.0
    Question 2 Not positive I understand what you mean. You would like to have an example on how to write a ScriptedImporter for ABCs that would suite your needs better ?
     
    Last edited: Feb 13, 2019
  3. U3D2307428397

    U3D2307428397

    Joined:
    Mar 22, 2018
    Posts:
    4
    If I want Alembic to use animated clips to create a behavior tree in the game, what should I do
     
  4. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    Thanks for your answers.
    Regarding Question 2: I just mean importing an .abc file at runtime (like the "old" unity-jp package allowed). At runtime, point to a place on disk and load the .abc from there.

     
  5. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    189
    Now I get it.
    The functionality is there. Unfortunately everything is internal. We will make a pass to make a proper public API.
    If this is important to you today, you can modify the package code to expose stuff, or use reflection.
     
  6. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    Thank you. Would be great to get an update on that. Any news about Bugs 3-4?
     
  7. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    189
    Sorry, did not have the time to look into it. The accessing part feels very strange.
    So far the standalone part was not used a lot. Also I should tell you that with the current version, your standalone apps are not redistributable: All your ABC prefabs will point to the "Assets" version, so it should run on the same machine. This will be fixed in a later version of the Alembic plugin.
     
  8. kyip2

    kyip2

    Joined:
    Jul 10, 2018
    Posts:
    12
    Getting some odd behavior when running standalone, using asset bundles (they're uncompressed). Since the abc files are no longer copied to the StreamingAssets folder (I'm running 1.0.0 preview 8), when running standalone the alembic shot clips no longer playback the alembic animation. Checking the size of the asset bundles they do not contain the full .abc files, even though they are auto referenced as seen in the asset bundle browser tool. So I don't know where the abc files should be located now in order for the standalone player to find them. Hope you guys are aware of this? Is there a workaround?
     
  9. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    Hm @vladala, with the version I used I was able to create an executable for redistribution just fine by manually fixing the paths/StreamingAssets as seen in my first thread (Bug 1). You mean with a newer version it now is worse?
     
  10. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    189
    You can still fix paths just fine. It is just not automagic anymore.
    Before you would get your ABCs duplicated (Assets and StreamingAssets). This was unacceptable for most people (duplicating multi-gig files).
    The correct automatic solution will be done soon enough :)
     
  11. AnonUser84727

    AnonUser84727

    Joined:
    Nov 16, 2018
    Posts:
    3
    I also ran into this and my project is screwed, even after removing the code that was accessing the mesh this bug continued, I restarted my computer and all of my alembic files are still broken in builds. The project was under version control and nothing seems to have changed in the files so I can't revert to a past commit either. I've tried right clicking and reimporting the alembic files as well as deleting the library folder. Deleting and recreating the timeline also didn't work.

    My only path forward seems to be to delete the alembic files and all of the timelines and redo all of them because of this
     
    Last edited: Aug 2, 2019
  12. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    @vladala this thread seems to have been moved to an "External Tools" subforum, but actually Alembic/USD Importers/Exporters are official Unity products. Why has it been moved? "External Tools" makes it sound like it's not really under Unity maintenance.
     
    IS_Twyker likes this.