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

EMSUSD-1570 add a class-prims filter to USD UFE #3987

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

pierrebai-adsk
Copy link
Collaborator

  • Add a getUsdPredicate helper function to UsdUfe to create the USD predicate corresponding to a list of UFE filters.
  • Add the "Class Prims" filter to the list of USD filters in the hierarchy handler.
  • Use the helper to create the USD predicate.
  • Rely on the USD predicate having a correct predicate for inactive prim instead of using an explicit flag.
  • Adjust the context menu for class prims.
  • Add a unit test for the class prims filter.

Work around the problem that Maya does not correctly handle UFE filters. Maya only handles one UFE filter. If there are more than one filters, only one is handled.

To work around this issue, we manually ask the outliner what are the desired settings and use these settings as the default values for the filters. When the outliner fails to handle multiple filters, it will end-up using the default values, which will be the desired values.

@pierrebai-adsk pierrebai-adsk self-assigned this Nov 6, 2024
@pierrebai-adsk pierrebai-adsk added the ufe Related to UFE component in Maya label Nov 6, 2024
@pierrebai-adsk pierrebai-adsk force-pushed the bailp/EMSUSD-1570/class-prims-in-outliner branch from 8c37fe1 to 25fcdea Compare November 6, 2024 15:47
@pierrebai-adsk pierrebai-adsk force-pushed the bailp/EMSUSD-1570/class-prims-in-outliner branch from 25fcdea to 30aaaaf Compare November 6, 2024 18:34
@pierrebai-adsk pierrebai-adsk force-pushed the bailp/EMSUSD-1570/class-prims-in-outliner branch from 30aaaaf to 5a880b7 Compare November 6, 2024 20:47
FilterSettings = collections.namedtuple('FilterSettings', ['filters', 'expecteditems'])
filterSettings = [
FilterSettings(
filters={ 'InactivePrims': False, 'ClassPrims': False },
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is my thinking, that a full list of possibilities may not be known in case there's a need to include all.
Perhaps we can document the supported filters somewhere to be used as a reference.

AramAzhari-adsk
AramAzhari-adsk previously approved these changes Nov 7, 2024
@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Nov 7, 2024
@seando-adsk seando-adsk removed the ready-for-merge Development process is finished, PR is ready for merge label Nov 8, 2024
@seando-adsk
Copy link
Collaborator

@pierrebai-adsk Removed the ready-for-merge just until my questions are answered.

- Add a getUsdPredicate helper function to UsdUfe to create the USD
  predicate corresponding to a list of UFE filters.
- Add the "Class Prims" filter to the list of USD filters in the
  hierarchy handler.
- Use the helper to create the USD predicate.
- Rely on the USD predicate having a correct predicate for inactive prim
  instead of using an explicit flag.
- Adjust the context menu for class prims.
- Add a unit test for the class prims filter.

Work around the problem that Maya does not correctly handle UFE filters.
Maya only handles one UFE filter. If there are more than one filters,
only one is handled.

To work around this issue, we manually ask the outliner what are the
desired settings and use these settings as the default values for the
filters. When the outliner fails to handle multiple filters, it will
end-up using the default values, which will be the desired values.

- Add a CMake compiler definition on the project.
- The script to update the filter need to be protected from infinite
  recursion, no need to run it on idle.
- Running it on idle would be making the filter new value not always
  being applied at the proper time. Easily visible when reload a scene.
@pierrebai-adsk pierrebai-adsk force-pushed the bailp/EMSUSD-1570/class-prims-in-outliner branch from 72fe93c to 22d2dd6 Compare November 8, 2024 17:14
@pierrebai-adsk
Copy link
Collaborator Author

I believe I answered Sean's concerns, so I'll mark this a ready for merge.

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Nov 11, 2024
@seando-adsk seando-adsk merged commit c1c448e into dev Nov 18, 2024
11 checks passed
@seando-adsk seando-adsk deleted the bailp/EMSUSD-1570/class-prims-in-outliner branch November 18, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge ufe Related to UFE component in Maya
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants