Fix #129207: GPv3: Linked GPv2 objects disappear when reopening file. #129220
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#129220
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "mont29/blender:tmp-gpv3-link-gpv2-obdata"
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?
This happens because blender 4.3 only knows about GPv3 IDs, and
therefore stores a reference to a directly linked GPv2 obdata as a GPv3
one, which cannot be found again on next file load in the GPv2 library.
The idea of this fix is, if the lookup of an idcode+idname fails, to also
search for the same name but with an older, deprecated ID code.
@blender-bot build
@Sergey pulling you in here as this affects quite low-level aspect of our readfile code.
TBH I do not know how I feel about this solution. On one hand it's fairly simple and I do not really see how it could turn bad/cause issues. On the other hand, it feels fuzzy and hard to foresee all potential consequences.
We could also have a more restricted and controlled way to do this fallback-lookup, but that would be more involved to find all places that need it, and would not solve the root 'weirdness' of loading a different ID type than the one required.
Or we could also just decide that this is a corner case and accept the current behavior... People should link Objects or Collections anyway, usually not obdata. ;)
I can not think of any ceses where it could fail. It is also probably something we'd need in the future when we'd be removing legacy curves?
Alternative would be to forbid linking legacy IDs to avoid situations when non-informed artist might loose their work.
@ -50,0 +54,4 @@
/* ID_GD_LEGACY (Grease Pencil v2) is now converted to ID_GP (Grease Pencil v3). */
return ID_GD_LEGACY;
default:
return 0;
Should it be
ID_LINK_PLACEHOLDER
? Otherwise it is a bit unclear for a reader that it is the same thing (return 0 here, andID_LINK_PLACEHOLDER
in the caller).Indeed.... forgot that one when I did the renaming :|
@ -27,0 +38,4 @@
* \returns The old, deprecated ID type code if any matches the given `id_code_new` one, otherwise
* `ID_LINK_PLACEHOLDER`.
*/
short do_versions_new_to_old_idcode_get(const short id_code_new);
const
in declaration is meaningless, think clang-tidy even generates a warning about it.I'm not familiar with this part of the code, so I think it's better that others comment on it.
@blender-bot build