Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when generating multiple Godot scenes from one GLTFState #80832

Closed
aaronfranke opened this issue Aug 20, 2023 · 0 comments · Fixed by #80831
Closed

Error when generating multiple Godot scenes from one GLTFState #80832

aaronfranke opened this issue Aug 20, 2023 · 0 comments · Fixed by #80831

Comments

@aaronfranke
Copy link
Member

aaronfranke commented Aug 20, 2023

Godot version

Latest master 4.2.dev 5444afa

System information

macOS 13.4.1

Issue description

The GLTF code has the file parsing and node generation steps split up. This should allow generating multiple Godot scenes from the same imported GLTF file. However, this does not currently work as expected. Example GDScript code:

func _ready() -> void:
	var gltf_document := GLTFDocument.new()
	var gltf_state := GLTFState.new()
	gltf_document.append_from_file("res://mannequiny-0.3.0.glb", gltf_state)
	var scene_node: Node = gltf_document.generate_scene(gltf_state)
	add_child(scene_node)
	scene_node = gltf_document.generate_scene(gltf_state)
	add_child(scene_node)

Basically, the Godot node generation should all be happening in the orange circle, but the current code has a problem where some of it is happening in the red circle:

Godot GLTF import

Steps to reproduce

Open the minimal reproduction project and hit the play button. The project contains the above code.

With the current master: Godot crashes.

With only #80272: The second scene is missing a skeleton, and errors are spammed in the console.

With both #80272 and #80831: Both scenes have a skeleton (the correct behavior).

Minimal reproduction project

GLTFGenerateMultipleScenes.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants