| 33 | /** Compute an MD5 hash string from raw vertex + index data. */ |
| 34 | template <typename VertexType, typename IndexType> |
| 35 | inline FString ComputeMeshHash(const TArray<VertexType>& Vertices, const TArray<IndexType>& Indices) |
| 36 | { |
| 37 | FMD5 Md5; |
| 38 | if (Vertices.Num() > 0) |
| 39 | { |
| 40 | Md5.Update((const uint8*)Vertices.GetData(), Vertices.Num() * sizeof(VertexType)); |
| 41 | } |
| 42 | if (Indices.Num() > 0) |
| 43 | { |
| 44 | Md5.Update((const uint8*)Indices.GetData(), Indices.Num() * sizeof(IndexType)); |
| 45 | } |
| 46 | FMD5Hash Hash; |
| 47 | Hash.Set(Md5); |
| 48 | return LexToString(Hash); |
| 49 | } |
| 50 | |
| 51 | /** Save a hash string to a .hash file alongside the OBJ. */ |
| 52 | inline void SaveMeshHash(const FString& ObjFilePath, const FString& Hash) |