Fix #119911: Compositor saved in 4.2 does not work in 4.1 #120246

Merged
Omar Emara merged 2 commits from OmarEmaraDev/blender:fix-119911 into main 2024-04-04 13:14:23 +02:00
Member

Blend files with compositor node trees saves in 4.2 do not work in older
version. This is because 4.2 removed the chunk size property of the node
tree, so it is set to zero, which is invalid in older versions. To fix
this, we add it again as a deprecated DNA member, and set it to default
value upon write.

Blend files with compositor node trees saves in 4.2 do not work in older version. This is because 4.2 removed the chunk size property of the node tree, so it is set to zero, which is invalid in older versions. To fix this, we add it again as a deprecated DNA member, and set it to default value upon write.
Omar Emara added the
Interest
Compositing
Module
VFX & Video
labels 2024-04-04 10:12:08 +02:00
Omar Emara added 1 commit 2024-04-04 10:12:18 +02:00
6f6b6d7803 Fix #119911: Compositor saved in 4.2 does not work in 4.1
Blend files with compositor node trees saves in 4.2 do not work in older
version. This is because 4.2 removed the chunk size property of the node
tree, so it is set to zero, which is invalid in older versions. To fix
this, we add it again as a deprecated DNA member, and set it to default
value upon write.
Omar Emara requested review from Sergey Sharybin 2024-04-04 10:12:29 +02:00

Ideally we would not modify the original ID, and only do modifications on the temp buffer. I think something like this could work:

  if (sce->nodetree) {
    BLO_write_init_id_buffer_from_id(
        temp_embedded_id_buffer, &sce->nodetree->id, BLO_write_is_undo(writer));
    bNodeTree *temp_nodetree = reinterpret_cast<bNodeTree *>(
        BLO_write_get_id_buffer_temp_id(temp_embedded_id_buffer));
    /* Set deprecated chunksize for forward compatibility. */
    temp_nodetree->chunksize = 256;
    BLO_write_struct_at_address(writer, bNodeTree, sce->nodetree, temp_nodetree);
    ntreeBlendWrite(writer, temp_nodetree);
  }
Ideally we would not modify the original ID, and only do modifications on the temp buffer. I think something like this could work: ``` if (sce->nodetree) { BLO_write_init_id_buffer_from_id( temp_embedded_id_buffer, &sce->nodetree->id, BLO_write_is_undo(writer)); bNodeTree *temp_nodetree = reinterpret_cast<bNodeTree *>( BLO_write_get_id_buffer_temp_id(temp_embedded_id_buffer)); /* Set deprecated chunksize for forward compatibility. */ temp_nodetree->chunksize = 256; BLO_write_struct_at_address(writer, bNodeTree, sce->nodetree, temp_nodetree); ntreeBlendWrite(writer, temp_nodetree); } ```
Omar Emara added 1 commit 2024-04-04 11:00:10 +02:00
Sergey Sharybin approved these changes 2024-04-04 11:29:08 +02:00
Sergey Sharybin left a comment
Owner

Thanks for the update. Is looking good and working good now!

Thanks for the update. Is looking good and working good now!
Omar Emara merged commit b0bebd6265 into main 2024-04-04 13:14:23 +02:00
Omar Emara deleted branch fix-119911 2024-04-04 13:14:25 +02:00
Sign in to join this conversation.
No reviewers
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#120246
No description provided.