From d4ccc8de7924091e004109abd92fa0f6e7124f0c Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 20 Dec 2024 19:04:56 +0100 Subject: [PATCH] Fix incorrect handling of skinned meshes as mesh nodes fixes #15576 --- src/nodedef.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/nodedef.cpp b/src/nodedef.cpp index 81348cf23..2f0307d11 100644 --- a/src/nodedef.cpp +++ b/src/nodedef.cpp @@ -13,6 +13,7 @@ #include "client/texturesource.h" #include "client/tile.h" #include +#include #endif #include "log.h" #include "settings.h" @@ -953,6 +954,12 @@ void ContentFeatures::updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc infostream << "ContentFeatures: recalculating normals for mesh " << mesh << std::endl; meshmanip->recalculateNormals(mesh_ptr, true, false); + } else { + // Animation is not supported, but we need to reset it to + // default state if it is animated. + // Note: recalculateNormals() also does this hence the else-block + if (mesh_ptr->getMeshType() == scene::EAMT_SKINNED) + ((scene::SkinnedMesh*) mesh_ptr)->resetAnimation(); } } }