Image selector filter bug

I have a folder that contains multiple image families. To distinguish between the families I use a fixed image nomenclature. For example

  • First family: s10??.png
  • Second family s11??.png
  • Third family s12??.png

Whilst assigning images to an animation group I attempted to filter the bulk list down to s11*. Much to my surprise the list got filtered but instead of showing the s1101 to s1116 subset of images as I had expected it picked up s11?? AND s101? Unless I am wholly misunderstanding something this sounds like a bug

A nice to have would be if the raw image list shown were accordionized by subfolder names…

My understanding is that the search function inserts wildcards to get as many results as possible. I would expect your s11* family of images to appear top of the list though.

In my example below, only the cjson extension actually contains the string “str”. As desired those results show up at the top. After that though it looks like the search inserts a wildcard (like st*r) to get files named “star_background”.

1 Like

It is using fuzzy search, so that you can type a series of characters that are all part of the name.
And I’m not entirely sure if it’s possible to make it more “fixed” like you want to.

Perhaps @mats.gisselson knows more?

Ummm… surely not that hard a job for a simple RegEx?

Like Mathias mentioned, it is using a fuzzy text filtering algorithm. Its intended purpose is to be able to quickly open a named resource without having to type something fiddly like a regular expression. A similar feature exists in many modern editors such as Sublime Text, Visual Studio Code, XCode, the IntelliJ IDEs, etc.

It will match anything that contains the characters you typed in the correct order. Entries are sorted by “score”. A shorter distance between matching characters yields a higher score. If the characters are at the beginning of words, they are also scored higher, such as cm matching camera_manager. There’s a bit of “secret sauce” to the algorithm to make it “feel” good, mainly related to scoring the entires.

So it doesn’t surprise me that you’re getting the matches you’re describing. That particular naming scheme is not a great fit for fuzzy search. You’d have better results if there were some kind of separating character between the different parts of the file name that mean different things.

That said, the scoring might need tweaking. I’d need to see a more complete example of a match that does not make sense in order to determine if it is working as intended.

3 Likes

I guess now that we’re open source I can just share a link to the fuzzy match algorithm if you’re interested. :slightly_smiling_face:

4 Likes

fascinating…
The game engine language is LUA that uses very few parenthesis.
The game engine editor is instead written in Clojure that on the other hand…

Thank you. I can live with the way the filter works and just be smarter about how I ask for filtering to be done - e.g. specifying the folder too.