[Bf-committers] File VERSION -> MINVERSION

Holger Machens homac at strace.org
Sun Dec 1 01:02:35 CET 2019


thank you for your answer, Sergey Sharybin.

To summarize:

    MINVERSION refers to the minimum Blender version required to
    read that particular file.

I thought about it and then I noticed the following:

Given the case I described before: Different struct layout in version
2.80 and 2.81. How does Blender in version 2.80 deal with the changed
struct layout in a file of version 2.81?

I could think of three options:

    a) Future changes for 2.81 have already been considered in 2.80 and
       conversion code exists in blenloader/intern/versioning_2_81.c in
       blender 2.80. (probably not)

    b) Blender 2.80 did not use those structs or attributes which
       got moved in position, even though those already existed in
       that version.

    c) Those structs are used in memory only and get never stored in a
       file, even though their type is declared in block DNA1.

This question is interesting, because (b) and (c) would also mean, that
(theoretically) data of a .blend file of v2.80 can also be stored in DNA
structs of v2.81 without conversion  and  without loss of information.
Thus, I could always use a pointer on struct of v2.81 and point it on
data of v2.80 and get the same (old) information. Is that correct?

This would have some implications I would like to clarify in my 
documentation. That's why I try to get this right.

Kind regards
  Holger Machens

On 30.11.19 19:58, Sergey Sharybin wrote:
> Hi,
> This is a part of forward compatibility (ability to open newer files in
> older Blender versions).
> Most of the time opening newer files does what you would expect, but in
> others there is a huge data loss. For example, you can not open 2.8x files
> in 2.7x because older Blender versions are not aware of Collections, and
> old Layers are not stored in .blend file.
> You can, however, open 2.82 and 2.81 files in Blender 2.80 (there might be
> minor differences in final render due to changes in shaders, but nothing
> too drastic).
> Hence the miniversion of 2.80.
> P.S. As far as i remember, it is only used to communicate users that the
> file is too new, and no extra logic on read/write is dependent on the
> miniversion.
> On Sat, Nov 30, 2019 at 2:26 PM Holger Machens <homac at strace.org> wrote:
>> Hello folks!
>> TLDR question:
>>          What is the meaning of the attributes
>>          minversion and minsubversion in DNA
>>          struct FileGlobal?
>>          (ref: source/makesdna/DNA_fileglobal_types.h)
>> Too Long Explanation:
>> I've just updated my Java API (Java .Blend) to reflect recent DNA
>> changes in release 2.81-16. I've noticed, that BLENDER_MINVERSION still
>> refers to release 2.80-0 while some changes in the DNA of release 2.81-x
>> render older files incompatible on a binary level. For example some
>> attributes of structs in the DNA exchanged their position or new
>> attributes were added inbetween existing attributes, which also changes
>> the relative position of other attributes in the data structure. Thus,
>> you cannot just use a pointer to a C struct of version 2.81 to interpret
>> the data of a C struct in version 2.80. But it would have been possible
>> if attributes were only added to the end of a struct only for example.
>> I looked in the source code and read the recent manual but didn't find
>> an explanation regarding the meaning of MINVERSION and MINSUBVERSION.
>> According to my observations, I have to assume, that files in the range
>> from MINVERSION to VERSION are not meant to be binary compatible with
>> each other. On the other hand, Blender can read and translate Blender
>> files from much older versions than 2.80 for example. Thus, I wonder
>> what purpose the MINVERSION in the global files structure has. Is it
>> eventually going to be removed in future releases?
>> Thanks in advance
>>    Holger Machens
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at blender.org
>> https://lists.blender.org/mailman/listinfo/bf-committers

More information about the Bf-committers mailing list