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

Max: Implementation of the validator for model name #6164

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from

Conversation

moonyuet
Copy link
Member

@moonyuet moonyuet commented Jan 25, 2024

Changelog Description

Implement the validator for model name in 3dsmax

Additional info

The validation regex by default is (.*)_(?P<subset>.*)_(GEO) and
your model name should be {Some name}_{SubsetName}_GEO

Testing notes:

  1. Go to OP/AYON Settings
  2. Turn on Validate Model Name
  3. Set your preferred validation regex for checking your model name
  4. Validate Model Name would check your name accordingly with your validation regex

@ynbot
Copy link
Contributor

ynbot commented Jan 25, 2024

Task linked: OP-7076 Validate Model Name

@ynbot ynbot added size/S Denotes a PR changes 100-499 lines, ignoring general files type: enhancement Enhancements to existing functionality host: 3dsmax Autodesk 3dsmax labels Jan 25, 2024
@moonyuet moonyuet marked this pull request as ready for review February 2, 2024 08:17
@LiborBatek
Copy link
Member

When inspecting the Validator Settings in Ayon,

is that regex correct? I mean this is how it looks when defaults (obviously not matching the one mentioned above):

image

@moonyuet
Copy link
Member Author

moonyuet commented Feb 5, 2024

When inspecting the Validator Settings in Ayon,

is that regex correct? I mean this is how it looks when defaults (obviously not matching the one mentioned above):

image

No, it should be (.*)_(?P<subset>.*)_(GEO),
I already update this in the latest commit.

Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

The Validator for Naming works as expected and follows the regex set in Ayon Settings for max addon.

I have set mine to:

Screenshot 2024-02-05 132240

Validator kicked in when my geometry had different naming:

Screenshot 2024-02-05 132008

So this worked fine. Small note tho: the Select Invalid didnt do anything.
After adjusting my geometry naming following the one set in Validator all Published OK and without any issues.
Screenshot 2024-02-05 132132

@LiborBatek LiborBatek added the sponsored Client endorsed or requested label Feb 8, 2024
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

Now the regex being correctly prefilled in the addon settings.

Validator works correctly, but the Select Invalid does not work ATM giving error:

Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\dependency_packages\ayon_2401161802_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\openpype_3.18.7-nightly.1\openpype\hosts\max\api\action.py", line 34, in process
    invalid_names = [obj.name for obj in invalid]
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\openpype_3.18.7-nightly.1\openpype\hosts\max\api\action.py", line 34, in <listcomp>
    invalid_names = [obj.name for obj in invalid]
AttributeError: 'tuple' object has no attribute 'name'

moonyuet added a commit that referenced this pull request Feb 8, 2024
moonyuet added a commit that referenced this pull request Feb 8, 2024
@moonyuet
Copy link
Member Author

moonyuet commented Feb 8, 2024

@LiborBatek Can you please test again to see if it works?
I have adjusted the action script a little bit, which means #6198 and #6110 possibly need some re-tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host: 3dsmax Autodesk 3dsmax port to AYON size/S Denotes a PR changes 100-499 lines, ignoring general files sponsored Client endorsed or requested target: AYON type: enhancement Enhancements to existing functionality
Projects
Status: Change Requested
Development

Successfully merging this pull request may close these issues.

None yet

4 participants