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

Add glob, file type or regular expression-based search to the FileSystem dock #11504

Open
TheConceptBoy opened this issue Jan 6, 2025 · 3 comments

Comments

@TheConceptBoy
Copy link

TheConceptBoy commented Jan 6, 2025

Describe the project you are working on

A 3D game with a very large amount of assets, where you might encounter naming conventions like:
buidling_1.obj
building_1.tscn

building_2.glb
building_2.tscn

Describe the problem or limitation you are having in your project

When placing assets either through the Quick Instantiation menu or File system, finding the asset gets tricky when there's all sort of unrelated content in the way.

For example if I want to place a building scene, I will likely get building.obj listed before building.tscn

I think it would be nice if we could in the least get some basic regular expressions where we can supply the * flag to filter out the right extentions.
Image

Image

This also helps with quick instance as when using quick instance window, GLB files also get considered as scenes and flood the list.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It helps immediately isolate the filesystem for only the file types you need - especially for isolating tscn files when building a level from props.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Doesn't have to be full on reg-ex. Just in the least, let us use the * symbol to define any matching rules.

For example if I want to isolate only buidling scenes:
building_*.tscn

where * deliminates any possible variation like
building_1.tscn
building_2.tscn
building_tall.tscn
building_destroyed.tscn

If this enhancement will not be used often, can it be worked around with a few lines of script?

Oh I'm pretty sure this is a must have to quickly find files.

Is there a reason why this should be core and not an add-on in the asset library?

The search bar is already in the file system, just needs a little love.

@Calinou Calinou changed the title Add Regular Expressions or Resource Filtering in the File System search panel. Add glob, file type or regular expression-based search to the FileSystem dock Jan 6, 2025
@Calinou
Copy link
Member

Calinou commented Jan 6, 2025

We can use the type:/t: syntax to allow searching by resource type, similar to the Scene tree dock where you can filter node types this way. This would accept a resource name type (e.g. type:Texture2D), although file extensions could also be searched for as a fallback (so that type:jpg would work).

For example, grass type:Texture2D will search for all Texture2D resources that contain the string grass in their name.

On top of that, we can also allow for glob-based search which should be straightforward to implement using String.matchn().

@TheConceptBoy
Copy link
Author

That would work as well. Yes.

@TheConceptBoy
Copy link
Author

Perhaps not just the file system but also quick instantiate menu in the scene tree panel? Since you may want TSCN and not GLB files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants