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

Maya: Allow specifying raw JSON custom tools menu for Maya. #356

Merged

Conversation

BigRoy
Copy link
Collaborator

@BigRoy BigRoy commented Apr 3, 2024

Changelog Description

Adds support for specifying the raw JSON for custom tools, allowing much easier/better access for complex menus.

Additional info

The non-JSON menu builder in settings also disallows the creation of submenus by its design (as far I could see) and 'pasting' our existing settings from e.g. OpenPype didn't allow it to automatically create the required structure for supporting submenus, etc. because of it.

By having this raw JSON field I could just copy-paste our OpenPype settings for the custom colorbleed menu for our Maya.

image
image
image

Testing notes:

  1. Define a custom scripts menu via the JSON format and enable the JSON definition toggle.

@ynbot ynbot added type: enhancement Improvement of existing functionality or minor addition size/XS host: Maya labels Apr 3, 2024
@moonyuet
Copy link
Member

moonyuet commented Apr 3, 2024

It shows up the custom tools as expected
image
But is it normal behavior that having the raw json definition enabled overriding the original script definition setting below?
image
I also think that this json definition logic not only applies to Maya but Nuke(I remember it has similar toolbar to store custom scripts.)

@BigRoy
Copy link
Collaborator Author

BigRoy commented Apr 3, 2024

But is it normal behavior that having the raw json definition enabled overriding the original script definition setting below?

The toggle overrides which one of the two to use. It uses either the settings UI builder OR the JSON menu. It does not merge the two in any way.

If anyone is in dire need of having this there and like this 'implementation' in settings then would be great to see that transferred. We don't use Nuke so won't be amongst my needs.

@iLLiCiTiT
Copy link
Member

Wouldn't be better to use enum? So user can see only one of the inputs when selected...

@BigRoy
Copy link
Collaborator Author

BigRoy commented Apr 3, 2024

Wouldn't be better to use enum? So user can see only one of the inputs when selected...

If there's a way to have the settings front-end to switch between one of the two. Yes, 100%. Any examples?

@iLLiCiTiT
Copy link
Member

iLLiCiTiT commented Apr 3, 2024

If there's a way to have the settings front-end to switch between one of the two. Yes, 100%. Any examples?

When enum has conditionalEnum=True it can show only attribute defined by it's value. Example in server/settings/publish_plugins.py model ExtractThumbnailOIIODefaultsModel where colorspace or display_and_view are visible, based on value of type.

@MustafaJafar MustafaJafar added the community Issues and PRs coming from the community members label Apr 3, 2024
@BigRoy
Copy link
Collaborator Author

BigRoy commented Apr 3, 2024

If there's a way to have the settings front-end to switch between one of the two. Yes, 100%. Any examples?

When enum has conditionalEnum=True it can show only attribute defined by it's value. Example in server/settings/publish_plugins.py model ExtractThumbnailOIIODefaultsModel where colorspace or display_and_view are visible, based on value of type.

Thanks you very much - this is much better!

image
image
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.

I tried with the latest commit of the branch and it installs the custom tools as expected(tested with both menu builder and full json definition). I like this one better than the last one as it allows user to be clearer which options to use to define my custom tools.

Copy link
Member

@tokejepsen tokejepsen left a comment

Choose a reason for hiding this comment

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

Tested successfully in Maya 2023.

Copy link
Member

@tokejepsen tokejepsen left a comment

Choose a reason for hiding this comment

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

Could we get the addon version incremented?

@BigRoy
Copy link
Collaborator Author

BigRoy commented Apr 10, 2024

Could we get the addon version incremented?

Done with 590f1db

@BigRoy BigRoy requested a review from tokejepsen April 10, 2024 07:54
@tokejepsen tokejepsen merged commit b3d7a23 into ynput:develop Apr 10, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Issues and PRs coming from the community members host: Maya size/XS type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants