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

Loader: Fix support for product_type_filter_profiles #680

Closed
2 tasks done
BigRoy opened this issue Jun 20, 2024 · 1 comment · Fixed by #792
Closed
2 tasks done

Loader: Fix support for product_type_filter_profiles #680

BigRoy opened this issue Jun 20, 2024 · 1 comment · Fixed by #792
Assignees
Labels
type: bug Something isn't working

Comments

@BigRoy
Copy link
Collaborator

BigRoy commented Jun 20, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior:

The ayon core addon has settings for ayon+settings://core/tools/loader/product_type_filter_profiles which allows to define the default "filter" state for product types when showing the Loader.

It seems however since some recent changes in the UIs and refactoring this does nothing anymore. It seems the product_type_filter_profiles setting is currently completely unused.

Expected Behavior:

Fix the feature again so we provide default "filters" set for the loader based on hosts, etc. (So actually use ayon+settings://core/tools/loader/product_type_filter_profiles)

Version

1.0.0

What platform you are running on?

Windows

Steps To Reproduce:

  1. Configure setting ayon+settings://core/tools/loader/product_type_filter_profiles, for example:
[
  {
    "hosts": [
      "maya"
    ],
    "task_types": [],
    "is_include": true,
    "filter_product_types": [
      "animation",
      "camera",
      "layout",
      "look",
      "model",
      "plate",
      "pointcache",
      "reference",
      "rig",
      "usd",
      "vdbcache",
      "yetiRig",
      "yeticache"
    ]
  },
  {
    "hosts": [
      "houdini"
    ],
    "task_types": [],
    "is_include": true,
    "filter_product_types": [
      "animation",
      "camera",
      "model",
      "plate",
      "pointcache",
      "usd",
      "vdbcache"
    ]
  },
  {
    "hosts": [
      "fusion"
    ],
    "task_types": [],
    "is_include": true,
    "filter_product_types": [
      "camera",
      "image",
      "matchmove",
      "plate",
      "prerender",
      "render"
    ]
  },
  {
    "hosts": [
      "resolve"
    ],
    "task_types": [],
    "is_include": true,
    "filter_product_types": [
      "editorial",
      "image",
      "matchmove",
      "plate",
      "prerender",
      "render",
      "review"
    ]
  }
]
  1. When showing the loader in the specific profiles the default "product type" filters on the bottom should be enabled as per the matching profile.

Are there any labels you wish to add?

  • I have added the relevant labels to the bug report.

Relevant log output:

No response

Additional context:

Any pointers on how or where to implement this with all the controller/UI separation logic involved currently @iLLiCiTiT and I can take a look (hopefully understanding what you mean, hehe)

@BigRoy BigRoy added the type: bug Something isn't working label Jun 20, 2024
@iLLiCiTiT
Copy link
Member

Controller should have method (long name) get_current_context_product_types_filter without any args. It should return object with 2 attributes product_types and is_include (maybe rather is_whitelist?).

class ProductTypesFilter:
    def __init__(self, product_types, is_whitelist):
        self.product_types: List[str] = product_types
        self.is_whitelist: bool = is_whitelist

If current context is not available, for any reason e.g. in tray browser, then it should return object with empty product types and is whitelist to False so all product types are checked.

With that available ProductTypesView should get the value in _on_refresh_finished and set the filter on the proxy.

NOW: question is if we want to also reset the filtering on every reset, so anything user checked/unchecked is lost, or it will happen only once after show (also reset but user closed the window meanwhile).

If it should happen only after show then ProductTypesView also have to define an attribute where stores boolean if should override or not, that will set it's value to True in overriden showEvent method which would mean that on next refresh will apply settings to proxy and change the attribute to False so until user cloes window it does not "change" it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants