Fix fill paint tool to keep in sync the staticmesh component painted vertices cache buffer.

#jira UE-72315
#rb bob.tellez

#ROBOMERGE-OWNER: lina.halper
#ROBOMERGE-AUTHOR: alexis.matte
#ROBOMERGE-SOURCE: CL 5798957 via CL 5798962 via CL 5798963 via CL 5799892 via CL 5799967
#ROBOMERGE-BOT: ANIM (Main -> Dev-Anim)

[CL 5802765 by alexis matte in Dev-Anim branch]
This commit is contained in:
alexis matte
2019-04-08 21:08:19 -04:00
parent 89b1f9967b
commit 326209caeb

View File

@@ -795,6 +795,11 @@ void MeshPaintHelpers::SetInstanceColorDataForLOD(UStaticMeshComponent* MeshComp
// Initialize vertex buffer from given colors
ComponentLodInfo.OverrideVertexColors = new FColorVertexBuffer;
ComponentLodInfo.OverrideVertexColors->InitFromColorArray(Colors);
//Update the cache painted vertices
ComponentLodInfo.PaintedVertices.Empty();
MeshComponent->CachePaintedDataIfNecessary();
BeginInitResource(ComponentLodInfo.OverrideVertexColors);
}
}
@@ -851,6 +856,10 @@ void MeshPaintHelpers::SetInstanceColorDataForLOD(UStaticMeshComponent* MeshComp
}
}
//Update the cache painted vertices
ComponentLodInfo.PaintedVertices.Empty();
MeshComponent->CachePaintedDataIfNecessary();
BeginInitResource(ComponentLodInfo.OverrideVertexColors);
}
}
@@ -1508,6 +1517,10 @@ void MeshPaintHelpers::ImportVertexColorsToStaticMeshComponent(UStaticMeshCompon
InstanceMeshLODInfo.OverrideVertexColors->VertexColor(VertexIndex) = PickVertexColorFromTextureData(MipData, UV, Texture, ColorMask);
}
//Update the cache painted vertices
InstanceMeshLODInfo.PaintedVertices.Empty();
StaticMeshComponent->CachePaintedDataIfNecessary();
BeginInitResource(InstanceMeshLODInfo.OverrideVertexColors);
}
else