OpenUSD icon indicating copy to clipboard operation
OpenUSD copied to clipboard

usdUtils: add a GeomSubsetsChecker for validating UsdGeomSubsets with usdchecker

Open mattyjams opened this issue 1 year ago • 6 comments

This new rule checker can be used to validate various aspects of UsdGeomSubsets:

  • GeomSubsets must be authored as direct children of an Imageable prim.
  • The set of all subset family names is fetched for each subset parent Imageable, and each family is checked for validity (using UsdGeomSubset::ValidateFamily()).
  • If the materialBind subset family is authored on an Imageable, it is checked to ensure that it is of a restricted type (either nonOverlapping or partition), since it is invalid for an element of geometry to be bound to multiple materials.
  • If a subset has authored material bindings but no authored subset family name, it is suggested that the family name should be set to materialBind to ensure that the material bindings are visible to renderers. The material bindings will have no effect otherwise.

I have run the unit tests successfully with the changes here, but they depend on fixes and improvements to UsdGeomSubset::ValidateFamily() from #2733.

  • [X] I have verified that all unit tests pass with the proposed changes
  • [X] I have submitted a signed Contributor License Agreement

mattyjams avatar Oct 17 '23 04:10 mattyjams

Filed as internal issue #USD-8839

jesschimein avatar Oct 17 '23 16:10 jesschimein

Rebased on the current dev branch to pick up the fixes from #2733 / 6575a265a73de63a50559b22626ee723e3ba2059.

mattyjams avatar Nov 20 '23 15:11 mattyjams

Thanks, @mattyjams ! We are actually IP on adding new elementTypes point and edge for use initially in UsdPhysics, so in your checks relating to materialBind family, it would be good to also validate that the elementType is face ?

spiffmon avatar Nov 20 '23 19:11 spiffmon

Thanks, @mattyjams ! We are actually IP on adding new elementTypes point and edge for use initially in UsdPhysics, so in your checks relating to materialBind family, it would be good to also validate that the elementType is face ?

Sounds good, thanks @spiffmon! I just pushed an update that checks that elementType=face for any subsets belonging to the materialBind family.

mattyjams avatar Nov 21 '23 16:11 mattyjams

Rebased to resolve merge conflicts.

mattyjams avatar Jan 16 '24 21:01 mattyjams

Rebased and resolved merge conflicts.

mattyjams avatar Mar 26 '24 22:03 mattyjams

Freshening with a rebase on the current dev branch (35dbce15eb3dc6c805b65135d911c246716fd192).

mattyjams avatar May 20 '24 20:05 mattyjams

I caught up with @tallytalwar about this and I'm going to take a crack at re-formulating this in terms of the new UsdValidator framework in C++ instead.

mattyjams avatar May 22 '24 18:05 mattyjams

Closing this in favor of #3123, which implements the same checks but in the new C++ validation framework...

mattyjams avatar Jun 14 '24 19:06 mattyjams