-
Notifications
You must be signed in to change notification settings - Fork 203
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
MAYA-112227 - UV set renamed to st, st1, st2 #1528
Conversation
Implements automatic UV set renaming. - The sets will be renamed st, st1, st2, st3,... in the order they are found in the mesh. - The original name will be stored in custom data for roundtripping - On import, the names will always be restored if the roundtripping information is found - On import, the UV sets are restored in the same order as found in the USD primitive - The environment variables MAYAUSD_IMPORT_PRIMARY_UV_SET_AS_MAP1 and MAYAUSD_EXPORT_MAP1_AS_PRIMARY_UV_SET were removed as their functionnality is subsumed in the global renaming. Caveat: If you have a mesh with multiple UV sets, and a UV set named "map1" is not the first UV set, then it will not automatically be renamed "st" as was previously the case using MAYAUSD_EXPORT_MAP1_AS_PRIMARY_UV_SET. We expect these cases to be quite rare, but if you have post-processing scripts that are expecting "st" and scenes where "map1" is not the first UV sets; then the results at the other end of the post-processing pipeline will be different.
@@ -148,7 +173,7 @@ createNode transform -n "pPlane3"; | |||
rename -uid "A9516DAE-46FB-C555-7036-F5BFA863699B"; | |||
setAttr ".t" -type "double3" 2.4 0 0 ; | |||
setAttr ".r" -type "double3" 89.999999999999986 0 0 ; | |||
createNode mesh -n "pPlaneShape3" -p "pPlane3"; | |||
createNode mesh -n "pPlane3" -p "|pPlane3"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dgovil , @ysiewappl This makes the shape name identical to the transform name and makes sure the code in _UVMappingManager is still correctly handling that situation.
("/pPlane5", "/blinn1SG_p5a_p5b_p5c", "p5a", "p5b", "p5c"), | ||
("/pPlane6", "/blinn1SG_p62_p63_p61", "p62", "p63", "p61"), | ||
("/pPlane7", "/blinn1SG_p7r_p7p_p7q", "p7r", "p7p", "p7q"), | ||
("/pPlane1", "/blinn1SG", "st", "st", "st"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The automatic renaming does reduce the number of specializations created.
MaterialX has a lot of node definitions that use a UV0 defaultgeomprop to automatically connect to UV stream at index zero. Since USD is name based, and we specified a canonical naming scheme for UV sets in PR #1528, we can insert a geompropvalue primvar reader that will allow that shader to work. MaterialX can also specify a UV stream by index using a "texcoord" geometry node. For these, we substitute a geompropvalue primvar reader that refers to the primvar name we assigned for that index: UV2 -> st2
@dj-mcg Can you help review this change and confirm that it works for Pixar as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This looks good to me, and I believe it allows me to delete one of our internal patches. I'll fix up whatever internal tests are affected, so lgtm! |
Implements automatic UV set renaming.
Caveat:
If you have a mesh with multiple UV sets, and a UV set named "map1" is not the first UV set, then it will not automatically be renamed "st" as was previously the case using MAYAUSD_EXPORT_MAP1_AS_PRIMARY_UV_SET. We expect these cases to be quite rare, but if you have post-processing scripts that are expecting "st" and scenes where "map1" is not the first UV sets; then the results at the other end of the post-processing pipeline will be different.