-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Retain meta data set on importer nodes #87584
Conversation
I've updated this pull request to be more thorough with copying over meta data on various imported nodes, not just ImporterMeshInstance3D. |
I've updated the pull request to also copy over metadata from ImporterMesh to ArrayMesh. In addition to ImporterMeshInstance3D, ImporterMesh is the other intermediary class used where metadata set in a GLTFDocumentExtension would be lost. Here's an example use case in a GLTFDocumentExtension that copies over the func _apply_extras_to_meshes(state: GLTFState) -> void:
for index: int in range(state.meshes.size()):
var extras: Dictionary = state.json.meshes[index].get("extras", {})
var mesh: GLTFMesh = state.meshes[index]
_apply_extras_to_meta(state, mesh.mesh, extras) This way, custom properties set in blender on the mesh data can be conveyed over to the godot side via gltf. |
Looks good and easily digestible so I think it should be safe in 4.3 - Would it be possible to implement the same change in https://github.com/godotengine/godot/blob/master/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.cpp |
Absolutely, I've updated the pull request source branch to reflect this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fix a source of confusion when working with import plugins. Great work!
During the import process, many importer nodes are replaced with their engine node counterparts. For example, ImporterMeshInstance3D is replaced with a MeshInstance3D node. Any meta data set on these importer nodes, i.e. through a GLTFDocumentExtension, are lost during the conversion. This change copies over any meta data set on these importer nodes to their engine counterparts.
Thanks! And congrats for your first merged Godot contribution 🎉 |
Wonderful, and thank you! |
During the import process, ImporterMeshInstance3D nodes are replaced with MeshInstance3D nodes. This change copies over any meta data that might have been set during the import process, for example, in a GLTFDocumentExtension.
This is a resolution for godotengine/godot-proposals#6586.