KhronosGroup / glTF-Blender-IO

Blender glTF 2.0 importer and exporter
https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html
Apache License 2.0
1.48k stars 316 forks source link

Custom quaternion and float4x4 attributes are not exported, Blender 4.2 #2295

Closed homoclient closed 1 week ago

homoclient commented 1 month ago

Describe the bug In Blender 4.2, when exporting a mesh with custom vertex attributes to gltf, its Quaternion and Float4x4 attributes are missing.

To Reproduce I have created a minimum project demonstrating this: a cube has 5 custom vertex attributes: "_foo_float": float "_foo_color": float rgba color "_foo_vec3": float vec3 "_foo_q4": quaternion "_foo_mat4x4": float4x4

  1. Open the project, run "set_attributes.py" in scripting window to assign random values to them.
  2. Select the cube, then File->Export->glTF 2.0, tick Include Selected Object, and Data->Mesh->Attributes, export.
  3. Check the content of generated gltf file. Custom attribute "_foo_q4" and "_foo_mat4x4" are missing. Both .glb and .gltf exporting have this issue. The other custom attributes are exported with correct values.

Expected behavior If working correctly, all custom attributes with their name starting with underscore will be exported.

Screenshots Attribute list: issue_0 "_foo_q4" and "_foo_mat4x4" are missing: issue_1

.blend file/ .gltf (mandatory) cube_with_attributes.zip

Version

Additional context Also, for some reason, importing the resultant cube.glb or cube.gltf model into blender will fail. I haven't tried on other blender versions and platforms.

julienduroure commented 1 month ago

Confirmed. Matrix custom attributes are new in 4.2, and I didn't manage it yet in this exporter. Setting as enhancement