Godot: Add a portable way to prevent files/folders from being imported

Created on 20 Apr 2017  路  5Comments  路  Source: godotengine/godot

For a game project or plugin for the assetlib, it would be useful to tell Godot to ignore some files or directories from being imported, a bit like a .gitignore that applies to its own folder and child folders. Such a file would also make the feature portable because it doesn't need a project setting that would require projects to be intrusively modified.

Context: in 3.0, I am developing a GDNative plugin with an src/ folder for the C++ project. During development, compilation generates lots of files with various extensions, .obj among them, and Godot thinks they are meshes and chokes at importing them. Because the import is automatic it happens as soon as I focus Godot, which is really annoying. This is one reason why I think a .godotignore feature would be useful.

discussion feature proposal core

Most helpful comment

@davincif The directory structure should look like this:

your_project/
    project.godot
    some_folder_to_exclude/
        .gdignore
        some_files_to_exclude

All 5 comments

Can someone explain how exactly .gdignore works? Do I put it inside of the folders I want to exclude?

@aaronfranke yes

@aaronfranke yes

It didn't worked with me.
If I put a arquive ".gdignore" inside my directory like a __init__.py file in python, Godot keeps importing stuff in it.
If a put outside, like a .gitignore file in git, nothing happens ether.
.-. How it was supposed to work?
PS.: using 3.1 version

@davincif The directory structure should look like this:

your_project/
    project.godot
    some_folder_to_exclude/
        .gdignore
        some_files_to_exclude

@davincif I had to close the project and reopen before Godot would ignore the folder.

Was this page helpful?
0 / 5 - 0 ratings