Autodesk / Autodesk/maya-usd

BlendShapes and multiple SkelRoot problem

Open
#4,366 1 comment 0 reactions 1 assignee Claimed by @santosg87 View on GitHub
enhancement
Dominant language
Wolfram Language
Stars
905
Forks
223
Avg merge
2d 9h
Merged PRs (30d)
17

Description

Both commands `mayaUsdDuplicate` and `mayaUsdMergeToUsd` seem to have problems saving blend shape animation when there is more than one `SkelRoot`, or when the `SkelRoot` is not the top primitive.

Image

In this Maya hierarchy, the two transforms `SkelRoot_A` and `SkelRoot_B` are marked as Skeleton Roots (by adding the `USD_typeName` string attribute to them and setting its value to `SkelRoot`).
`Mesh_A` and `Mesh_B` are polygonal meshes, each with one BlendShape.

Now, if I try to right-click on `MainGroup` or even on one of the `SkelRoot_` transforms and choose **Duplicate as USD Data**:

Image

I get this error:

```
pxr.Tf.ErrorException:
Error in 'pxrInternal_v0_22__pxrReserved__::PxrUsdTranslators_MeshWriter::writeBlendShapeAnimation' at line 1084 in file D:\Jenkins\workspace\EMS\ECG\ecg-maya-usd\full\2024-windows\ecg-maya-usd\maya-usd\lib\usd\translators\meshWriterBlendShapes.cpp : 'There was a mismatch in the blendshapes determined and their corresponding weight plugs.'
```

The options used are these:

Image

Note that the error happens with **Skeleton** set to `auto` and `explicit`, while when set to `none` it simply doesn’t export anything (which I understand why, but it would be nice to at least show a message to inform the user).

If I remove the `USD_typeName` attributes, then it works — but `MainGroup` becomes the `SkelRoot`, and the animation of all the blend shapes is merged into a common skeleton.
This is not what I need: `SkelRoot_A` and `SkelRoot_B` are supposed to be independent from each other, even if they live under the same structure.

I have looked up and couldn’t find anything in USD that dictates only one `SkelRoot`, or that a `SkelRoot` has to be the top prim.
In fact, it seems (at least from what I can tell) very common and useful to have multiple `SkelRoot` prims in one stage.

---

## Steps to reproduce

1. Download the provided Maya scene (don’t forget to remove the `.txt` extension).
2. Try the steps explained above.

[blendShapesExport.ma.txt](https://github.com/user-attachments/files/23265087/blendShapesExport.ma.txt)

---

## Expected behavior

A stage with a top prim (an `Xform` in this case) and two `SkelRoot` prims underneath it, each one with its own `Skeleton` and `SkeletonAnimation` to serve the blend shapes of the geometries contained within them.

---

## Specs

- **OS:** Windows 11
- **Maya:** 2024
- **Maya USD official release:** 0.33.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.