**Edit As Maya Data** doesn't take "proxyPrim relationship" into account
- Dominant language
- Wolfram Language
- Stars
- 905
- Forks
- 223
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 17
Description
**Describe the bug**
When executing `mayaUsdEditAsMaya` on a prim that has a **proxyPrim relationship**, it still translates both proxyPrim and RenderPrim instead of just proxyPrim.
**Steps to reproduce**
1. Load the attached "proxyPrimExample.usda" file with mayaUsdProxyShape. Now you should only see a low res mesh showing up in the viewport.

From the outliner, you can see the **group** prim has two children groups - **GEO** and **GEO_PROXY**. The prim **/group/GEO/pCube1** representing the render mesh whereas the prim **/group/GEO_PROXY/pCube1** representing the proxy mesh. You will notice that the viewport is only showing **/group/GEO_PROXY/pCube1** even though **/group/GEO_PROXY/pCube1** is also active. This is because the **preview** variant set we are currently on authors a **proxyPrim relationship** opinion on **/group/GEO** which is pointing to **/root/GEO_PROXY**
```
variantSet "geo_vis" = {
"default" {
}
"preview" {
over "GEO"
{
rel proxyPrim =
uniform token purpose = "render"
}
def Xform "GEO_PROXY" (
payload = @meshProxy.usda@
)
{
uniform token purpose = "proxy"
}
}
}
```
This effectively sets up a proxy/render Imageable Purpose relationship as described in USD doc here https://openusd.org/release/api/class_usd_geom_imageable.html#a5be4a4143e2b9f89f9bea44d27639a92, https://openusd.org/release/api/class_usd_geom_imageable.html#ad5a114f3776eb75edc651e8c2d67f8ff and https://openusd.org/release/api/usd_geom_page_front.html#UsdGeom_ImageablePurpose. That's why we only seeing **/group/GEO_PROXY/pCube1** in the viewport.
2. You can right click on the **group** prim and go **Variant Sets -> geo_vis -> default** to switch it to a render mesh mode. You can see **/group/GEO_PROXY** is gone as a result of switching to **default** variant set. And now we can see the **/group/GEO/pCube1** showing up in the viewport now.

3. Let's switch the **geo_vis** variant set back to **preview**, and now we are back to only seeing **/group/GEO_PROXY/pCube1** in the viewport but having both **/group/GEO** and **/group/GEO_PROXY** existed. Rick-click on the **/group** prim in Outliner and select **Edit As Maya Data**. You will see both **/group/GEO/pCube1** and **/group/GEO_PROXY/pCube1** are being translated to Maya and you can see both prims in the viewport instead of just **/group/GEO_PROXY/pCube1**. This suggests that **Edit As Maya Data** doesn't really take "proxyPrim relationship" into account.


