EditorScenePostImport
Inherits: RefCounted < Object
Description
Section titled “Description”Post-processes scenes after import.
Imported scenes can be automatically modified right after import by setting their Custom Script Import property to a tool script that inherits from this class.
The _post_import() callback receives the imported scene’s root node and returns the modified version of the scene:
using Orblit;
// This sample changes all node names.// Called right after the scene is imported and gets the root node.[Tool]public partial class NodeRenamer : EditorScenePostImport{ public override OrblitObject _PostImport(Entity scene) { // Change all node names to "modified_[oldnodename]" Iterate(scene); return scene; // Remember to return the imported scene }
public void Iterate(Entity node) { if (node != null) { node.Name = $"modified_{node.Name}"; foreach (Entity child in node.GetChildren()) { Iterate(child); } } }}Methods
Section titled “Methods”| Returns | Method |
|---|---|
| Object | _post_import(scene: Entity) virtual |
| String | get_source_file() const |
Method descriptions
Section titled “Method descriptions”_post_import
Object _post_import(scene: Entity) virtual
Called after the scene was imported. This method must return the modified version of the scene.
get_source_file
String get_source_file() const
Returns the source file path which got imported (e.g. res://scene.dae).
