Godot Version
4.5.1
Question
Hi friends,
When import script is executed? I wrote an import script and configured it into project settings. However, it seems not running as I cannot find print anywhere:
Thanks!
4.5.1
Hi friends,
When import script is executed? I wrote an import script and configured it into project settings. However, it seems not running as I cannot find print anywhere:
Thanks!
Is that meant for everything you import, or for one thing? Cause I believe you want to select the object in FileSystem, select the import tab and attach the script there.
For everything. I assume the script configured in Project Settings will run whenever editor detect any file it needs to be imported.
In my case, I modified a blend file which is under my project folder, when editor window get focused, it re-import this blend file. My assumption is the script should run.
I can put the script into import window for each file and yes, it runs. But the point is, I assume it should run for all imported scenes once I put it into Project Settings…
So I looked, and there’s no specific documentation about the field. However your assumption seems logical. My recommendation is to log a bug about it in the Godot project.
Personally, I’ve never used that field. If I need to attach it to multiple models, I just select them all at once and do the assignment in the import tab once, then click Reimport. It’ll reimport them all.
Yeah, the setting is called Import Defaults so…
Where may I log a bug? In Github GitHub · Where software is built?
It’s the default for a specific Importer. Note the “Importer” drop down at the top of the settings. Not all importers allow import scripts. In fact very few do. On the screenshot you posted you have it set for “Animation Library” importer. If you’re importing a blender file you probably want to set it for the “Scene” importer. For the default to apply the chosen “Import As” on the Import tab must match the Importer you set the default for.
Good catch. I actually changed it to Scene after I took screenshot (my fault). However, it’s same.
And I also confirm the Import As for my blender file is Scene. The only way I got script run is set for each file individually.
Strange. The path field gets reset as soon as you navigate away from Import Defaults tab. Definitely worth reporting then.
Yes, that’s the correct link.
There’s a small save button above the close button though it doesn’t fix the issue.
I can confirm this as I can clearly see the change in project file via git diff.
More info. I found the Import Default DOES WORK for new added blend files. So when new file is added into project folders, the Import Default will be applied to them. I still think it is a bug (minor?) as changing the Import Default won’t affect existing files which can be annoying to manually fix them one by one.