Cannot export root prim with assembly kind if there are non-component gprim descendants
- Dominant language
- Wolfram Language
- Stars
- 905
- Forks
- 223
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 17
Description
**Bug description**
When exporting a hierarchy containing gprims with Maya USD and the `kind=assembly` argument, there is the following error:
```
Error: has kind 'assembly', which is derived from 'assembly'. Assemblies should not directly contain meshes/gprims.
```
I understand that conceptually a USD assembly should *typically* contain component prims or nested assembly prims, but nothing prevents having gprims directly under an assembly prim in pure USD, and considering that the code raising this error was written in 2016, I was wondering if this was a legacy behavior that should not be enforced anymore.
Funnily, I can get around this behavior by using the relatively new `disableModelKindProcessor=true` argument and adding a `USD_kind` attribute set to "assembly" on the root Maya node. I can also set the `kind` argument in the export command to any arbitrary value, and nothing enforces the kind that I've set to be a valid registered kind value. This makes me think that the error might be legacy behavior, and could simply be removed.
Conceptually, I think it would make more sense for Maya to not validate the kind in any way, and rather leave that responsibility to the users, especially considering that USD itself supports having an "assembly" kind with gprims underneath.
**Steps to reproduce**
1. In Maya, create an empty group called "root".
2. Create a mesh node (e.g. a polygon cube) and parent it to the "root" node.
3. Select the "root" group node.
4. Export the "root" group node to USD using the following MEL export command in the Maya script editor:
```
file -force -options "kind=assembly;defaultUSDFormat=usda;" -typ "USD Export" -es "/your/export/usd/file.usda";
```
5. Notice the following error:
```
Error: has kind 'assembly', which is derived from 'assembly'. Assemblies should not directly contain meshes/gprims. Please remove 1 prim: /root/pCube1 //
```
**Expected behavior**
I would expect Maya USD to let us export root prims that have the "assembly" kind (and any kind for that matter) and that contain gprims that are not under a "component" kind prim, considering that USD itself allows it.
**Specs (if applicable):**
- Maya version: 2022.3
- Maya USD version: 0.19.0
**Additional context**
The code raising an error is in `maya-usd/lib/mayaUsd/fileio/jobs/modelKindProcessor.cpp` line 194.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.