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

Bug exporting instances? #4073

Open
magost opened this issue Jan 14, 2025 · 1 comment
Open

Bug exporting instances? #4073

magost opened this issue Jan 14, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@magost
Copy link

magost commented Jan 14, 2025

When trying to export a Maya node which has instances it looks like the resulting file is wrong when using the kwarg "exportRoots".
To test, you can create an scene with the code below:

import maya.cmds as cmds
s = cmds.sphere(r=10, name="instance")
lod_group = cmds.group(name="my_lod")
asset_group = cmds.group(name="my_asset")
for i in range(5):
    inst = cmds.instance([s[0]], name=f"{s[0]}_{i}")
    cmds.move(25 * (i + 1), 0, 0, inst[0])

Once you have the scene, export it with the following command:

cmds.mayaUSDExport(
    asset_group, file="/tmp/instances_exportRoots.usda", exportDisplayColor=True,
    kind="group", shadingMode="useRegistry", defaultPrim=lod_group,
    convertMaterialsTo=["UsdPreviewSurface"], exportInstances=True,
    exportCollectionBasedBindings=False, mergeTransformAndShape=True,
    exportRoots=lod_group,
)

You can see that the resulting file does not have the geometry in it.
If now you try to run the command above without the "exportRoots" kwarg you will see that the resulting file has the proper geometry:

cmds.mayaUSDExport(
    asset_group, file="/tmp/instances_no_exportRoots.usda", exportDisplayColor=True,
    kind="group", shadingMode="useRegistry", defaultPrim=lod_group,
    convertMaterialsTo=["UsdPreviewSurface"], exportInstances=True,
    exportCollectionBasedBindings=False, mergeTransformAndShape=True,
)

Am I missing something here? Is this, for some reason, the expected behavior?

Thanks!

Specs:

  • CentOS 7
  • Maya 2023
  • maya-usd/0.30
@magost magost added the bug Something isn't working label Jan 14, 2025
@wallworm
Copy link
Collaborator

Thanks for reporting. We'll look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants