Fix #111332: 4.0 files cannot be opened in 3.6, invalid region types #111483
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#111483
Loading…
Reference in New Issue
No description provided.
Delete Branch "JulianEisel/blender:temp-fix-invalid-region-type"
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?
4.0 files now include asset shelf regions in 3D views. This region type is not
known to older Blender versions. So far, in such cases we would just change
the region type to be the first known region type and keep the region storage
otherwise. This was arbitrary, and in fact unsafe: the reused settings may
violate invariants/assumptions for a region type and worse, the
ARegion.regiondata
can only be interpreted and correctly written to filesif the region type is known.
Case in point, in this specific case the asset shelf regions would be set to
use
RGN_TYPE_XR
or before that was introduced,RGN_TYPE_HUD
. Both ofthese are not designed to be used as regular regions. Plus, the asset shelf's
region data pointer would be written to files, for a now different region
type and without the necessary SDNA available.
Make sure all invalid regions (regions where the type cannot be restored) are
removed on file read. This is the only safe solution Bastien and I could see.
Note: This patch is made against the 3.6 branch. Should be ported to
main
too (to provide a proper solution for future cases like this) but this will
cause conflicts.
Fix 111332: 4.0 files cannot be opened in 3.6, invalid region typesto Fix #111332: 4.0 files cannot be opened in 3.6, invalid region typesLGTM.
LGTM.
Tested with 4.0 files & 2.49x files (although those files contain space-types which have been removed, not regions.)
Very minor changed requested inline.
@ -1484,0 +1479,4 @@
continue;
}
printf("Error, region type %d missing in space type \"%s\" (id: %d) - removing region\n",
This should be made into a
Warning
as an error indicates something went wrong, when in fact this is expected when opening newer files.It could even be suppressed when opening files when newer versions of Blender although I don't have such a strong opinion on this.