-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Custom script for import doesn't work #12256
Comments
godot/editor/import/resource_importer_scene.cpp Lines 55 to 61 in 0899b50
but not binded Lines 3268 to 3270 in 9f78878
@reduz @akien-mga is it really obsolete? |
I just uncommented tool # needed so it runs in editor
extends EditorScenePostImport
func post_import(scene):
# do your stuff here
for child in scene.get_children():
if child is MeshInstance:
child.set_surface_material(0, preload("res://materials/my.material"))
return scene # remember to return the imported scene |
I can confirm what @volzhs said, by uncommenting that line and compiling I was able to use the post_import again. I guess this feature is not supported atm if there's looking for new API so I won't report if any bug/issue is found while using... but still it's something nice to have: saves lot of manual work, in which, even onto unstable testing can come handy. |
Operating system or device, Godot version, GPU Model and driver (if graphics related):
Godot on *buntu 17.04
Issue description:
Whatever script.gd (even an empty one) you put in the "Custom Script" gives generic error ( Error running post-import script ) without telling anything about what's wrong. The official Wiki says you're supposed to use this code to make it work
tool # needed so it runs in editor
extends EditorScenePostImport
func post_import(scene):
return scene # remember to return the imported scene
This code works with Godot2, but both class EditorScenePostImport and function post_import are not present in Godot3
Steps to reproduce:
= generic error appear, item cannot be imported anymore until you don't remove that script file
Link to minimal example project:
minidemo.zip
demo: while in editor try to reimport the box.dae
The text was updated successfully, but these errors were encountered: