smaller startup.blend #42083

Closed
opened 2014-10-05 08:08:19 +02:00 by Lawrence D'Oliveiro · 10 comments

Not sure if this is technically a bug, but...

I notice that startup.blend includes 64 blocks of type MTex that don’t seem to be referenced anywhere. Loading the startup file into Blender and then saving it without making any changes removes these blocks.

Enclosed startup.blend is a copy of startup.blend from the current Blender source tree after processing through my experimental blendhack script to remove the unreferenced blocks. I also saved it with 32-bit rather than 64-bit pointers, which knocks about another 50K off the size.

I also note the potential for information leaks in the current procedure for saving .blend files; for example, fixed-length fields containing null-terminated strings retain traces of previous values after the terminating null. And the saving of in-memory addresses can give hints about the configuration of the system on which the file was saved.

Not sure if this is technically a bug, but... I notice that `startup.blend` includes 64 blocks of type `MTex` that don’t seem to be referenced anywhere. Loading the startup file into Blender and then saving it without making any changes removes these blocks. Enclosed [startup.blend](https://archive.blender.org/developer/F115037/startup.blend) is a copy of `startup.blend` from the current Blender source tree after processing through my experimental [blendhack ](https://github.com/ldo/blendhack) script to remove the unreferenced blocks. I also saved it with 32-bit rather than 64-bit pointers, which knocks about another 50K off the size. I also note the potential for information leaks in the current procedure for saving `.blend` files; for example, fixed-length fields containing null-terminated strings retain traces of previous values after the terminating null. And the saving of in-memory addresses can give hints about the configuration of the system on which the file was saved.

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @ldo

Added subscriber: @ldo
Campbell Barton was assigned by Bastien Montagne 2014-10-05 09:15:03 +02:00

Added subscriber: @mont29

Added subscriber: @mont29

Campbell, you handle startup file iirc?

Campbell, you handle startup file iirc?

Having small startup.blend is good of course but we can do this next time we require some update to the blend file in master.

Removing unreferenced blocks is good, but won't blender do this on save?

Further, if we use blendhack - this should be documented as being the new way to create/clean/prepare startup.blend files... but before that would want to see some good justification to use it, and some review of the code.

Why (for example) does blender allow so many unused blocks in startup.blend to begin with? - is this some error in Blender we should resolve?

Having small startup.blend is good of course but we can do this next time we require some update to the blend file in master. Removing unreferenced blocks is good, but won't blender do this on save? Further, if we use `blendhack` - this should be documented as being the new way to create/clean/prepare startup.blend files... but before that would want to see some good justification to use it, and some review of the code. Why (for example) does blender allow so many unused blocks in startup.blend to begin with? - is this some error in Blender we should resolve?

I don’t know what your procedure is for creating startup.blend in the source tree: isn’t that done with Blender itself? Who created the startup.blend that is currently there? (It seems to date from Blender 2.67.) Like I said, if I load and save that startup file, Blender does get rid of those unused blocks.

I feel that in general there should be an equivalent text representation for .blend files, perhaps in JSON form. This would make it easier to keep track of changes to them. It might not be practical for general use, but could be handy here in the source tree.

blendhack is still very much experimental and buggy. Do you see uses for it in the Blender development effort? I was pleased to be able to get as far as writing .blend files that Blender would open without crashing. :)

I don’t know what your procedure is for creating `startup.blend` in the source tree: isn’t that done with Blender itself? Who created the `startup.blend` that is currently there? (It seems to date from Blender 2.67.) Like I said, if I load and save that startup file, Blender does get rid of those unused blocks. I feel that in general there should be an equivalent text representation for `.blend` files, perhaps in JSON form. This would make it easier to keep track of changes to them. It might not be practical for general use, but could be handy here in the source tree. `blendhack` is still very much experimental and buggy. Do you see uses for it in the Blender development effort? I was pleased to be able to get as far as writing `.blend` files that Blender would open without crashing. :)

@ldo, we just re-save startup.blend from Blender when updates are needed.

Recently we've been changing preferences in-code, to avoid re-saving a new blend file for every minor change, so we only update startup.blend when we add a new screen or change window layout for example.

Since the re-save will resolve the problem. (which we'll likely do anyway, there are some changes for the movie-clip editor screen planned...), Im not sure its worth to keep this patch open.

@ldo, we just re-save `startup.blend` from Blender when updates are needed. Recently we've been changing preferences in-code, to avoid re-saving a new blend file for every minor change, so we only update startup.blend when we add a new screen or change window layout for example. Since the re-save will resolve the problem. (which we'll likely do anyway, there are some changes for the movie-clip editor screen planned...), Im not sure its worth to keep this patch open.

OK. I might submit a proposal later for maintaining startup.blend in text form in the source tree—when I have my script working a bit more reliably. Hopefully the advantages of a text format should be obvious: easier to compare for differences and accept patches for. Not sure if JSON will do the trick—need to be able to record references from one block to another.

In the meantime, might I suggest using a 32-bit build of Blender to save a new startup.blend? That should knock about 44K off its size.

OK. I might submit a proposal later for maintaining `startup.blend` in text form in the source tree—when I have my script working a bit more reliably. Hopefully the advantages of a text format should be obvious: easier to compare for differences and accept patches for. Not sure if JSON will do the trick—need to be able to record references from one block to another. In the meantime, might I suggest using a 32-bit build of Blender to save a new `startup.blend`? That should knock about 44K off its size.
Campbell Barton removed their assignment 2016-08-11 06:38:03 +02:00

Removed subscriber: @ideasman42

Removed subscriber: @ideasman42

As mentioned in #52387, the size saving doesn’t seem so significant with larger files. Also the issue with unreferenced MTex blocks is no longer present with the current startup.blend.

As mentioned in #52387, the size saving doesn’t seem so significant with larger files. Also the issue with unreferenced `MTex` blocks is no longer present with the current `startup.blend`.
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2024-03-03 04:13:59 +01:00
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
3 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#42083
No description provided.