You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Merge pull request #61486 from jtnicholl/import_script_templates
Add script templates for EditorScenePostImport
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
# meta-description: Basic import script template
|
||||||
|
@tool
|
||||||
|
extends EditorScenePostImport
|
||||||
|
|
||||||
|
|
||||||
|
# Called by the editor when a scene has this script set as the import script in the import tab.
|
||||||
|
func _post_import(scene: Node) -> Object:
|
||||||
|
# Modify the contents of the scene upon import. For example, setting up LODs:
|
||||||
|
# (scene.get_node(^"HighPolyMesh") as MeshInstance3D).draw_distance_end = 5.0
|
||||||
|
# (scene.get_node(^"LowPolyMesh") as MeshInstance3D).draw_distance_begin = 5.0
|
||||||
|
return scene # Return the modified root node when you're done.
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# meta-description: Basic import script template (no comments)
|
||||||
|
@tool
|
||||||
|
extends EditorScenePostImport
|
||||||
|
|
||||||
|
|
||||||
|
func _post_import(scene: Node) -> Object:
|
||||||
|
return scene
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// meta-description: Basic import script template
|
||||||
|
|
||||||
|
#if TOOLS
|
||||||
|
using _BINDINGS_NAMESPACE_;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
[Tool]
|
||||||
|
public partial class _CLASS_ : _BASE_
|
||||||
|
{
|
||||||
|
public override Object _PostImport(Node scene)
|
||||||
|
{
|
||||||
|
// Modify the contents of the scene upon import. For example, setting up LODs:
|
||||||
|
// scene.GetNode<MeshInstance3D>("HighPolyMesh").DrawDistanceEnd = 5.0
|
||||||
|
// scene.GetNode<MeshInstance3D>("LowPolyMesh").DrawDistanceBegin = 5.0
|
||||||
|
return scene // Return the modified root node when you're done.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
// meta-description: Basic import script template (no comments)
|
||||||
|
|
||||||
|
#if TOOLS
|
||||||
|
using _BINDINGS_NAMESPACE_;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
[Tool]
|
||||||
|
public partial class _CLASS_ : _BASE_
|
||||||
|
{
|
||||||
|
public override Object _PostImport(Node scene)
|
||||||
|
{
|
||||||
|
return scene
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user