Fix incorrect handling of skinned meshes as mesh nodes

fixes #15576
This commit is contained in:
sfan5 2024-12-20 19:04:56 +01:00
parent 7bf0b1fc7e
commit d4ccc8de79

@ -13,6 +13,7 @@
#include "client/texturesource.h" #include "client/texturesource.h"
#include "client/tile.h" #include "client/tile.h"
#include <IMeshManipulator.h> #include <IMeshManipulator.h>
#include <SkinnedMesh.h>
#endif #endif
#include "log.h" #include "log.h"
#include "settings.h" #include "settings.h"
@ -953,6 +954,12 @@ void ContentFeatures::updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc
infostream << "ContentFeatures: recalculating normals for mesh " infostream << "ContentFeatures: recalculating normals for mesh "
<< mesh << std::endl; << mesh << std::endl;
meshmanip->recalculateNormals(mesh_ptr, true, false); 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();
} }
} }
} }