Documentation
¶
Overview ¶
Package EditorScenePostImport provides methods for working with EditorScenePostImport object instances.
Index ¶
- type Advanced
- type Any
- type Implementation
- type Instance
- func (self Instance) AsEditorScenePostImport() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) GetSourceFile() string
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
type Instance [1]gdclass.EditorScenePostImport
Imported scenes can be automatically modified right after import by setting their [b]Custom Script[/b] Import property to a [code]tool[/code] script that inherits from this class. The [method _post_import] callback receives the imported scene's root node and returns the modified version of the scene. Usage example: [codeblocks] [gdscript] @tool # Needed so it runs in editor. extends EditorScenePostImport
# This sample changes all node names. # Called right after the scene is imported and gets the root node. func _post_import(scene):
# Change all node names to "modified_[oldnodename]" iterate(scene) return scene # Remember to return the imported scene
func iterate(node):
if node != null: node.name = "modified_" + node.name for child in node.get_children(): iterate(child)
[/gdscript] [csharp] using Godot;
// 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 GodotObject _PostImport(Node scene) { // Change all node names to "modified_[oldnodename]" Iterate(scene); return scene; // Remember to return the imported scene } public void Iterate(Node node) { if (node != null) { node.Name = $"modified_{node.Name}"; foreach (Node child in node.GetChildren()) { Iterate(child); } } } }
[/csharp] [/codeblocks]
See [Interface] for methods that can be overridden by a [Class] that extends it.
%!(EXTRA string=EditorScenePostImport)
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsEditorScenePostImport ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) GetSourceFile ¶
Returns the source file path which got imported (e.g. [code]res://scene.dae[/code]).