Validating files for Reality Composer Pro

I’d like to make sure I’m validating all my USD Files, and I want to understand how to set these in Maya. The following USD asset appears to import and work well in Reality Composer Pro, but I wanted to check the following failures from running usdchecker

> usdchecker shaderBall_2023_maya_v3.usdc  --arkit                      
Stage does not specify an upAxis. (fails 'StageMetadataChecker')
Stage has missing or invalid defaultPrim. (fails 'StageMetadataChecker')
The stage uses 3 layers. It should contain a single usdc layer to be compatible with ARKit's implementation of usdz. (fails 'ARKitRootLayerChecker')
Failed!
  • upAxis - this seems to be set when exporting from Blender, but not from Maya.
  • missing or invalid defaultPrim - I’m not clean on what need to be done correct this
  • uses 3 layers - how much of a concern is this? I imagine I’m doing to need multiple layers in my scenes.

I can edit the upAxis and probably others directly in the USD Files, but I wanted to see if there was something else I should considering when creating these assets in Maya.

Of note, I had another error when using a .usda file (“missing linear scale”, which is in one of the sub layers) but it went away when converting to a .usdc. I assume this is expected.

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.

1 Like

@BigRoyNL thanks for this, I’ll give these steps a try this week. I appreciate you sharing that script!

I’m not in front of Maya at the moment, but I have 2024.2 installed. I have been having issues getting MayaUSD running, and I’m blocked with building openUSD on a Silicon mac. I’ve posted a comment on their forums here, but I’m not sure whether it’s a me thing, or a them thing.

Any reason you’re not just trying to use one of the releases: Releases · Autodesk/maya-usd · GitHub ?

I have been having issues getting MayaUSD running

Could you elaborate on these issues? Is it USD building issues? Or maya USD specific issues? If the latter, those issue reports can best go to the maya usd repository.

This is actually an extraneous test today. I’ll put up a PR soonish to remove some of the older tests that aren’t relevant anymore.

1 Like

Also, I’m sure the case where Maya is not authoring upAxis is just an oversight - would you report it on their UsdMaya developer forums?

PR to update the checker for ARKit is here Cleanup arkit checks by dgovil · Pull Request #2863 · PixarAnimationStudios/OpenUSD · GitHub

Reported here: Saving layers/stage from MayaUsdProxyShape does not author Up Axis · Issue #3510 · Autodesk/maya-usd · GitHub

@dhruvgovil Thanks for that quick update to the checker!

@BigRoyNL … the reason is that I did not know it was an option. Thank you! I’m still finding my way here. And thanks for reporting the upAxis issue.

However, I don’t see how to install this for 2024.2. I have run through the install process, and Maya looks to be still picking up 0.25. I can see 0.26 is installed for 2022. I don’t see any options in the installer, and I have never used Maya 2022 on this machine. I’ll post this also on the mayaUSD repo.

@CampbellMcG that looks to me like you picked the highest/top Mac OS version from the release list - which is the installer for Maya 2022. You should pick the lower one (click “Show all assets”) and pick the one relevant for Maya 2024.2.

It should be this one

Yep. That’s exactly what I did :man_facepalming:t2:
Everything is working as it should. Thanks for your help and patience!