Skip to content
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

Added mesh export options to preserve and remap UV set names #2283

Merged
merged 6 commits into from
May 3, 2022

Conversation

jonjondev
Copy link
Contributor

Currently, the ADSK plugin always authors UV sets as st, st1, st2, etc. While AL's pipeline ultimately assumes that map1 should be renamed to st on export and additional named sets should retain their naming as specified in Maya.

A new export option, -preserveUVSetNames (-puv), has been added to allow for the preservation of set names:

def Mesh "my_geo"
{
    texCoord2f[] primvars:rigging_utility = [...] (
        interpolation = "faceVarying"
    )
    int[] primvars:rigging_utility:indices = [...]

    texCoord2f[] primvars:map1 = [...] (
        interpolation = "faceVarying"
    )
    int[] primvars:map1:indices = [...]
}

A second export option, -remapUVSetsTo (-ruv), has been added on top of this to provide a generalised solution to our specific use-case, where the options remapUVSetsTo=[[map1, st], [rigging_utility, my_uv_set]] would produce:

def Mesh "my_geo"
{
    texCoord2f[] primvars:my_uv_set = [...] (
        interpolation = "faceVarying"
    )
    int[] primvars:my_uv_set:indices = [...]

    texCoord2f[] primvars:st = [...] (
        interpolation = "faceVarying"
    )
    int[] primvars:st:indices = [...]
}

@autodesk-chorus
Copy link

Chorus detected one or more security issues with this pull request. See the Checks tab for more details.

As a reminder, please follow the secure code review process as part of the Secure Coding Non-Negotiable requirement.

@jonjondev jonjondev changed the title Refactored and simplified primvar interpolation type detection Added mesh export options to preserve and remap UV set names Apr 12, 2022
@jonjondev
Copy link
Contributor Author

Hey @seando-adsk, looks like preflight is passing. Any chance this can get a review?

@seando-adsk seando-adsk requested a review from vlasovi April 29, 2022 20:02
@seando-adsk seando-adsk added the import-export Related to Import and/or Export label Apr 29, 2022
@seando-adsk
Copy link
Collaborator

@J-Mo63 Sorry about the delay. I've assigned a reviewer now.

@@ -153,6 +154,7 @@ their own purposes, similar to the Alembic export chaser example.
| `-materialsScopeName` | `-msn` | string | `Looks` | Materials Scope Name |
| `-mergeTransformAndShape` | `-mt` | bool | true | Combine Maya transform and shape into a single USD prim that has transform and geometry, for all "geometric primitives" (gprims). This results in smaller and faster scenes. Gprims will be "unpacked" back into transform and shape nodes when imported into Maya from USD. |
| `-normalizeNurbs` | `-nnu` | bool | false | When setm the UV coordinates of nurbs are normalized to be between zero and one. |
| `-preserveUVSetNames` | `-puv` | bool | false | Refrain from renaming UV sets additional to "map1" to "st1", "st2", etc; "map1" will always be renamed to "st". |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment may be improved:

  1. In the code, -remapUVSetsTo takes priority over -preserveUVSetNames. We need to add a comment here clarifying this behaviour.
  2. The comment here says: "map1" will always be renamed to "st". I'm not sure I saw this behaviour in the code. Is this true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes sorry that's a bit outdated. I'll go ahead and fix that right up.

Copy link
Collaborator

@vlasovi vlasovi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice feature. Thanks, @J-Mo63.
I request only a couple minor improvements. Please see in the comments.

@jonjondev jonjondev requested a review from vlasovi May 3, 2022 04:41
@jonjondev
Copy link
Contributor Author

Hey @vlasovi, your feedback has been actioned. Let me know if it's all good to go.

Copy link
Collaborator

@vlasovi vlasovi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@vlasovi vlasovi added the ready-for-merge Development process is finished, PR is ready for merge label May 3, 2022
@seando-adsk seando-adsk merged commit 82c4698 into Autodesk:dev May 3, 2022
@jonjondev jonjondev deleted the J-Mo63/preserve-uv-set-names branch May 3, 2022 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import-export Related to Import and/or Export ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants