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.5k stars 319 forks source link

Support Import/Export of Morphed `Texcoord_n` and `Color_n` Attributes #1661

Open ptasev opened 2 years ago

ptasev commented 2 years ago

Is your feature request related to a problem? Please describe. The glTF spec allow for morph targets to be texture coords and colors. Blender does not appear to support importing or exporting such morph targets, nor animations for them.

Describe the solution you'd like Support for importing and exporting animated morph targets for Texcoord_n and Color_n.

Client implementations SHOULD support at least three attributes — POSITION, NORMAL, and TANGENT — for morphing. Client implementations MAY optionally support morphed TEXCOORD_n and/or COLOR_n attributes. https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#morph-targets

Describe alternatives you've considered I've tried with BabylonJS Cesium and ThreeJS and they don't appear to support this either. Also, it appears the glTF validator marks such a file as invalid despite the spec saying a client may choose to support such a model https://github.khronos.org/glTF-Validator/

Additional context I have attached a sample file with animated Texcoord_0 morph target in both glb, and gltf format.

MorphTargetTexCoords.zip

scurest commented 2 years ago

How would they be imported into Blender?

ptasev commented 2 years ago

I'll have to rely on your expertise here. I'm not a graphics artist so I'm not sure of the features in Blender.

julienduroure commented 2 years ago

I may miss something, but I think you can't change vertex color or tex coord on shapekeys, so I don't know how you can import/export it to/from Blender

ptasev commented 2 years ago

You're probably right. It seems it's possible with this add-on that appears to come with Blender, but I don't know if that's helpful here.

https://docs.blender.org/manual/en/latest/addons/animation/animall.html

UVs in demonstration video of add-on: https://youtu.be/xlJ71XChDuY?t=866

Vertex Colors: https://youtu.be/xlJ71XChDuY?t=1068