glTF-Blender-IO
glTF-Blender-IO copied to clipboard
Export: write custom attribute arrays for non-skinning vgroups
I've combined the facemap exports and vertex group exports from @scurest's work last year, and tested that this works on 3.0.0.
I haven't followed all of the changes and improvements since Nov 2020, however, so I'm not sure if this is still the ideal way to do things.
There are also a couple of places where a line of code has been commented out (e.g. gltf2_blender_gather_nodes.py has #vertex_groups = None
in a couple of places). We should probably decide what we want to happen--either remove it, or improve it?
#1232
There are also a couple of places where a line of code has been commented out (e.g. gltf2_blender_gather_nodes.py has #vertex_groups = None in a couple of places). We should probably decide what we want to happen--either remove it, or improve it?
We can't remove it, it will lead to miss cache in some situation The solution is to use a custom cache, as I started to implement (based in scurest suggestion) in vtree branch. This will be nedded also for other requests (see #900 #747 #1245)
Ok, cool, so this PR should wait until your work there on custom caches is done? If I understand #1245 is the ticket to watch.
It does not require a custom cache. It will also not cause a cache miss: if there are non-skinning vgroups, this branch always exports them, so since the vgroups are always used, it is correct that they are always part of the cache key. But I don't think it is good that they are always exported. If it's desirable to merge these features into mainline, I think they should be behind an export option, cf https://github.com/KhronosGroup/glTF-Blender-IO/issues/1232#issuecomment-705290610.
BTW, some other custom attribute can be exported, as requested by some blender devs. See #1505
Anyway, now that vertex groups are stored on mesh, no more on object, all this code needs (probably) to be refactored.
Anyway, now that vertex groups are stored on mesh, no more on object, all this code needs (probably) to be refactored.
Oh, that's right. vertex_groups = None
is always unnecessary now, since two instances of the same mesh always have the same vertex groups. It still has to be passed down though since there's no API for getting it off the mesh.
Plus one to the idea of adding this feature to the official exporter (as an export option)!
Plus one to the idea of adding this feature to the official exporter (as an export option)!
@julienduroure Are there any plans to do so? By the way, thanks for your amazing work!