[Bf-committers] Proposing a unique ID for Blender objects system, for use with game engines.

Lissanro Rayen Lissanro at Dragon.Studio
Sun Nov 22 18:04:45 CET 2020


In theory, you are right. But in practice, chance of collision in many 
real-world scenarios is 100%. As an example, consider the following 
scenario:

I have a .blend with some objects ("A"), all objects in it already have 
generated UUID. I open the file, edit something, save as different file 
("B"). Then again I open the original file, and save it under different 
name ("C"). Then I create new empty file and append objects from "B" and 
"C". If I append the same object from both files, there will be UUID 
collision. But this is not an issue as long as there is a check to make 
sure that each appended or duplicated object has unique UUID in the 
scope of the current .blend file, and if not, just reset its UUID (it 
can be generated later on demand if necessary). I think this is 
preferable to blindly regenerating (or dropping) UUIDs, since if there 
is no collisions, I may have a reason to preserve UUIDs as is when 
appending my objects. Besides, Blender already does collision detection 
for object names to automatically rename them if it happens. But for 
UUID, it is safe to just invalidate it if it conflicts with another UUID 
of already existing data block, and generate a new one later when necessary.

On 21/11/20 6:33 pm, Harley Acheson via Bf-committers wrote:
>> It would be impossible task to make them truly unique across all .blend
> files, there are always a possibility of collision.
>> UUIDs have limitations...will not change unless there is a collision).
> That does not sound right.
>
> If 128-bit UUID are implemented properly according to standard, the chances
> of collision is *zero* *for all practical purposes*. The chances of
> collision are so low that implementations can ignore it. To get to a 50%
> probability of at least one collision you need to create 2.71 quintillion -
> so generating a billion of them per second for 85 years.  Just to get a
> one-in-a-billion chance of a duplicate requires making 103 trillion.
>
> Cheers, Harley
> _______________________________________________
> 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