Files
gamedev-the-steward/tools/import_storybook_grass.gd
T

13 lines
477 B
GDScript

extends SceneTree
## Run after Blender export and Godot import; the particle field requires a Mesh.
func _initialize() -> void:
var scene := load("res://assets/storybook/meadow_grass.glb") as PackedScene
var instance := scene.instantiate()
var grass := instance.find_child("Grass", true, false) as MeshInstance3D
assert(grass != null)
var error := ResourceSaver.save(grass.mesh, "res://assets/storybook/meadow_grass.res")
instance.free()
quit(0 if error == OK else 1)