castle-engine / castle-model-viewer

Viewer for many 3D and 2D model formats: glTF, X3D, VRML, Collada, 3DS, MD3, Wavefront OBJ, STL, Spine JSON, sprite sheets in Cocos2D and Starling XML formats
https://castle-engine.io/castle-model-viewer
88 stars 18 forks source link

Please provide HAnim related info in conversions from glTF as metadata #60

Open coderextreme opened 10 months ago

coderextreme commented 10 months ago

Please provide HAnim information, if provided in glTF, as Metadata in X3D (VRML and XML). At a minimum, try to identify HAnimJoints and HAnimHumanoid info, like any extra information in glTF exports from Blender that might be useful . I will work on Python exports of Armature, Bones, Animation and skin coord info from Blender. I’m not promising an X3D solution at this time, just humanoids in some form, with ChatGPT help.

michaliskambi commented 9 months ago

See the https://github.com/michaliskambi/x3d-tests/wiki/Converting-glTF-to-X3D about what we do now, and what we plan to do with regards to skinned animation in CGE/view3dscene.

I'll see how to expose this without adding much work. Maybe metadata, maybe some new node like "SkinAnimation" (that, at least for start, would be considered just internal / not-guaranteed-to-be-always-available). We have internally skin joints and skin weights, from glTF.

To be clear, this will not imply converting glTF -> H-Anim, at least not in the initial implementation. Again, see https://github.com/michaliskambi/x3d-tests/wiki/Converting-glTF-to-X3D#skinned-mesh-animation about our plans -- we are not 100% certain if we'll convert glTF skinned animation to H-Anim, or just to something special (like "SkinAnimation" node), in CGE. That is: We know it's possible to convert glTF skinned animation to H-Anim, but we don't know if it will be efficient for CGE needs, which include "efficient usage of glTF information for skinned animation", since almost all CGE users now use skinned animation through glTF (not H-Anim).

But we can naturally expose joints and weight information from glTF in one way or another, to be available for software reading about X3D, so sure we'll do this.

coderextreme commented 9 months ago

I guess I lost my comment. What is critical right now is adding a place for an HAnimHumanoid node (Could be a Transform or MetadataString where HAnimHumanoid node will go) in glTF conversions to VRML.