From c041a36286bc98e3b265bf37dfcebab191efb659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 17 Apr 2023 16:21:33 +0200 Subject: [PATCH] Fix #91966: Alembic/USD export ignores bone parent animation For non-object parents (so bones & vertices), the parent is now also explicitly checked for animation. In other words: having an animated parent will cause the transform of the child to be written to Alembic/USD on every frame (as if it is animated itself). --- .../blender/io/common/intern/abstract_hierarchy_iterator.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/blender/io/common/intern/abstract_hierarchy_iterator.cc b/source/blender/io/common/intern/abstract_hierarchy_iterator.cc index d93f3342e53..737f22ebcd4 100644 --- a/source/blender/io/common/intern/abstract_hierarchy_iterator.cc +++ b/source/blender/io/common/intern/abstract_hierarchy_iterator.cc @@ -485,6 +485,12 @@ void AbstractHierarchyIterator::context_update_for_graph_index( { /* Update the HierarchyContext so that it is consistent with the graph index. */ context->export_parent = graph_index.object; + + /* If the parent type is such that it cannot be exported (at least not currently to USD or + * Alembic), always check the parent for animation. */ + const short partype = context->object->partype & PARTYPE; + context->animation_check_include_parent |= ELEM(partype, PARBONE, PARVERT1, PARVERT3, PARSKEL); + if (context->export_parent != context->object->parent) { /* The parent object in Blender is NOT used as the export parent. This means * that the world transform of this object can be influenced by objects that