Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Missing alembic streaming assets.

Discussion in 'Formats & External Tools' started by kyip2, Feb 25, 2019.

  1. kyip2

    kyip2

    Joined:
    Jul 10, 2018
    Posts:
    12
    Hope somebody can help,

    Since 1.0.0-preview 8 of the alembic package the copy of abc files to the StreamingAssets folder on import was removed. This seems to cause a problem for a standalone player which loads scene asset bundles that reference alembic assets. Where are the alembic animations live streamed from, if not abc files in the StreamingAssets folder? The problem might stem from the fact I don't reference these scenes in the 'Build Settings | Scenes in Build' dialog since I load them from bundles. Therefore the player isn't including these abc assets?
     
  2. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    96
    Hey,

    Before you had all your assets copied in double: Assets and StreamingAssets. This was a workflow that made a lot of people unhappy because of the multigig bloat. For this we decided to support the Editor workflow first and fix the standalone version properly in a later version (very soon).
    Currently you will be able to build a standalone, but this standalone will reference the assets version, so it will work, but your app will not be redistributable. If this is a big issue short term with some headache you can implament your own prebuildstep that copies all assets in StreamingAssets and does a path translation to point to these assets.

    Hope this help.
     
  3. kyip2

    kyip2

    Joined:
    Jul 10, 2018
    Posts:
    12
    I can just stick with preview-7 for now. Just wanted to know what your plans were because I have scenes that reference alembic assets but those scenes are in asset bundles (one scene per bundle). The scenes are not referenced in Build Settings | Scenes in Build. My concern is where will the alembic files be livestreamed from? Hopefully this workflow was anticipated for standalone and isn't a deal breaker?

     
  4. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    96
    So far alembics need an actual file on disk to function. If you are able to "extract" your bundle locally it could work in theory. Streaming directly from the bundle will not work.
    Hope this helps.
     
  5. Ben-Kuper

    Ben-Kuper

    Joined:
    Aug 31, 2012
    Posts:
    16
    Hello,
    I'm having the same problem with package 1.0.3, works well in editor, and I can see a StreamingAsset copied in the build folder but the file won't play in standalone.. do you have an ETA on that ? thank you
     
  6. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    96
    Could you please make a debug standalone build and and give me the error message?

    I have seen in the past that standalone builds fail to run properly with something like "Serialization size changed, ....". An easy way to fix is to delete the Library Folder. I have yet to find repro steps for this problem.
     
  7. Temy_chan

    Temy_chan

    Joined:
    Dec 21, 2017
    Posts:
    1
    Hi! I'm dealing with the same problem.

    I'm using .abc files that work perfectly at the Editor. However, whenever I try to build the application, both the assets folder and the stream asset folder are not generated.

    Thus, the elements that depend on these files are no longer displayed. I don't know what to do :(
     
  8. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    96
    Hey,

    What platform are you trying to build your app on? It should work on Windows and OS X.
    If not it's a bug and I'll be glad to look at it.

    Vlad
     
  9. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    719
    Hello there,

    I also have the problem, that the alembics are missing in the build. I was able to create an easy repro: https://github.com/JohannesDeml/UnityAlembicSpawningError

    TL;DR: When instantiating Alembics via `GameObject.Instantiate()` the alembic files will not be included in the build.

    For others searching for the problem, here is the error:
    Code (CSharp):
    1. failed to load alembic at C:/AlembicSpawning/Builds/AlembicSpawningProblem/AlembicSpawningProblem_Data/StreamingAssets\Assets/_Project/Meshes/Cube.abc
    2. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    3. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    4. UnityEngine.Logger:Log(LogType, Object)
    5. UnityEngine.Debug:LogError(Object)
    6. UnityEngine.Formats.Alembic.Importer.AlembicStream:AbcLoad(Boolean, Boolean) (at C:\AlembicSpawning\Library\PackageCache\com.unity.formats.alembic@1.0.5\Runtime\Scripts\Importer\AlembicStream.cs:149)
    7. UnityEngine.Formats.Alembic.Importer.AlembicStreamPlayer:LoadStream(Boolean) (at C:\AlembicSpawning\Library\PackageCache\com.unity.formats.alembic@1.0.5\Runtime\Scripts\Importer\AlembicStreamPlayer.cs:75)
    8. UnityEngine.Formats.Alembic.Importer.AlembicStreamPlayer:OnEnable() (at C:\AlembicSpawning\Library\PackageCache\com.unity.formats.alembic@1.0.5\Runtime\Scripts\Importer\AlembicStreamPlayer.cs:137)
    9. UnityEngine.Object:Internal_CloneSingleWithParent(Object, Transform, Boolean)
    10. UnityEngine.Object:Instantiate(Object, Transform, Boolean) (at C:\buildslave\unity\build\Runtime\Export\Scripting\UnityEngineObject.bindings.cs:255)
    11. UnityEngine.Object:Instantiate(GameObject, Transform, Boolean) (at C:\buildslave\unity\build\Runtime\Export\Scripting\UnityEngineObject.bindings.cs:291)
    12. UnityEngine.Object:Instantiate(GameObject, Transform) (at C:\buildslave\unity\build\Runtime\Export\Scripting\UnityEngineObject.bindings.cs:286)
    13. SpawnPrefab:InstantiatePrefab() (at C:\AlembicSpawning\Assets\_Project\Scripts\SpawnPrefab.cs:19)
    14. SpawnPrefab:Start() (at C:\AlembicSpawning\Assets\_Project\Scripts\SpawnPrefab.cs:12)
    Let me know if there is any other information you need to pinpoint the bug. :)
     
  10. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    96
    Thanks a bunch for the info. This is the best bug report I received in my life (Were you a QA in a previous life? :) ).
    The problem you are facing is that all alembics need to be referenced in the built scenes when the build is triggered. The copy to the app StreamingAssets and Alembic path translation happens as a PreBuildStep Callback. This clearly fails if you dynamically spawn alembics at runtime.
    The way I see it, you have 2 choices:
    1)Add all the prefabs in the scene and disable them and enable on demand as needed instead of spawning
    2)You can implement your own build pre/post step to suit your needs. An example of mine can be found here: https://github.com/unity3d-jp/Alemb...ic/Editor/Importer/AlembicBuildPostProcess.cs
    You will have to do some reflection to access the Alembic internals unfortunately.

    Hope this helps.
     
  11. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    719
    Thanks for the quick response. Hahaha, thanks for appreciating my report, I know how annoying it is to get little to no information on what the problem is or where it might come from.

    Alright, that's something I can work with. I made a small little util that copies files and folders to the data folder of a build as as post build step:

    upload_2019-7-23_19-6-59.png

    Source Code: https://github.com/JohannesDeml/Uni...t/Scripts/Editor/CopyFilesPostProcessBuild.cs

    The file Should be copied to an Editor Folder. After one build the Scriptable Object appears in "Assets/Editor Default Resources".

    This solution is not that automatic, but quite flexible.

    Just out of interest: There is no problem for other assets like .fbx to be included in the build when they are not referenced in the scene. Why does this problem occur for .abc files? Sorry If you already gave the answer to that question.
     
    mekartikshah likes this.
  12. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    96
    The difference between ABC and and FBX is that FBX is fully imported into Unity, where as ABCs are streamed from the original file.
     
  13. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    719
    Makes sense. Thanks a lot for the help, hadn't had any problems with building through the post build adding fix :)
     
  14. jleemans

    jleemans

    Joined:
    Apr 22, 2020
    Posts:
    18
    I have this error in standalone too.
    Is it possible that alembics and Adressables have some issues.
    I have a prefab that is adressables, once I load it and display it, I have the error that the alembic cant be stream.
    The alembics file is only referenced by this prefab.

    I try too add alembics files on a side map to be cooked..
    Alembics file seems to show now in StreamIngAsset folder, but the loaded prefab still have the error.
     
  15. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    96
    A bit hard to reply to the cause of the problem.
    Not sure it's relevant, but the prefab has to be instantiated in one of the built scenes for it to be copied into StreamingAssets folder, and the internal paths to be redirected to this copy (there is a build post processor that runs and makes sure apps are redistributable)
     
  16. jleemans

    jleemans

    Joined:
    Apr 22, 2020
    Posts:
    18
    Indeed after some test, the alembic must be in the scene to work.
    Even without adressable, just a hard reference to a prefab that is instanciated doesnt work.
     
unityunity