Skip to content

load usd variants through Maya reference editor #4605

Description

@ralphmeijercg

Describe the bug
I'm building a small tool which prompts the user when referencing a usd with variants to the maya reference editor. The idea behind this is to be able to create separate rigs for each possible variant. When using the reference editor ui you have the ability to select the specific variant. But through code with the correct arguments it somehow doesn't come through.

Steps to reproduce
Steps to reproduce the behavior:

  1. create a usd prim with variants
  2. in the script editor create a function that references the usd to the reference editor:

import maya.cmds as cmds

filepath = "path to usd"
cmds.file(filepath, type= "USD Import", reference=True, options="unit=False;primVariant=['{/primpath}', '{variantSet}', '{variant}']")

Expected behavior
The usd file should be referenced to the reference editor with the correct variant.

When using the cmds.mayaUSDImport command with these arguments it does properly work.

Not sure if this workflow is even supported/advised in the first place. But we're used to work this way with referencing Alembics and figured the same should theoretically work for USD.

Specs (if applicable):

  • Rocky 9.5
  • Maya2026
  • MayaUsd 0.3.4

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions