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

Implement Maya USD Export Chaser to Filter Properties #193

Conversation

BigRoy
Copy link
Contributor

@BigRoy BigRoy commented Dec 10, 2024

Changelog Description

Implement Maya USD Export Chaser to Filter Properties using a SideFX Houdini style pattern matching for all prim properties

Additional review information

For explanation on how the pattern works, see SideFX Houdini Pattern Matching in Parameters which it is loosely based on.

image

Results in:

image

#usda 1.0
(
    defaultPrim = "char_hero"
    metersPerUnit = 0.01
    upAxis = "Y"
)

def Xform "char_hero" (
    kind = "component"
)
{
    double3 xformOp:translate = (-0.4334395286605499, 0.8835878002001145, -0.6190157988997917)
    uniform token[] xformOpOrder = ["xformOp:translate"]

    def Mesh "pCube1"
    {
    }
}

Note how the mesh contains no properties at all - they are completely stripped from the written USD file.

TODO

  • Improve attribute definition tooltip to describe the available pattern and maybe some examples.
  • Add to settings to enable/disable the plug-in and potentially set up a default value.

Added ayon+settings://maya/publish/CollectMayaUsdFilterProperties

image

Testing notes:

  1. A new attribute "USD Filter Properties" should appear on Maya USD instances
  2. When any pattern is entered, then only those properties would be exported into the output file. For example:
  • Only include xforms: xformOp*
  • Everything but xforms: * ^xformOp*
  • Everything but mesh point data: * ^extent ^points ^faceVertexCounts ^faceVertexIndices ^primvars*

…Houdini style pattern matching for all prim properties
@BigRoy BigRoy added type: enhancement Improvement of existing functionality or minor addition sponsored This is directly sponsored by a client or community member labels Dec 10, 2024
@BigRoy BigRoy requested a review from antirotor December 10, 2024 08:40
@BigRoy BigRoy self-assigned this Dec 10, 2024
@BigRoy BigRoy linked an issue Dec 10, 2024 that may be closed by this pull request
@BigRoy
Copy link
Contributor Author

BigRoy commented Dec 10, 2024

This PR may also solve #82 but only partially.
This PR does not:

  • Strip prim definitions that are empty without properties
  • Turn anything into over instead of def

@BigRoy
Copy link
Contributor Author

BigRoy commented Dec 20, 2024

I do wonder - with this plug-in being relatively technical. Should this maybe be disabled by default so it does not show in UI?

@LiborBatek
Copy link
Member

yeah, its def very techy thing :) ...from artist pov at least (e.g. me :)

I would like to recommend if that Ayon setting disabled (USD export chaser) then no new UI items shown in the publisher UI...if possible

and yes, disabled as defaults sounds right too!

@moonyuet
Copy link
Member

moonyuet commented Dec 27, 2024

Checked in the published usd file: The xform data is there.
image
When the usd is imported back to Houdini, it appeared not to load anything(which is expected). When checking the geometry speadsheet, all xform attributes are loaded
image
Will test on the mesh point data later

@moonyuet
Copy link
Member

moonyuet commented Dec 27, 2024

Tested with second scanerio where the xform is not included: (It shows all the vertex data of the meshes)
image
As the xform data is not exported, which means all the transforms of the meshes become zero when importing back to houdini
image
All the geometries would be at zero transform
image

This is how the usd export without the filter looks like, which means the filtering function works as expected.
image

Copy link
Member

@moonyuet moonyuet left a comment

Choose a reason for hiding this comment

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

See comments above

@BigRoy
Copy link
Contributor Author

BigRoy commented Dec 27, 2024

I would like to recommend if that Ayon setting disabled (USD export chaser) then no new UI items shown in the publisher UI...if possible

and yes, disabled as defaults sounds right too!

Correct - that should be the behavior now with fc41e53

@BigRoy BigRoy merged commit 2c8f297 into ynput:develop Dec 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sponsored This is directly sponsored by a client or community member type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AY-7141_Maya USD: Publish USD with properties/attributes filtered
3 participants