Skip to content

How to export VoxelLodTerrain or VoxelTerrain as glb, at runtime ? #831

@filemon-filemon

Description

@filemon-filemon

I use godot 4.5.1.stable, and am trying to export as glb the generated terrain at runtime.
When I use the method described in the documentation on a mesh, it works just fine, and when I use it on the VoxelLodTerrain, it prints a bugged glb file that seems empty.

My code is

func _input(_event: InputEvent) -> void:
	if Input.is_action_just_pressed("export"):
		var gltf_document_save := GLTFDocument.new()
		var gltf_state_save := GLTFState.new()
		gltf_document_save.append_from_scene($VoxelLodTerrain, gltf_state_save)
		gltf_document_save.write_to_filesystem(gltf_state_save, "user://test.glb")

Thank you so much !!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions