classes/class_editorscenepostimport #166
Replies: 1 comment
-
If you are fiddling with the node hierarchy and your script fails with:
it could be that some of your node owners are set to a node which is no longer in the scene, causing this error when Godot attempts to pack the scene. This can be resolved by adding this code to your script: @tool
extends EditorScenePostImport
func _post_import(scene):
# hierarchy fiddling...
set_children_owner(new_scene, new_scene)
return new_scene
func set_children_owner(node, owner):
for n in node.get_children():
n.owner = owner
set_children_owner(n, owner) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
classes/class_editorscenepostimport
Inherits: RefCounted< Object Post-processes scenes after import. Description: Imported scenes can be automatically modified right after import by setting their Custom Script Import property to a to...
https://docs.godotengine.org/en/stable/classes/class_editorscenepostimport.html
Beta Was this translation helpful? Give feedback.
All reactions