EditorScenePostImport¶
类别: 核心
简要说明¶
导入后处理场景。
方法¶
get_source_file ( ) const |
|
get_source_folder ( ) const |
|
post_import ( Object scene ) virtual |
描述¶
导入的场景可以在导入后通过设置其 自定义脚本 将属性导入到 tool
从此类继承的脚本。
这个 post_import 回调接收导入场景的根节点,并返回场景的修改版本。用法示例:
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)