Refactor: Properly formalize special versioning done after most of readfile code. #111147
No reviewers
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#111147
Loading…
Reference in New Issue
No description provided.
Delete Branch "mont29/blender:tmp-do-version-after-all"
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?
In a few cases (IPO conversion, Proxy conversion, ...), versioning
implies creating or removing IDs, and/or needs access to the whole Main
data-base.
So far this was done ad-hoc by adding some code at the end of
setup_app_data
.This commit formalizes this process by adding a BLO call
(
BLO_read_do_version_after_setup
) that will encapsulate all suchcomplex versioning code.
NOTE: This commit does not address the existing issue that this
versioning code is never performmed when linking new data (outside of
the 'opening a blendfile' context). This topic would require its own
design task.
NOTE: This commit does not fix the few current evil cases of ID creation in
regular versioning code. This will be addressed separately.
@blender-bot build
c43bbc1ab6
to37b0d6deec
@blender-bot build
@blender-bot build
@blender-bot build windows
@blender-bot build windows
I would expect creating datablocks to be done as part of regular versioning and not after, since otherwise doing further versioning on those datablocks is easy to get wrong and hard to understand. If anything I would love to get rid of before/after lib linking distinction, not add a third.
I don't know exactly what it is that makes creating datablocks during versioning problematic now, but maybe that can be solved instead?
@brecht creating IDs during versioning is by definition not allowed, since these newly created IDs will also go through versioning, even though they are already at current state of code. It would be like versioning twice the same data, which can have completely unknown effects, and is totally unmanageable over time (since some code that works fine initially can become catastrophically broken by a future version versioning). Not to mention that depending on name (and therefore ordering), newly added ID may even be processed by current versioning code that is adding it.
The other way around can also be true in some cases (IDs added at some version, even though using current 'add ID' code, could in some rare case still need some further versioning at a later version). But adding IDs is already a rare case in versioning, so this would be exceptional imho. And actually even more of a reason to keep versioning creating IDs into its own specific area, so that it's at least easier to spot and check, rather than having to find the needle in our haystack of 'regular' versioning code.
Not to mention that some code, like the liboverride one, needs access to the whole final Main data-base, not some by-library sliced-up version.
How would that be possible? By getting rid of the 'before lib_linking' versioning code? That may be doable, but would require a lot of very careful checks to ensure nothing gets broken by doing so... Would not volunteer for that, imho really not worth the effort and risk.
Another reason why adding IDs in do_version (before liblink) is bad: Current readfile mapping does not know about these new ID pointers, and would remap them to NULL. Or you need absolute horror hacks like that: https://projects.blender.org/blender/blender/pulls/111135/files#issuecomment-999267
I think there's pros and cons to both approaches. Making versioning linear I think is better in terms of being able to understand and ensure results are correct, but would require quite a few changes to be able to create datablocks as if they were created with an older version. But since this is also only needed for a few cases so far and it could be a big change, the approach of this PR seems practical.
37b0d6deec
tob912b80e85