Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Max : Optional validator to check invalid context data#6198

Merged
mkolar merged 3 commits intodevelopfrom
enhancement/OP-8105_Validate-Context
May 3, 2024
Merged

Max : Optional validator to check invalid context data#6198
mkolar merged 3 commits intodevelopfrom
enhancement/OP-8105_Validate-Context

Conversation

@moonyuet
Copy link
Copy Markdown
Member

@moonyuet moonyuet commented Feb 5, 2024

Changelog Description

Add optional validator check on invalid context data for asset and task in 3dsMax

Additional info

Reference to maya's Validate Instance in Context

Testing notes:

  1. Launch 3dsMax via launcher
  2. Create two instances with same families, one of them set different asset and task
  3. Publish
  4. Error would be raised if you enable the validator which check on invalid context data
  5. Repair it
  6. Run publisher again it will pass without error

@ynbot ynbot added host: 3dsmax Autodesk 3dsmax size/S Denotes a PR changes 100-499 lines, ignoring general files type: enhancement Enhancements to existing functionality labels Feb 5, 2024
@moonyuet moonyuet added sponsored Client endorsed or requested target: OpenPype target: AYON labels Feb 5, 2024
@LiborBatek
Copy link
Copy Markdown
Member

It seems that there is a issue in max addon 1.5 and gives me error on Ayon server:

Description
Unable to load max 0.1.5 settings
Message
Unable to load max 0.1.5 settings

    Traceback (most recent call last):
      File "/backend/api/settings/settings.py", line 163, in get_all_settings
        settings = await addon.get_studio_settings(variant)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/backend/ayon_server/addons/addon.py", line 288, in get_studio_settings
        settings = await self.get_default_settings()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/addons/max/0.1.5/__init__.py", line 17, in get_default_settings
        return settings_model_cls(**DEFAULT_VALUES)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
    pydantic.error_wrappers.ValidationError: 3 validation errors for MaxSettings
    publish -> enabled
      field required (type=value_error.missing)
    publish -> optional
      field required (type=value_error.missing)
    publish -> active
      field required (type=value_error.missing)

@moonyuet
Copy link
Copy Markdown
Member Author

moonyuet commented Feb 6, 2024

It seems that there is a issue in max addon 1.5 and gives me error on Ayon server:

Description
Unable to load max 0.1.5 settings
Message
Unable to load max 0.1.5 settings

    Traceback (most recent call last):
      File "/backend/api/settings/settings.py", line 163, in get_all_settings
        settings = await addon.get_studio_settings(variant)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/backend/ayon_server/addons/addon.py", line 288, in get_studio_settings
        settings = await self.get_default_settings()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/addons/max/0.1.5/__init__.py", line 17, in get_default_settings
        return settings_model_cls(**DEFAULT_VALUES)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
    pydantic.error_wrappers.ValidationError: 3 validation errors for MaxSettings
    publish -> enabled
      field required (type=value_error.missing)
    publish -> optional
      field required (type=value_error.missing)
    publish -> active
      field required (type=value_error.missing)

@LiborBatek I forgot to add something into the settings. Can you please build and install the new Max addons and test it again? Thanks!

Copy link
Copy Markdown
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 works as expected. The Repair action also do what it should...

image

After Repair action all validates well:

image

@mkolar mkolar merged commit 407d879 into develop May 3, 2024
@ynbot ynbot added this to the next-patch milestone May 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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 target: OpenPype type: enhancement Enhancements to existing functionality

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants