iimachines / Maya2glTF

Maya to glTF 2.0 exporter
MIT License
323 stars 49 forks source link

Export only selected nodes without meshes. #147

Open 1fth3n3ls3 opened 3 years ago

1fth3n3ls3 commented 3 years ago

In my current project we usually save animation files in separate files. This animations are applied to a "static" model who contains meshes with or without skin info, nodes (cameras or locators) and deformer nodes (if mesh is skinned). Animation files usually doesn't contain meshes, just the info of animated nodes. That way the files size is way less than if the meshes were included. Usually a character can have hundreds of animation files. So in the end be able to only export animated nodes without meshes is huge. I don't know if it would be possible to implement that feature to the exporter. I think, being able to export only animatied nodes without meshes is quite common, so more people could benefit from it. So I really hope you could consider the posibility to add it to the current exporter.

ziriax commented 3 years ago

That feature is actually already "partially" implemented in the exporter, but has never been fully tested.

Also, GLTF unfortunately doesn't have a "animation only" file format, so the approach below might not be ideal for you.

So here's my approach.

Basically: export the mesh scene once to a GLTF file, and export each animation scene to a single GLTF file.

Details:

So in summary, to get started, try exporting with -sma -hbu -sbr or -sma -hbu -sbr -fac and see what this gives for you. Then either write your own code to load and re-assemble these, or use the ModelClipMerger tool to do this for you, statically.

This repository also contains MEL scripts for bulk exporting many Maya scenes at once, generating GIFs from Playblasts, etc...

This is all experimental.

PS: If commercial support is needed, feel free to request this, my company offers this.

1fth3n3ls3 commented 3 years ago

Thank you Ziriax for the detailed explanation on how to workaround this issue. I will let you know my advances in it.