How to create a .usdz animation?

Clay picture Clay · Jun 24, 2018 · Viewed 10.9k times · Source

You can now convert 3D models to .usdz files (uncompressed zip archive) using Apple's command line tool bundled with Xcode 10 beta.

Example code to convert an .obj file to .usdz:

xcrun usdz_converter magnifying_glass.obj -g frame magnifying_glass.usdz 
-color_map gold-basecolor.png -normal_map gold-normal.png
-roughness_map gold-roughness.png -metallic_map gold-metallic.png

The following input 3D file types are supported:

  • OBJ file
  • Single-frame Alembic (ABC) file
  • USD file either .usda (ascii) or .usdc (binary)

It's my understanding the OBJ file does not support animation natively.

A single-frame Alembic file won't support animation either as its a single-frame.

So I'm guessing you need to use usda file which link to a sequence of single-frame Alembic or single-frame OBJ files to generate animations.

Is there any Publicly Available documentation on how to go about this?

A usda file can use payload files to reference single-frame meshes. The example below references a Treasure Chest single-frame alembic file geometry.

#usda 1.0

def "Chest_Base" (
     references = [ @./Chest.abc@</Chest_Base> ])
{

}

But I haven't found any concrete way of linking a sequence of .obj or single-framed alembic .abc files together to create say a 10-second animation.

Any help or hint would be greatly appreciated.

Edit 30th June:

I’ve now managed to animate a USDZ file. I’ve got a live demo here of a rotating gears and helicopter.

Basically, I needed to download the usd pipeline from github and build it on my mac. You can get good instructions on how to do that from here

Be warn set aside at least a couple of hours, the build itself takes about an hour.

After that i ran the animated tutorial example in the usd pipeline bundle. Step5.usda (ascii usd file) has an animation example which I followed to create my own animations using rotations.

Running this usdz command will create a simple animation of a spining top if you create the Step5.usda file following the pixar tutorial at the link above.

xcrun usdz_convertor Step5.usda animationTest.usdz

Edit 10th July 2018:

usdz also supports alembic assets (with animations).

I have now managed to get a simple animation working in usdz (using the alembic file format). However, a bone animation on a character I tried didn't work.

I exported Alembic assets with both the Blender & Modo Alembic exporters... same results.

UV materials were also not mapping correctly to the mesh. Something wrong with the uv scaling & mapping... materials come out fragmented. At this stage I don't know if this is a bug, or whether I'm not doing something wrong here. There is some discussion about this uv mapping issue on the Apple forum

Edit 8th Sept 2018:

This is a rapidly evolving area and I'm sure more ways to tackle usdz animation creation will appear over time. However, at present the best & least costly way (open source) to make transform, bone, blend-shape or morph animations usdz files is using a command-line tool hosted on GitHub called glTF2usd.

The tool can convert a glTF animation file into a usda file (the intermediary file type) for creating the usdz file. It should also support direct usdz creation shortly, negating the need to use Apples usdz_converter command line tool to go from usda -> usdz.

Only currently supports 1 animation group. Some bugs still exists regarding rotations, --use-euler-rotation handle can be used to help with smoother rotations.

I've been posting usdz animations I have been creating with the tool to an online usdz gallery www.fusionar.app

Answer

Andy Fedoroff picture Andy Fedoroff · Sep 15, 2018

It just works!

enter image description here

Working with Alembic file format in macOS is the real pain in the back. But I've developed my own method. So, animate your 3D model in Autodesk Maya for Mac (Version 2016 Extension 2 SP 1). Then, bake your animation/dynamics using:

Edit ->  Keys -> Bake Simulation

Check if Alembic module is present in UI via:

Windows -> Settings/Preferences –> Plug-in Manager -> AbcExport.bundle

After that, go to:

Cache –> Alembic Cache -> Export All to Alembic...

This command allows you create abc file. Its playback 25 times slower than it must be but you can fix it in Xcode. So, it's time to convert your animation using Xcode 10 command in Terminal app:

xcrun usdz_converter ~/Desktop/sphere.abc ~/Desktop/anime.usdz -v

enter image description here

You'll get usdz file with the same playback speed (25 times slower).

enter image description here

Let's fix that playback speed in Xcode 10. Create a project, drag-and-drop your usdz file, click Show the Scene Graph View picto and select any animated object from scene's hierarchy (in my case it's pSphere1). In Node Inspector tab change Speed property from 1 to 25. This number depends on your animation software's frame rate setting, actually (24fps, 25fps, 30fps, etc.).

enter image description here

That's it.

enter image description here

Also Jimmy Gunawan published this screen-captured Blender video on Jul 31, 2018. In this video episode, he is taking you through the whole process of exporting transform animations for .usdz via Alembic. He has a procedural transform animation of many objects created using Animation Nodes, exported as animated 3D .usdz file format for Augmented Reality inside iOS 12.

Basically with .usdz animation you need to have root or null object in order for it to export correctly. So watch Jimmy Gunawan's video.

enter image description here

Also, you can export a computer animation in .usdz file format using the following professional 3D tools: Autodesk Maya, The Foundry Katana, or SideFX Houdini. For more detailed information visit this Pixar's webpage.