Create Smart Select

Hi,

What are the Create Smart Select settings supposed to do ?
Setting Location: ayon+settings://core/tools/creator/product_types_smart_select

I have searched on the docs, on the forum, and on Discord, without any luck.

Looking at the gui, I guess it detects some words in the task names, and force the Publish Type that is indicated.
For example if a task is called model, on the Create step the Choose publish type will automatically be set to Model.

But it does not work, at least for me in Blender (too bad, as it’s something that artists ask very often).

Also, meta_vik (Algous studio) asked if it works in the Tray Publisher.

This subject came up on Discord

I suspect the product types left side must be lowercase, like e.g. CreateModel in Blender has product_type = "model".

If so, that would make the default settings just plain wrong? :smiley:

The task names are compared without case sensitivity, but the product types don’t seem to be in the code here.

Thanks Roy,

I tested with left size as lowercase, but it did not change the result : when the model task is selected (which is the default, as Blender was opened with it), the Choose publish type is still the first available (which is Action)

Anyway, if it worked, I would add that Task names may not be the best way to trigger the selection of a specific product[type].
I think it would make more sense to look for Task types (which allows the user to set the Task name he wants, without risking to lose the Create Smart Select).

I found this old thread, that seems related :

I tried tracing this feature to find the PR that added it.

This settings was called families_smart_select and the more I search the more I find results from few years back. e.g. this PR Project settings to entities by iLLiCiTiT · Pull Request #1028 · ynput/OpenPype · GitHub from 2021 was converting settings location. and families_smart_select was one of these settings.

I doubt this settings was converted over time without being properly tested on each conversation.

Thanks @mustafa_jafar and @BigRoy

Given the current code, shouldn’t it just work ?

Product type is smart_item["name"] and it’s used here inside get_indexes_by_product_type

for reference, here’s how the setting value looks like.

[
  {
    "name": "Render",
    "task_names": [
      "light",
      "render"
    ]
  },
  {
    "name": "Model",
    "task_names": [
      "model"
    ]
  },
]

Sorry, I meant that they are not lowercased in the code. The logic is there, just not compared case insensitively as far as I could tell. Reading back I can see how my sentence was confusing :wink:

But I see now in the code you linked that it does compare case insensitively there.

Finally, I’ve found some info about smart select. See add label to matching family by ClementHector · Pull Request #5128 · ynput/OpenPype · GitHub

Create Smart Select should preselect a product to create in the Choose Publish Type menu in the creator window. This is based on your configuration for the setting ayon+settings://core/tools/creator/product_types_smart_select.

  1. Product Type: [Case Insensitive] This can be either the label of the creator or the product type. You can identify the label and type from the code, for example, here. Alternatively, you can check the creator window for labels and the loader for product types.

  2. Task Names: [Case Insensitive] The name of the task to which you want the smart selection applied.

Sorry, in my previous message I intended to share a link that highlights only the part that does the lowercase handling, but I ended up sharing the whole code instead :grin:

So, I don’t think it works and I’m wondering if it only works in the old creator.
Adding a few print statements here doesn’t actually print any thing.


I think the smart selection logic should be added here instead.