Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export partial Maya joint hierarchy to USD as Skeleton prims #3596

Closed
NickWu opened this issue Feb 6, 2024 · 3 comments
Closed

Export partial Maya joint hierarchy to USD as Skeleton prims #3596

NickWu opened this issue Feb 6, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@NickWu
Copy link

NickWu commented Feb 6, 2024

Is your feature request related to a problem? Please describe.
Hi, we couldn't find a way to export a subset of Maya joint hierarchy. I know we can use -exportRoots argument to mayaUSDExport command to export a subset of nodes from Maya to USD but this seems not working with joints exporting. When exporting with Maya joints, we need to use -exportSkels otherwise joints won't be exported. This works when you are exporting a whole hierarchy, however, it doesn't work if you just want to export a subset of the hierarchy which requires -exportRoots argument because it would error when using -exportRoots and -exportSkels together. Please see the example below.

Given a hierarchy with a mesh and a joint:

Screenshot 2024-02-05 at 16 44 28

Run the following command to export nodes that are under "parent" and "jointsGrp" group nodes.

cmds.mayaUSDExport(
    f="partialNodes.usda", sl=False, worldspace=True,  stripNamespaces=True,
    exportRoots=("parent", "jointsGrp"), shadingMode="none"
)

If we open the exported file In the usdview, you will see that mayaUSDExport command is able to export nodes that are under "parent", but for node that is under "jointsGrp", it cannot, because it's a Maya joint.

Screenshot 2024-02-05 at 17 03 29

Let's try to export joints with -exportSkels . Run the following code to export joints:

cmds.select("parent", "jointsGrp")
cmds.mayaUSDExport(
    f="joints.usda", sl=True, worldspace=True,  stripNamespaces=True,
    shadingMode="none",
    exportSkels="auto"
)

If you open the exported file in usdview, you will see that joints are exported successfully along with all of its parent nodes:

Screenshot 2024-02-05 at 17 08 10

If we try to use -exportSkels and -exportRoots together to only export the joints under the specified nodes by running the following command:

cmds.select("parent", "jointsGrp")
cmds.mayaUSDExport(
    f="jointsUnderSpecifiedNode.usda", sl=True, worldspace=True,  stripNamespaces=True,
    exportRoots=("parent", "jointsGrp"), 
    shadingMode="none",
    exportSkels="auto"
)

We will get errors saying # Error: RuntimeError: file <string> line 2: Maya command error

Describe the solution you'd like
We'd like to export a subset of nodes that are Maya joints (exclude its parent nodes) under a hierarchy to USD as Skeleton prims. It would be great if -exportSkels argument can work together with -exportRoots argument to achieve this.

Describe alternatives you've considered
If this is not supported currently then I'd like to know if there is a plan to support this in future.

@NickWu NickWu added the enhancement New feature or request label Feb 6, 2024
@wallworm
Copy link
Collaborator

wallworm commented Feb 7, 2024

Thanks for sharing. We will discuss this on the team.

@barbalt
Copy link
Collaborator

barbalt commented May 23, 2024

Closing issue as it has been addressed by #3681

@barbalt barbalt closed this as completed May 23, 2024
@dilenshah23
Copy link

Has this been resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants