diff --git a/src/animation/rigging.cpp b/src/animation/rigging.cpp index d5e36a82c..c1d7a9e27 100644 --- a/src/animation/rigging.cpp +++ b/src/animation/rigging.cpp @@ -46,7 +46,8 @@ Skeleton::Skeleton(std::shared_ptr config) flags(config ? config->getBones().size() : 0), textures(), modelOverrides(config ? config->getBones().size() : 0), - visible(true) { + visible(true), + boneTints(config ? config->getBones().size() : 0, glm::vec4(1.0f)) { if (config == nullptr) { return; } @@ -99,6 +100,7 @@ void Skeleton::setConfig(std::shared_ptr rigConfig) { modelOverrides.resize(bonesCount); flags.resize(bonesCount); + boneTints.resize(bonesCount, glm::vec4(1.0f)); for (size_t i = 0; i < bonesCount; i++) { flags[i].visible = true; @@ -204,7 +206,7 @@ void SkeletonConfig::render( if (model) { batch.draw( skeleton.calculated.matrices[i], - skeleton.tint, + skeleton.tint * skeleton.boneTints[i], model, &skeleton.textures ); diff --git a/src/animation/rigging.hpp b/src/animation/rigging.hpp index a2bd11375..55d7fd8a7 100644 --- a/src/animation/rigging.hpp +++ b/src/animation/rigging.hpp @@ -86,6 +86,7 @@ namespace rigging { std::vector modelOverrides; bool visible; glm::vec4 tint {1.0f, 1.0f, 1.0f, 1.0f}; + std::vector boneTints; util::VecInterpolation<3, float> interpolation {false};