For understanding Blender better, I'd like to decode what's in a
If the output were usable as input to a text-based
diff program, that would be perfect (allowing to compare different files).
I'm aware that these
.blend files may contain binary data, and I saw unanswered question "Compare two blender files".
If there'd be a mapping of "
.blend -> text representation ->
.blend" (re-creating the original file from the text representation), I could even version-control
.blend files (a real-life requirement IMHO).
After many hours of programming I'm closer to a solution, but I'm having trouble with some "pointers", having many diffs like this:
-Bone.Bone DATA.*parent 29ce15fe9788 +Bone.Bone DATA.*parent 29cd1e23ad88
I did already try to convert absolute pointers to relative ones, but I'm unsure where pointers actually point to: Inside file-blocks only, or even across file-blocks? (I did not resolve pointers yet)
The other thing is how to interpret pointers. For example right at the start of a file I have:
# First line is the whole Link struct, then a relative dump for each component # The decoding is "types names" where each is hierarchic, not actual C syntax 0024: 01 00 00 00 fa 00 00 00 53 63 65 6e 65 00 00 00 |........ Scene...| 0000: 01 00 00 00 fa 00 00 00 |........ | Link.Link REND.*next fa00000001 0008: 53 63 65 6e 65 00 00 00 |Scene... | Link.Link REND.*prev 656e656353
So there are (unless my decoding is wrong) two pointers,
*prev; the first looks more or less OK (despite of being unaligned), but the second looks very much like a text string. So what is the magic with these pointers?
Other pointers look different:
# the pointers below are decoded relative to some base address... 0008: 48 64 f8 05 cf 7f 00 00 28 66 f8 05 cf 7f 00 00 |Hd...... (f......| 0000: 48 64 f8 05 cf 7f 00 00 |Hd...... | IDProperty.IDPropertyData.ListBase.void DATA.data.group.*first 29cd1f16e8c8 0008: 28 66 f8 05 cf 7f 00 00 |(f...... | IDProperty.IDPropertyData.ListBase.void DATA.data.group.*last 29cd1f16eaa8