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. |
lyuma
left a comment
There was a problem hiding this comment.
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! |
Retain meta data set on importer nodes
Retain meta data set on importer nodes
Retain meta data set on importer nodes
Retain meta data set on importer nodes
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.