From 799da630e416a97f1dbb08f7bcfd54d675d68d8a Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Sat, 7 Oct 2023 00:02:39 +0300 Subject: [PATCH] CopyRigVisitor: don't copy unskinned geometry (bug #5280) --- CHANGELOG.md | 1 + components/sceneutil/attach.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index facb9df9e5..01dc0c33f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Bug #4816: GetWeaponDrawn returns 1 before weapon is attached Bug #5057: Weapon swing sound plays at same pitch whether it hits or misses Bug #5129: Stuttering animation on Centurion Archer + Bug #5280: Unskinned shapes in skinned equipment are rendered in the wrong place Bug #5371: Keyframe animation tracks are used for any file that begins with an X Bug #5714: Touch spells cast using ExplodeSpell don't always explode Bug #5849: Paralysis breaks landing diff --git a/components/sceneutil/attach.cpp b/components/sceneutil/attach.cpp index c855c9a458..1c21221ac4 100644 --- a/components/sceneutil/attach.cpp +++ b/components/sceneutil/attach.cpp @@ -10,6 +10,8 @@ #include #include +#include +#include #include #include "visitor.hpp" @@ -37,6 +39,12 @@ namespace SceneUtil return; const osg::Node* node = &drawable; + bool isRig = dynamic_cast(node) != nullptr; + if (!isRig) + isRig = dynamic_cast(node) != nullptr; + if (!isRig) + return; + for (auto it = getNodePath().rbegin() + 1; it != getNodePath().rend(); ++it) { const osg::Node* parent = *it;