2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-12 19:47:27 +00:00

chore: set vertex color to 1.0 when no value read from gltf

This commit is contained in:
Jan
2024-09-05 19:18:49 +02:00
parent db5e53e60d
commit 71819e46a4
3 changed files with 100 additions and 1 deletions

View File

@@ -214,6 +214,7 @@ namespace
const auto vertexCount = positionAccessor->GetCount();
NullAccessor nullAccessor(vertexCount);
OnesAccessor onesAccessor(vertexCount);
// clang-format off
auto* normalAccessor = GetAccessorForIndex(
@@ -237,7 +238,7 @@ namespace
accessorsForVertex.colorAccessor,
{JsonAccessorType::VEC3, JsonAccessorType::VEC4},
{JsonAccessorComponentType::FLOAT, JsonAccessorComponentType::UNSIGNED_BYTE, JsonAccessorComponentType::UNSIGNED_SHORT}
).value_or(&nullAccessor);
).value_or(&onesAccessor);
VerifyAccessorVertexCount("COLOR_0", colorAccessor, vertexCount);
auto* jointsAccessor = GetAccessorForIndex(