Download

Is there any way to consistently serialize a UObject?

I’m serializing UObjects and hashing the result to try to detect changes - if a particular object has changed since the last time I looked at it, I need to re-generate some data.

I’m serializing like this:


TArray<uint8> Bytes;
FObjectWriter Ar(Obj, Bytes);
MD5Gen.Update(Bytes.GetData(), Bytes.Num());
// etc

But I get a different result for the same object each time I open the Editor. I’ve found a bunch of flags for the archive which I’ve experimented with, and which sometimes give different outputs, but none of these outputs seem to be consistent (and there’s far too many combinations and too little documentation to figure out the magic combination, if it exists).

Is there any way to serialize objects so that the result of the serialization is consistent?