-
Notifications
You must be signed in to change notification settings - Fork 202
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-105735 Clean up empty map1 texcoord #685
MAYA-105735 Clean up empty map1 texcoord #685
Conversation
If the imported USD mesh does not have a "map1" or a "st" texcoord stream, then we make sure to get rid of the default created map1 texcoord on the Maya side.
@marsupial You raised some concerns about the UV set support. Please have a look at this PR. |
If there could be a fallback to try for 'uv' if neither 'st' or 'map1' exists, that would be great. |
@marsupial Maya does always fallback on the UV stream at index 0 on the mesh. Without this fix, the default empty stream "map1" was left in place at index zero and prevented textures from showing correctly. Fixes most of the issues I have seen so far with USD files not showing textures. This does not fix meshes/materials using multiple UV streams. Is this is a common workflow? |
Ok great, sorry for the noise: from reading it looked like only st & map1 were honored. |
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.
Cool, looks good to me! Two super-minor suggestions, but I'd also be ok with it as is.
Thanks @JGamache-autodesk!
// will use that slot. If not, the first texcoord stream to load will replace the default map1 | ||
// stream. | ||
bool hasDefaultUVSet = false; | ||
TF_FOR_ALL(iter, primvars) |
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.
We've been slowly yanking out usages of TF_FOR_ALL
as we come across them, so these might be good ones to replace with regular range-based for loops:
for (const UsdGeomPrimvar& primvar : primvars) {
// Default UV set name in Maya | ||
(map1) |
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.
It might be nice to have this token available publicly in a place that's accessible to both this file and meshWriteUtils.cpp
so we can avoid hard-coding the string there also:
if (setName == "map1") { |
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.
Thank you. Aside from what Matt already mentioned, changes makes sense to me.
If the imported USD mesh does not have a "map1" or a "st" texcoord
stream, then we make sure to get rid of the default created map1
texcoord on the Maya side.