Fix #111776: Bone Collections with linked file from 3.6 #111793

Closed
Christoph Lendenfeld wants to merge 3 commits from ChrisLend:fix_collections_disappearing into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

While this PR does fix the issue I don't know enough of the code to be certain this doesn't create other issues.

The issue fixed is that the bone collections would disappear when the following steps are taken:

  • link an armature object from a 3.6 file
  • save in 4.0
  • reopen the file
  • bone collections would be gone

The issue is the use of DNA_struct_elem_find which returns true on load because FileData is the current files data.
By checking against the version of bMain (which is the version of the file linked), the versioning code is run again.

I am not sure this will still work when bone collections are editable from lib overrides from this PR
#111775: Fix #111711: bone collection visibility cannot be overridden


With the move of the versioning code into (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 21)) any bone collections between the version they were landed and subversion 21 will be duplicated
So I am wondering if the subversion should just be lowered to the number it was at when the patch landed

While this PR does fix the issue I don't know enough of the code to be certain this doesn't create other issues. The issue fixed is that the bone collections would disappear when the following steps are taken: * link an armature object from a 3.6 file * save in 4.0 * reopen the file * bone collections would be gone The issue is the use of `DNA_struct_elem_find` which returns true on load because `FileData` is the current files data. By checking against the version of `bMain` (which is the version of the file linked), the versioning code is run again. I am not sure this will still work when bone collections are editable from lib overrides from this PR [#111775: Fix #111711: bone collection visibility cannot be overridden](https://projects.blender.org/blender/blender/pulls/111775) ---- With the move of the versioning code into `(!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 21))` any bone collections between the version they were landed and subversion 21 will be duplicated So I am wondering if the subversion should just be lowered to the number it was at when the patch landed
Christoph Lendenfeld added the
Module
Animation & Rigging
label 2023-09-01 16:45:05 +02:00
Christoph Lendenfeld added 1 commit 2023-09-01 16:45:19 +02:00
Christoph Lendenfeld added 2 commits 2023-09-01 16:51:20 +02:00
Christoph Lendenfeld requested review from Bastien Montagne 2023-09-01 16:52:10 +02:00
Christoph Lendenfeld requested review from Nathan Vegdahl 2023-09-01 16:52:19 +02:00
Christoph Lendenfeld requested review from Sybren A. Stüvel 2023-09-01 16:59:42 +02:00

Issue fixed by bfdfde18e1

Note that removing some DNA data checks in do_version once actual file subversion is bumped is not a good idea, since it could then double-do_version some files saved before the subversion bump, but after the initial versioning code was committed.

Thanks for the patch though, and sorry that I was not clear enough in the issue that I was handling it, since it was not directly a problem with the new feature, but more a dormant underlying issue in the readfile code as a whole.

Issue fixed by bfdfde18e14e887f7a08d80330a0bc4a94b79f7b Note that removing some DNA data checks in do_version once actual file subversion is bumped is not a good idea, since it could then double-do_version some files saved before the subversion bump, but after the initial versioning code was committed. Thanks for the patch though, and sorry that I was not clear enough in the issue that I was handling it, since it was not directly a problem with the new feature, but more a dormant underlying issue in the readfile code as a whole.
Bastien Montagne closed this pull request 2023-09-01 19:46:51 +02:00

Pull request closed

Sign in to join this conversation.
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
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#111793
No description provided.