class-description NEWS COMMUNITY STORE TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectRefCounted EditorScenePostImport
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:
@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)
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); } } } }

Object _post_import<>( Node scene=, scene:Node=, ):Object
Called after the scene was imported. This method must return the modified version of the scene.

String get_source_file<>():String
Returns the source file path which got imported (e.g. res://scene.dae).




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...