ynput / OpenPype

Main OpenPype repository and AYON openpype addon codebase
https://openpype.io
MIT License
280 stars 128 forks source link

Max : Optional validator to check invalid context data #6198

Closed moonyuet closed 2 months ago

moonyuet commented 5 months ago

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
LiborBatek commented 5 months ago

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 commented 5 months ago

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!