**Expected behavior**
**Edit As Maya Data** should take "proxyPrim relationship" into account so that we get consistent prim display experience between prims in proxy shape and when translated into Maya.
**Attachments**
proxyPrimExample.usda
```
#usda 1.0
(
)
def Xform "group"
(
prepend variantSets = "geo"
variants = {
string geo = "render_high"
string geo_vis = "preview"
}
)
{
def Xform "GEO"
{
}
variantSet "geo" = {
"base" {
over "GEO" (
payload = @meshRender.usda@
)
{
}
}
"render_high" (
prepend variantSets = "geo_vis"
) {
over "GEO" (
payload = @meshRender.usda@
)
{
}
variantSet "geo_vis" = {
"default" {
}
"preview" {
over "GEO"
{
rel proxyPrim =
uniform token purpose = "render"
}
def Xform "GEO_PROXY" (
payload = @meshProxy.usda@
)
{
uniform token purpose = "proxy"
}
}
}
}
}
}
```
meshProxy.usda
```
#usda 1.0
(
defaultPrim = "root"
)
def Xform "root"
{
def Mesh "pCube1"
{
float3[] extent = [(-0.5, -0.5, -0.5), (0.5, 0.5, 0.5)]
int[] faceVertexCounts = [4, 4, 4, 4, 4, 4]
int[] faceVertexIndices = [0, 1, 3, 2, 2, 3, 5, 4, 4, 5, 7, 6, 6, 7, 1, 0, 1, 7, 5, 3, 6, 0, 2, 4]
point3f[] points = [(-0.5, -0.5, 0.5), (0.5, -0.5, 0.5), (-0.5, 0.5, 0.5), (0.5, 0.5, 0.5), (-0.5, 0.5, -0.5), (0.5, 0.5, -0.5), (-0.5, -0.5, -0.5), (0.5, -0.5, -0.5)]
}
}
```
meshRender.usda
```
#usda 1.0
(
defaultPrim = "root"
)
def Xform "root"
{
def Mesh "pCube1"
{
float3[] extent = [(-0.5, -0.5, -0.5), (0.5, 0.5, 0.5)]
int[] faceVertexCounts = [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]
int[] faceVertexIndices = [0, 50, 74, 53, 50, 1, 51, 74, 74, 51, 4, 52, 53, 74, 52, 3, 1, 54, 75, 51, 54, 2, 55, 75, 75, 55, 5, 56, 51, 75, 56, 4, 3, 52, 76, 59, 52, 4, 57, 76, 76, 57, 7, 58, 59, 76, 58, 6, 4, 56, 77, 57, 56, 5, 60, 77, 77, 60, 8, 61, 57, 77, 61, 7, 6, 58, 78, 64, 58, 7, 62, 78, 78, 62, 10, 63, 64, 78, 63, 9, 7, 61, 79, 62, 61, 8, 65, 79, 79, 65, 11, 66, 62, 79, 66, 10, 9, 63, 80, 69, 63, 10, 67, 80, 80, 67, 13, 68, 69, 80, 68, 12, 10, 66, 81, 67, 66, 11, 70, 81, 81, 70, 14, 71, 67, 81, 71, 13, 12, 68, 82, 26, 68, 13, 72, 82, 82, 72, 16, 73, 26, 82, 73, 15, 13, 71, 83, 72, 71, 14, 27, 83, 83, 27, 17, 28, 72, 83, 28, 16, 15, 73, 84, 31, 73, 16, 29, 84, 84, 29, 19, 30, 31, 84, 30, 18, 16, 28, 85, 29, 28, 17, 32, 85, 85, 32, 20, 33, 29, 85, 33, 19, 18, 30, 86, 36, 30, 19, 34, 86, 86, 34, 22, 35, 36, 86, 35, 21, 19, 33, 87, 34, 33, 20, 37, 87, 87, 37, 23, 38, 34, 87, 38, 22, 21, 35, 88, 40, 35, 22, 39, 88, 88, 39, 1, 50, 40, 88, 50, 0, 22, 38, 89, 39, 38, 23, 41, 89, 89, 41, 2, 54, 39, 89, 54, 1, 23, 37, 90, 43, 37, 20, 32, 90, 90, 32, 17, 42, 43, 90, 42, 24, 2, 41, 91, 55, 41, 23, 43, 91, 91, 43, 24, 44, 55, 91, 44, 5, 24, 42, 92, 45, 42, 17, 27, 92, 92, 27, 14, 70, 45, 92, 70, 11, 5, 44, 93, 60, 44, 24, 45, 93, 93, 45, 11, 65, 60, 93, 65, 8, 18, 36, 94, 31, 36, 21, 46, 94, 94, 46, 25, 47, 31, 94, 47, 15, 21, 40, 95, 46, 40, 0, 53, 95, 95, 53, 3, 48, 46, 95, 48, 25, 15, 47, 96, 26, 47, 25, 49, 96, 96, 49, 9, 69, 26, 96, 69, 12, 25, 48, 97, 49, 48, 3, 59, 97, 97, 59, 6, 64, 49, 97, 64, 9]
point3f[] points = [(-0.38888893, -0.38888893, 0.38888893), (0, -0.4375, 0.4375), (0.38888893, -0.38888893, 0.38888893), (-0.4375, 0, 0.4375), (0, 0, 0.5), (0.4375, 0, 0.4375), (-0.38888893, 0.38888893, 0.3888889), (0, 0.4375, 0.4375), (0.38888893, 0.38888893, 0.38888893), (-0.4375, 0.4375, 0), (0, 0.5, 0), (0.4375, 0.4375, 0), (-0.38888893, 0.3888889, -0.38888893), (0, 0.4375, -0.4375), (0.38888893, 0.38888893, -0.38888893), (-0.4375, 0, -0.4375), (0, 0, -0.5), (0.4375, 0, -0.4375), (-0.38888893, -0.38888893, -0.3888889), (0, -0.4375, -0.4375), (0.38888893, -0.38888893, -0.38888893), (-0.4375, -0.4375, 0), (0, -0.5, 0), (0.4375, -0.4375, 0), (0.5, 0, 0), (-0.5, 0, 0), (-0.4375, 0.25, -0.4375), (0.4375, 0.25, -0.4375), (0.25, 0, -0.5), (0, -0.25, -0.5), (-0.25, -0.4375, -0.4375), (-0.4375, -0.25, -0.4375), (0.4375, -0.25, -0.4375), (0.25, -0.4375, -0.4375), (0, -0.5, -0.25), (-0.25, -0.5, 0), (-0.4375, -0.4375, -0.25), (0.4375, -0.4375, -0.25), (0.25, -0.5, 0), (0, -0.5, 0.25), (-0.4375, -0.4375, 0.25), (0.4375, -0.4375, 0.25), (0.5, 0, -0.25), (0.5, -0.25, 0), (0.5, 0, 0.25), (0.5, 0.25, 0), (-0.5, -0.25, 0), (-0.5, 0, -0.25), (-0.5, 0, 0.25), (-0.5, 0.25, 0), (-0.25, -0.4375, 0.4375), (0, -0.25, 0.5), (-0.25, 0, 0.5), (-0.4375, -0.25, 0.4375), (0.25, -0.4375, 0.4375), (0.4375, -0.25, 0.4375), (0.25, 0, 0.5), (0, 0.25, 0.5), (-0.25, 0.4375, 0.4375), (-0.4375, 0.25, 0.4375), (0.4375, 0.25, 0.4375), (0.25, 0.4375, 0.4375), (0, 0.5, 0.25), (-0.25, 0.5, 0), (-0.4375, 0.4375, 0.25), (0.4375, 0.4375, 0.25), (0.25, 0.5, 0), (0, 0.5, -0.25), (-0.25, 0.4375, -0.4375), (-0.4375, 0.4375, -0.25), (0.4375, 0.4375, -0.25), (0.25, 0.4375, -0.4375), (0, 0.25, -0.5), (-0.25, 0, -0.5), (-0.25, -0.25, 0.5), (0.25, -0.25, 0.5), (-0.25, 0.25, 0.5), (0.25, 0.25, 0.5), (-0.25, 0.5, 0.25), (0.25, 0.5, 0.25), (-0.25, 0.5, -0.25), (0.25, 0.5, -0.25), (-0.25, 0.25, -0.5), (0.25, 0.25, -0.5), (-0.25, -0.25, -0.5), (0.25, -0.25, -0.5), (-0.25, -0.5, -0.25), (0.25, -0.5, -0.25), (-0.25, -0.5, 0.25), (0.25, -0.5, 0.25), (0.5, -0.25, -0.25), (0.5, -0.25, 0.25), (0.5, 0.25, -0.25), (0.5, 0.25, 0.25), (-0.5, -0.25, -0.25), (-0.5, -0.25, 0.25), (-0.5, 0.25, -0.25), (-0.5, 0.25, 0.25)]
}
}
```
**Specs (if applicable):**
- OS & version: CentOS 7.8
- Compiler & version: GCC 9.3.1
- Maya version: Maya-2023.2.0-11.0.PFIX
- Maya USD commit SHA: https://github.com/Autodesk/maya-usd/commit/65233c860aa813e90b9661f8be77b83b3e258328
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.