From e33f867bffc647aa47056530cb7dc60ad47832ff Mon Sep 17 00:00:00 2001 From: helirang Date: Fri, 5 Jun 2026 15:31:06 +0900 Subject: [PATCH 1/2] Fix vertex color not being applied to imported meshes - Fixed FLinearColor to FColor conversion using ToFColor(false) to prevent value scaling issues - Added logic to automatically apply SetHasVertexColors(true) on SkeletalMesh if vertex color data exists --- Source/VRM4ULoader/Private/VrmConvertModel.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/VRM4ULoader/Private/VrmConvertModel.cpp b/Source/VRM4ULoader/Private/VrmConvertModel.cpp index 5c24dae7..b58681fa 100644 --- a/Source/VRM4ULoader/Private/VrmConvertModel.cpp +++ b/Source/VRM4ULoader/Private/VrmConvertModel.cpp @@ -1221,6 +1221,11 @@ bool VRMConverter::ConvertModel(UVrmAssetListObject *vrmAssetList) { TArray meshWeight; auto &mInfo = result.meshInfo[meshID]; + // VertexColor Override Allow + if (0 < mInfo.VertexColors.Num() && sk->GetHasVertexColors() == false) { + sk->SetHasVertexColors(true); + } + for (int i = 0; i < mInfo.Vertices.Num(); ++i) { FSoftSkinVertexLocal *meshS = new(meshWeight) FSoftSkinVertexLocal(); *meshS = softSkinVertexLocalZero; @@ -1285,7 +1290,8 @@ bool VRMConverter::ConvertModel(UVrmAssetListObject *vrmAssetList) { if (i < mInfo.VertexColors.Num()) { auto &c = mInfo.VertexColors[i]; - meshS->Color = FColor(c.R, c.G, c.B, c.A); + //Convert FLinearColor (0.0 - 1.0) to FColor (0 - 255) + meshS->Color = c.ToFColor(false); } FSoftSkinVertexLocal &s = Weight[currentVertex + i]; From cb29ff5bc5b519e1894edb4b54ca0c3e00a93722 Mon Sep 17 00:00:00 2001 From: helirang Date: Fri, 5 Jun 2026 17:01:34 +0900 Subject: [PATCH 2/2] safely support UE5 API --- Source/VRM4ULoader/Private/VrmConvertModel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/VRM4ULoader/Private/VrmConvertModel.cpp b/Source/VRM4ULoader/Private/VrmConvertModel.cpp index b58681fa..00df653e 100644 --- a/Source/VRM4ULoader/Private/VrmConvertModel.cpp +++ b/Source/VRM4ULoader/Private/VrmConvertModel.cpp @@ -1221,11 +1221,12 @@ bool VRMConverter::ConvertModel(UVrmAssetListObject *vrmAssetList) { TArray meshWeight; auto &mInfo = result.meshInfo[meshID]; +#if UE_VERSION_NEWER_THAN_OR_EQUAL(5,0,0) // VertexColor Override Allow if (0 < mInfo.VertexColors.Num() && sk->GetHasVertexColors() == false) { sk->SetHasVertexColors(true); } - +#endif for (int i = 0; i < mInfo.Vertices.Num(); ++i) { FSoftSkinVertexLocal *meshS = new(meshWeight) FSoftSkinVertexLocal(); *meshS = softSkinVertexLocalZero;