Validating files for Reality Composer Pro

To set the stage’s default prim via the UI I believe you need MayaUSD 0.26.0 - see this issue.

image

Good question. I can’t seem to find how to set it through the UI - nor is there an existing MayaUSD Issue about it either. So it could be good to create one and request a way to set the up axis, (or force maya to set it on the root layer?)

For the time being you could set the stage’s up axis via e.g. this Python script. Select the stage shape (or one of its prims) and run this:

from maya import cmds
import mayaUsd
from pxr import UsdGeom


def get_selected_stage():
    for path in cmds.ls(selection=True, ufeObjects=True, long=True):
        proxy = path.split(",", 1)[0]
        stage = mayaUsd.ufe.getStage("|world" + proxy)
        if stage:
            return stage
    raise RuntimeError("No proxy found in selection")


stage = get_selected_stage()
axis: UsdGeom.Tokens = UsdGeom.Tokens.y
print(f"Setting up axis for '{stage.GetRootLayer().GetDisplayName()}' to {axis}")
UsdGeom.SetStageUpAxis(stage, axis)

This only seems to be an issue with the proxy shape layers.
Exporting just a geometry cube does include it, e.g. resulting in:

#usda 1.0
(
    defaultPrim = "pCube1"
    metersPerUnit = 0.01
    upAxis = "Y"
)

def Mesh "pCube1" (
    kind = "component"
)
{
    uniform bool doubleSided = 1
    float3[] extent = [(-0.5, -0.5, -0.5), (0.5, 0.5, 0.5)]
    int[] faceVertexCounts = [4, 4, 4, 4, 4, 4]
    int[] faceVertexIndices = [0, 1, 3, 2, 2, 3, 5, 4, 4, 5, 7, 6, 6, 7, 1, 0, 1, 7, 5, 3, 6, 0, 2, 4]
    point3f[] points = [(-0.5, -0.5, 0.5), (0.5, -0.5, 0.5), (-0.5, 0.5, 0.5), (0.5, 0.5, 0.5), (-0.5, 0.5, -0.5), (0.5, 0.5, -0.5), (-0.5, -0.5, -0.5), (0.5, -0.5, -0.5)]
}

If you include a mayaUsdProxyShape in a “Export selected” in that way but interestingly enough that does not include the contents of the proxy shape by default at all - so isn’t a viable workaround either.

This sounds workflow specific to USDZ files (and maybe even for Reality Composer Pro). I’m not sure what the recommendations are on that front.