You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like there is no exporter hook that exists that can be used to modify the gltf2_io.Animation object. There are hooks for modifying its constituent objects, but none for the object itself.
samplers=[], # This will be generated later, in link_samplers
extensions=None
)
I know that there is pre_gather_animation_hook, but that doesn't grant access to the final object (for obvious reasons..)
I'm trying to make a plugin that renames the glTF animations as they are exported, without changing the name of the associated Blender actions. I want this because our studio is making use of Blender's Collection Exporters feature, and so there is a one-to-many relationship between Blend files and models our game engine sees. (doors.blend may produce "door.glb", "double-door.glb", "sliding-door.glb", etc.)
The issue is that Blender forces name uniqueness across the entire blend file, even though each object might have its own animation. For cleanliness, we'd like to solve this issue in the exporter, so that our .glb files each contain an animation with a consistent name, like "Open", "Close", rather than "Open.001", "Close.004", etc. This is of course solvable on the engine side as well by making the code that finds the animations more complex, but we'd like to consider that as a last resort.
By the way, if this is solvable with the existing export hooks and I just missed something, please let me know!
The text was updated successfully, but these errors were encountered:
After looking at the code some more, maybe an alternative solution that could work is to add a name field to the ActionData object, and copy the Blender Action name into that object when the ActionData is created. Then, when the gltf2_io.Animation object is created, copy the name from the ActionData.name field. This way, I can rename glTF animations as they are exported without the need to add a new hook for plugins, by using the existing gather_actions_hook.
Willing to make a PR for this pending feedback from project management!
It seems like there is no exporter hook that exists that can be used to modify the
gltf2_io.Animation
object. There are hooks for modifying its constituent objects, but none for the object itself.I think it'd go somewhere around here?
glTF-Blender-IO/addons/io_scene_gltf2/blender/exp/animation/action.py
Lines 656 to 663 in d66ec14
I know that there is
pre_gather_animation_hook
, but that doesn't grant access to the final object (for obvious reasons..)I'm trying to make a plugin that renames the glTF animations as they are exported, without changing the name of the associated Blender actions. I want this because our studio is making use of Blender's Collection Exporters feature, and so there is a one-to-many relationship between Blend files and models our game engine sees. (doors.blend may produce "door.glb", "double-door.glb", "sliding-door.glb", etc.)
The issue is that Blender forces name uniqueness across the entire blend file, even though each object might have its own animation. For cleanliness, we'd like to solve this issue in the exporter, so that our .glb files each contain an animation with a consistent name, like "Open", "Close", rather than "Open.001", "Close.004", etc. This is of course solvable on the engine side as well by making the code that finds the animations more complex, but we'd like to consider that as a last resort.
By the way, if this is solvable with the existing export hooks and I just missed something, please let me know!
The text was updated successfully, but these errors were encountered: