diff options
author | Jonathan Nicholl <jonathantnicholl@gmail.com> | 2022-05-28 00:09:41 -0400 |
---|---|---|
committer | Jonathan Nicholl <jonathantnicholl@gmail.com> | 2022-06-15 12:41:37 -0400 |
commit | 912d8e23ca4d01e242eda386e420175329113d5b (patch) | |
tree | 960e22ca0a24e8f4a4555c6adb045404d6ba1b10 /modules/gdscript | |
parent | 1f690f197a4fb0809afb2f59bf78e4d3d89fd847 (diff) |
Add script templates for EditorScenePostImport
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/editor/script_templates/EditorScenePostImport/basic_import_script.gd | 11 | ||||
-rw-r--r-- | modules/gdscript/editor/script_templates/EditorScenePostImport/no_comments.gd | 7 |
2 files changed, 18 insertions, 0 deletions
diff --git a/modules/gdscript/editor/script_templates/EditorScenePostImport/basic_import_script.gd b/modules/gdscript/editor/script_templates/EditorScenePostImport/basic_import_script.gd new file mode 100644 index 0000000000..b4b2305b8c --- /dev/null +++ b/modules/gdscript/editor/script_templates/EditorScenePostImport/basic_import_script.gd @@ -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. diff --git a/modules/gdscript/editor/script_templates/EditorScenePostImport/no_comments.gd b/modules/gdscript/editor/script_templates/EditorScenePostImport/no_comments.gd new file mode 100644 index 0000000000..875afb4fc0 --- /dev/null +++ b/modules/gdscript/editor/script_templates/EditorScenePostImport/no_comments.gd @@ -0,0 +1,7 @@ +# meta-description: Basic import script template (no comments) +@tool +extends EditorScenePostImport + + +func _post_import(scene: Node) -> Object: + return scene |