Core: Write mesh and movieclip with new format #108015

Merged
Hans Goudey merged 4 commits from HooglyBoogly/blender:save-new-format-4.0 into main 2023-05-17 19:03:23 +02:00
Member

Finish the transition from #95966 and fe38715600 by
writing files with the new format for meshes and some movie clip fields.
This removes overhead when saving files, and makes meshes saved in
files smaller (a file with a 1 million face grid changed from 32 to 28 MB).

3.6 can still read files saved with this format, but older versions will
crash. Older files are automatically converted by versioning code when
opened.

This also allows removing all the code that converts from the new
format to the legacy format, previously used when saving files.

Finish the transition from #95966 and fe38715600c8c22d67c3 by writing files with the new format for meshes and some movie clip fields. This removes overhead when saving files, and makes meshes saved in files smaller (a file with a 1 million face grid changed from 32 to 28 MB). 3.6 can still read files saved with this format, but older versions will crash. Older files are automatically converted by versioning code when opened. This also allows removing all the code that converts from the new format to the legacy format, previously used when saving files.
Hans Goudey added 1 commit 2023-05-17 17:13:15 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
7528e73efa
Core: Write mesh and movieclip with new format
Finish the transition from #95966 and fe38715600 by
writing files with the new format for meshes and some movie clip fields.
This removes overhead when saving files, and makes meshes saved in
files smaller.

3.6 can still read files saved with this format, but older versions will
crash. Older files are automatically converted by versioning code when
opened.
Author
Member

@blender-bot build

@blender-bot build
Hans Goudey added this to the Core project 2023-05-17 17:13:32 +02:00
Hans Goudey requested review from Sergey Sharybin 2023-05-17 17:13:38 +02:00
Sergey Sharybin requested changes 2023-05-17 17:20:08 +02:00
Sergey Sharybin left a comment
Owner

Finally!

But there are a couple of comments which needs a second look I think.

Finally! But there are a couple of comments which needs a second look I think.
@ -31,3 +31,3 @@
* version. Older Blender versions will test this and show a warning if the file
* was written with too new a version. */
#define BLENDER_FILE_MIN_VERSION 305
#define BLENDER_FILE_MIN_VERSION 306

Shouldn't this be 400? Opening the 4.0 files in 3.6 will not work,

Shouldn't this be 400? Opening the 4.0 files in 3.6 will not work,
Author
Member

That's mentioned in the description. 3.6 is forward compatible with 4.0, at least for now. (at least for meshes, not quite sure about movie clips)

That's mentioned in the description. 3.6 is forward compatible with 4.0, at least for now. (at least for meshes, not quite sure about movie clips)

Ah, right.

I think 3.6 would be able to load the new format for the movie clips as well. At least, it was working fine for the autosave.

Which also means the comment /* NOTE: The regular .blend file saving converts the new format to the legacy format, but the can be removed in the version_motion_tracking_legacy_camera_object().

Ah, right. I think 3.6 would be able to load the new format for the movie clips as well. At least, it was working fine for the autosave. Which also means the comment `/* NOTE: The regular .blend file saving converts the new format to the legacy format, but the` can be removed in the `version_motion_tracking_legacy_camera_object()`.
@ -99,2 +95,2 @@
LISTBASE_FOREACH (Mesh *, mesh, &bmain->meshes) {
version_mesh_legacy_to_struct_of_array_format(*mesh);
if (!MAIN_VERSION_ATLEAST(bmain, 400, 1)) {
/* This is done here because we will continue to write with the old format until 4.0, so we

The comment needs to be removed.

The comment needs to be removed.
HooglyBoogly marked this conversation as resolved
Hans Goudey added 1 commit 2023-05-17 17:42:41 +02:00
Hans Goudey requested review from Sergey Sharybin 2023-05-17 17:43:34 +02:00
Sergey Sharybin approved these changes 2023-05-17 17:48:27 +02:00
Sergey Sharybin left a comment
Owner

From reading the code and understanding it seems fine.

From reading the code and understanding it seems fine.
Hans Goudey added 2 commits 2023-05-17 18:03:07 +02:00
Hans Goudey merged commit 1b63a290c6 into main 2023-05-17 19:03:23 +02:00
Hans Goudey deleted branch save-new-format-4.0 2023-05-17 19:03:24 +02:00
Howard Trickey referenced this issue from a commit 2023-05-29 02:51:38 +02:00
Bastien Montagne removed this from the Core project 2023-07-03 12:43:00 +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#108015
No description provided.