How to configure the file dialog for specific files?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By roma

How to configure the file dialog for specific files? For example, when Paint opens a file, you can choose what to open. I couldn’t do it. Tried via add_filter(“.vox”). It didn’t work out… Maybe we need to do it in a different way? Is this even configurable somewhere else?

:bust_in_silhouette: Reply From: Wakatta

Godot expects

$FileDialog.set_filters(["*vox ; Voxlap super blocky 3D format"])

Or

$FileDialog.add_filter("*.vox ; Voxlap super blocky 3D format")

For multiple

var allowed = ["*vox", "*png", "*bmp", "*dds"]
$FileDialog.set_filters(allowed)