# USD Clips

This guide focuses on how to handle "file-per-frame" sequences of USD files (Alembic files are supported too) by using "USD Clips". In a nutshell, if you have a sequence of USD or ABC files, you can create USD Clips directly from the Multiverse Read shelf button.

File-per-frame usd/abc sequences have strict frame padding requirements, they must be padded with the frame number contained between dots, e.g:

example (start ... end frame) Valid? Why
file.001.ext ... file.999.ext Yes
file.0001.ext ... file.9999.ext Yes
file.1.ext ... file.9.ext Yes
file.1.ext ... file.10.ext NO Because the padding has two digits from frame 10
file.01.ext ... file.10.ext Yes
file_001.ext ... file_999.ext NO Because frames are not wrapped by dots
file_001_seq.ext ... file_999_seq.ext NO Because frames are not wrapped by dots

# Basic Concepts

Complex simulations such as oceans, particles, fractures, rigid bodies, or even heavy animated deforming assets represent heavy data in a pipeline.

Writing all such data in single USD or Alembic files has the following issues:

  • it cant be parallelized on multiple machines
  • it can be very time consuming
  • it will produce assets that may be too heavy to pass around in a production environment due to their file size.
  • changing only some part of the sequence will require an entire rewrite
  • when batching the rendering of a sequence across different nodes in your farm each node will need the whole asset (instead of only the needed frames).

Writing them as a "frame-by-frame" USD or Alembic file sequence solves all these issues at once.

Typically, file-per-frame sequences of USD or ABC files are generated from Houdini / Solaris, then in Maya / Multiverse we can create a USD Clip for the sequence. It is also possible to generate the USD clip from Houdini, as we explain at the bottom of this document, but Multiverse offers a much more friendly way to do so in Maya where you are likely to consume the data anyway.

TIP

Make sure your file-per-frame sequences are equally padded and have the frame number between dots. See the "Requirement" in the first section of this doc.

# Practical Example

In this example we are showing to write an animation sequence from Houdini and read it back as a USD Clip in Maya using Multiverse.

In Houdini we use the "crag" animation that comes with the Houdini installation: we simply output it as file sequence by turning on "Separate File Per Frame".

After finished to write out the files, we read them back into Maya via the Multiverse Read shelf button. When we browse to the folder where the files were written and select any file of the sequence, the UI to Generate USD or ABC Sequence UI will be un-grayed: here we can define the Start/End of the sequence and the file name of the USD Clip that we want to generate.

We should be able to see info message below the Generate USD Clip button. Any error or warning will be displayed here. For now let’s create a clip with default options for this example.

We can also keep the dialog open and generate multiple clips with different frame range as well.

The USD clip is written in the same folder after that selecting the resulting clip and read them back in Maya should be the same as reading any USD asset. Note that you are also able to create clips from Alembic sequence as well.

The process of generating a USD clip will actually produce three files (in addition to the file-per-frame sequence you already have):

  • the clip file itself
  • the topology file
  • the manifest file

The topology and manifest files are not meant to be read directly in the Compound in any way, they are instead used by the main clip file when the clip is read.

Important

Because the clip manifest and topology files are generated by the USD libraries through an "in memory" process at runtime, it is possible for the USD library to go "out of memory" when generating the clip if your sequence data is very large and/or you are generating a clip for many frames.

Until this is not improved in USD itself we provide you with some workarounds, both in Multiverse for Maya and in Houdini.

Read this tip to learn how to write clips without going out of memory both in Multiverse for Maya and Houdini.

# Writing clips from CMD / Terminal

You can also write clip files for your sequences from the command line.

# On Linux & macOS

/path/to/maya/bin/mayapy /path/to/multiverse/bin/usdstitchclips -t mysequence.####.usd -s 1 -e 96 -c /path/to/prim -o clipfilename.usda mysequence.*.usd
1

This will generate three files:

  • clipfilename.usda which is the file you can read
  • clipfilename.topology.usda which is the topology file (used by the former)
  • clipfilename.manifest.usda which is the manifest file (used by the foremost)

# On Windows

On Windows things are more complicated since usdstitchclip does not resolve the * wildcard, therefore we provide a magic script that does the magic for you:

@echo off
setlocal enabledelayedexpansion
set params=
for /f "delims=" %%a in ('dir /s/b C:\path\to\mysequence.*.usd') do set params=!params! %%a
call usdstitchclips -t mysequence.####.usd -s 1 -e 96 -o C:\path\to\clipfilename.usda -c /path/to/prim %params%
1
2
3
4
5

If you need to know more refer to the USD documentation (opens new window).

Last Updated: 6/23/2022, 3:27:58 PM