Add UUID to Blender data-blocks #83019
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
12 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#83019
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Having UUIDs to reference data-blocks of Blender would help in some cases with interaction with third party tools, especially when relations between different types of data storage is needed, and handling renaming of data-blocks across those is not possible.
This design task is here to define what would be expected from such feature, and how various issues should be addressed.
See also this ML discussion.*Disclaimer: this is a draft design proposal currently.//
Core Ideas
** Think we should still store them as a systematic fixed chunk of data in the ID block in the .blend file though (being zeroed for non-generated ones), to ease their retrieval from third-party code 'parsing' .blend files?
Issues to Investigate
Collision and Uniqueness
UUIDs should be absolutely unique withing a .blend file. This would be easy to ensure.Linkeddata-block would not be concerned by this, since they belong to another .blend file. UUIDs should be reasonably unique across .blend files.
Creating new IDs from existing ones (internal copy, appending from a library, creating proxies or overrides from linked data) should nullify the UUID of the new data-block. 'Save file' operations explicitly creating a duplicate file (Save as, Save copy) should maybe enforce re-generating UUIDs?
*** .blend file duplication would be the main source of collision. Not sure how to deal with that case, besides offering the possibility of a manual re-generation of UUIDs by user?
*** If the 'file copy' case is solved, collision between different .blend files remains possible, though extremely unlikely.
Runtime IDs
Some system may generate a random number of data-blocks in a procedural way (e.g. from future geometry nodes evaluation.* Persistence of UUID in such IDs is probably not possible? We should then accept that it would need to be re-generated when nodetree re-create data-blocks?
*** This only concerns IDs that would be generated in Main database (and hence saved on disk), not runtime IDs.
Implementation Hints
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscribers: @mont29, @brecht
I don't think this is really important to take this into account, in general I don't think third-party code should be parsing .blend files. If they do I imagine they should be able to read arbitrary structs anyway.
It is easy, but if we want to make them unique across .blend files, then we probably use an algorithm where it's not so easy to ensure this. We could check for collisions, but the memory/performance cost is probably not worth it.
I think we can probably generate persistent IDs, by hashing the UUID of the original datablock with the persistent ID for instances somehow:
https://docs.blender.org/api/current/bpy.types.DepsgraphObjectInstance.html#bpy.types.DepsgraphObjectInstance.persistent_id
Added subscriber: @antont
Hi, just a simple comment: maybe the UUIDs are in a way not Blender core data, but more like saved information about a previous export. So consecutive exports to update the model in game engine or BIM tool could manage the update in the import respectively. Blender already has internal IDs which are unique within the session. The idea to have optional UUIDs is in line with this thinking. I mean, an export can create the UUIDs when necessary, but Blender would then store them. Maybe there are no other consequences from this point of view.
The UUIDs could also be in just some exporter specific history data but it seems nice that Blender would support them internally so they'd show in the GUI the same way and it would be consistent for all exports (given they support UUIDs, what else besides BIM does?).
Added subscriber: @slumber
Added subscriber: @Calra
Added subscriber: @rjg
Added subscriber: @PhilippeCrassous
Added subscriber: @stilobique
That excalty my use case. It's a must have to use an implementation way. Nothing is design about a python use, expose this value with the BPY ?
@stilobique this would obviously be exposed to Python yes, through RNA system. only question here is how to do that (array of ints, hex string, ...), as stated in the task.
Added subscriber: @AquaticNightmare
Added subscriber: @zanqdo
Hi, this is a proposal for a UUID based linking system which would be essentially unbreakable, unlike the flimsy absolute or relative paths
https://youtu.be/8dOJLy6yp3U
Please take a look! I think it's a natural followup
Added subscriber: @Osares
Added subscriber: @Aeron-Miles