Search Unity

Alembic Import at Runtime

Discussion in 'Asset Importing & Exporting' started by minoaimino, May 17, 2021.

  1. minoaimino

    minoaimino

    Joined:
    Feb 18, 2015
    Posts:
    3
    I use Alembic for Unity and I want to import alembic file at runtime.
    There is AlembicExporter.cs in Runtime Folder and it allows you to export gameobjects to alembic file at runtime and it works fine.
    But there is no AlembicImporter.cs or something like AlembicExporter.cs.
    (There is AlembicImporter.cs in Editor foldor but it would be for editor)
    There are some files in Runtime/Scripts/Importer, but I couldn't find how to use those files.
    Does anyone know how to import alembic file at runtime?
     
    Last edited: May 17, 2021
  2. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    189
    Hey,

    You are right, there is no AlembicImporter in the Standalone because there is no assetDatabase/prefabs in standalone (the backbone of importers)

    Since 2.2.0(exp/pre/etc) there is a new method on the AlembicStreamPlayer called LoadFromFile that might do what you want. Bare in mind that this workflow has a lot of caveats (no asset dirty notifications, no default materials in standalone: aka magenta geometry unless you reassign mats, etc).

    Hope this helps.
     
  3. aimino

    aimino

    Joined:
    Feb 6, 2015
    Posts:
    6
    Hi vladala,

    I tried RC-2.2.0-pre.4 and LoadFromFile and it's what I just wanted to and it worked perfect!
    Thanks a lot!
     
    marief_unity likes this.