Batch generate data-block previews broken #62310

Closed
opened 2019-03-07 14:27:50 +01:00 by Fred Fonkle · 14 comments

System Information
Operating system: Kubuntu 18.10
Graphics card: Nvidia Geforce GTX970

Blender Version
Broken: 2.80, a070815d12, blender2.8, 2019-03-06
Worked: (optional)

Short description of error
Batch generation of data-block previews fails with an error code.empty.blend

Exact steps for others to reproduce the error
I have attached empty.blend, which is a file I saved immediately after File->New->General.
If I open Blender 2.80 and File->Data Previews->Batch-Generate Previews and then choose empty.blend, the generation of the preview fails with the following Error in the terminal:
- [begin]-------------
ERROR: bpy_struct: item.attr = val: enum "" not found in ('None', 'Agfa Agfacolor Futura 100', 'Agfa Agfacolor Futura 200', 'Agfa Agfacolor Futura 400', 'Agfa Agfacolor Futura II 100', 'Agfa Agfacolor Futura II 200', 'Agfa Agfacolor Futura II 400', 'Agfa Agfacolor HDC 100 plus', 'Agfa Agfacolor HDC 400 plus', 'Agfa Agfacolor HDC 200 plus', 'Agfa Agfacolor Optima II 100', 'Agfa Agfacolor Optima II 200', 'Agfa Agfacolor Ultra 050', 'Agfa Agfacolor Vista 100', 'Agfa Agfacolor Vista 200', 'Agfa Agfacolor Vista 400', 'Agfa Agfacolor Vista 800', 'Agfa Agfachrome CT Precisa 100', 'Agfa Agfachrome CT Precisa 200', 'Agfa Agfachrome RSX2 050', 'Agfa Agfachrome RSX2 100', 'Agfa Agfachrome RSX2 200', 'Agfa Advantix 100', 'Agfa Advantix 200', 'Agfa Advantix 400', 'Kodak Gold 100', 'Kodak Gold 200', 'Kodak Max Zoom 800', 'Kodak Portra 100T', 'Kodak Portra 160NC', 'Kodak Portra 160VC', 'Kodak Portra 800', 'Kodak Portra 400VC', 'Kodak Portra 400NC', 'Kodak Ektachrome 100 plus', 'Kodak Ektachrome 320T', 'Kodak Ektachrome 400X', 'Kodak Ektachrome 64', 'Kodak Ektachrome 64T', 'Kodak Ektachrome E100S', 'Kodak Ektachrome 100', 'Kodak Kodachrome 200', 'Kodak Kodachrome 25', 'Kodak Kodachrome 64', 'Kodak DSCS 3151', 'Kodak DSCS 3152', 'Kodak DSCS 3153', 'Kodak DSCS 3154', 'Kodak DSCS 3155', 'Kodak DSCS 3156', 'Kodak KAI-0311', 'Kodak KAF-2001', 'Kodak KAF-3000', 'Kodak KAI-0372', 'Kodak KAI-1010', 'Eastman Double X Neg 12min', 'Eastman Double X Neg 6min', 'Eastman Double X Neg 5min', 'Eastman Double X Neg 4min', 'Fujifilm F-125', 'Fujifilm F-250', 'Fujifilm F-400', 'Fujifilm FCI', 'Fujifilm FP2900Z', 'Canon Optura 981111', 'Canon Optura 981113', 'Canon Optura 981114', 'Canon Optura 981111.SLRR')
NOT Saving /media/raid/stationary/blender_assets/empty.blend, because some error(s) happened while deleting temp render data...
Error: Not freed memory blocks: 130, total unfreed memory 0.057281 MB

Blender quit
- [end]---------------

**System Information** Operating system: Kubuntu 18.10 Graphics card: Nvidia Geforce GTX970 **Blender Version** Broken: 2.80, a070815d127e, blender2.8, 2019-03-06 Worked: (optional) **Short description of error** Batch generation of data-block previews fails with an error code.[empty.blend](https://archive.blender.org/developer/F6779402/empty.blend) **Exact steps for others to reproduce the error** I have attached empty.blend, which is a file I saved immediately after File->New->General. If I open Blender 2.80 and File->Data Previews->Batch-Generate Previews and then choose empty.blend, the generation of the preview fails with the following Error in the terminal: - [begin]------------- ERROR: bpy_struct: item.attr = val: enum "" not found in ('None', 'Agfa Agfacolor Futura 100', 'Agfa Agfacolor Futura 200', 'Agfa Agfacolor Futura 400', 'Agfa Agfacolor Futura II 100', 'Agfa Agfacolor Futura II 200', 'Agfa Agfacolor Futura II 400', 'Agfa Agfacolor HDC 100 plus', 'Agfa Agfacolor HDC 400 plus', 'Agfa Agfacolor HDC 200 plus', 'Agfa Agfacolor Optima II 100', 'Agfa Agfacolor Optima II 200', 'Agfa Agfacolor Ultra 050', 'Agfa Agfacolor Vista 100', 'Agfa Agfacolor Vista 200', 'Agfa Agfacolor Vista 400', 'Agfa Agfacolor Vista 800', 'Agfa Agfachrome CT Precisa 100', 'Agfa Agfachrome CT Precisa 200', 'Agfa Agfachrome RSX2 050', 'Agfa Agfachrome RSX2 100', 'Agfa Agfachrome RSX2 200', 'Agfa Advantix 100', 'Agfa Advantix 200', 'Agfa Advantix 400', 'Kodak Gold 100', 'Kodak Gold 200', 'Kodak Max Zoom 800', 'Kodak Portra 100T', 'Kodak Portra 160NC', 'Kodak Portra 160VC', 'Kodak Portra 800', 'Kodak Portra 400VC', 'Kodak Portra 400NC', 'Kodak Ektachrome 100 plus', 'Kodak Ektachrome 320T', 'Kodak Ektachrome 400X', 'Kodak Ektachrome 64', 'Kodak Ektachrome 64T', 'Kodak Ektachrome E100S', 'Kodak Ektachrome 100', 'Kodak Kodachrome 200', 'Kodak Kodachrome 25', 'Kodak Kodachrome 64', 'Kodak DSCS 3151', 'Kodak DSCS 3152', 'Kodak DSCS 3153', 'Kodak DSCS 3154', 'Kodak DSCS 3155', 'Kodak DSCS 3156', 'Kodak KAI-0311', 'Kodak KAF-2001', 'Kodak KAF-3000', 'Kodak KAI-0372', 'Kodak KAI-1010', 'Eastman Double X Neg 12min', 'Eastman Double X Neg 6min', 'Eastman Double X Neg 5min', 'Eastman Double X Neg 4min', 'Fujifilm F-125', 'Fujifilm F-250', 'Fujifilm F-400', 'Fujifilm FCI', 'Fujifilm FP2900Z', 'Canon Optura 981111', 'Canon Optura 981113', 'Canon Optura 981114', 'Canon Optura 981111.SLRR') *NOT* Saving /media/raid/stationary/blender_assets/empty.blend, because some error(s) happened while deleting temp render data... Error: Not freed memory blocks: 130, total unfreed memory 0.057281 MB Blender quit - [end]---------------
Author

Added subscriber: @Fonkle

Added subscriber: @Fonkle

#62385 was marked as duplicate of this issue

#62385 was marked as duplicate of this issue
Brecht Van Lommel was assigned by Sebastian Parborg 2019-03-07 16:36:00 +01:00
Brecht Van Lommel removed their assignment 2019-03-07 16:50:56 +01:00
Bastien Montagne was assigned by Brecht Van Lommel 2019-03-07 16:50:56 +01:00

Added subscriber: @brecht

Added subscriber: @brecht
Bastien Montagne removed their assignment 2019-03-08 23:29:41 +01:00
Sergey Sharybin was assigned by Bastien Montagne 2019-03-08 23:29:41 +01:00

Added subscribers: @Sergey, @mont29

Added subscribers: @Sergey, @mont29

This is actually a color management issue. Stuff in Render settings (and bake settings) are never initialized, and left with null invalid values: the view_settings and display_settings of ImageFormatData (im_format of both RenderData and BakeData).

Now summoning @Sergey here, since those settings do not seem to be exposed anywhere in current UI… Are those still used? If so, is on on purpose that they are not exposed anywhere? Or are they deprecated stuff that should be removed from RNA then?

They are being copied in BKE_scene_copy() (& co) code, but do not seem to be used anywhere else really… If they are to be kept, then they should be initialized in BKE_scene_init(), and we'll probably need some do_version to do it on older files too…

This is actually a color management issue. Stuff in Render settings (and bake settings) are never initialized, and left with null invalid values: the `view_settings` and `display_settings` of `ImageFormatData` (`im_format` of both `RenderData` and `BakeData`). Now summoning @Sergey here, since those settings do not seem to be exposed anywhere in current UI… Are those still used? If so, is on on purpose that they are not exposed anywhere? Or are they deprecated stuff that should be removed from RNA then? They are being copied in `BKE_scene_copy()` (& co) code, but do not seem to be used anywhere else really… If they are to be kept, then they should be initialized in `BKE_scene_init()`, and we'll probably need some do_version to do it on older files too…

Added subscriber: @tiles

Added subscriber: @tiles

@mont29, things are complicated.
The intention of ImageFormatData.view_settings and ImageFormatData.display_settings is to eventually allow saving image in the different color space from what Blender considers default for that format. Those settings are used by image saving operator, and is delivered from scene's color management settings.
I am not sure why copying of those settings is needed in BKE_scene_copy() as i wasn't the one who added them. And to me it seems weird why this that was needed.
We can surely initialize those in BKE_scene_init(), but i've got a feeling that the issue is somewhere deeper.

To my knowledge the batch generation invokes separate blender? Is there an easy way to reproduce the issue from the same instance of Blender?

@mont29, things are complicated. The intention of `ImageFormatData.view_settings` and `ImageFormatData.display_settings` is to eventually allow saving image in the different color space from what Blender considers default for that format. Those settings are used by image saving operator, and is delivered from scene's color management settings. I am not sure why copying of those settings is needed in `BKE_scene_copy()` as i wasn't the one who added them. And to me it seems weird why this that was needed. We can surely initialize those in `BKE_scene_init()`, but i've got a feeling that the issue is somewhere deeper. To my knowledge the batch generation invokes separate blender? Is there an easy way to reproduce the issue from the same instance of Blender?

Can we make batch generation at least not sensitive to such issues?

I don't know of other code that stops working due to this, and there are most likely more cases where the active enum value is not in the list of available items.

Can we make batch generation at least not sensitive to such issues? I don't know of other code that stops working due to this, and there are most likely more cases where the active enum value is not in the list of available items.

Issue in batch generation script happens because it uses current scene (to make its rendering), and hence backups all settings before modifying some, rendering the preview, and then re-setting all settings from backed-up values.

Thing is, since those colormanagement settings are not initialized, their values are invalid, which errors when trying to set them again (in bpyrna code).

They need to be handled in duplication, because they have data that should not be shared between different scenes, that’s just basic health management. ;)

So if you say they are to be kept for now, then I’ll just add initialization for them in scene_init, if you’re OK with it (and add some do_version code to init those in existing files).

Issue in batch generation script happens because it uses current scene (to make its rendering), and hence backups all settings before modifying some, rendering the preview, and then re-setting all settings from backed-up values. Thing is, since those colormanagement settings are not initialized, their values are invalid, which errors when trying to set them again (in bpyrna code). They need to be handled in duplication, because they have data that should not be shared between different scenes, that’s just basic health management. ;) So if you say they are to be kept for now, then I’ll just add initialization for them in scene_init, if you’re OK with it (and add some do_version code to init those in existing files).

@brecht not really, and other code might hit that issue as well. batch generation is merely revealing broken internal code here (lack of initialization of data which default CALLOCED content is invalid). Sure I can skip accessing those specific data from batch generation script, but that would really be just skipping dust under the carpet. Either we expose this to RNA, and then we must ensure underlying DNA data is valid, or we remove those from RNA alltogether (if we decide that this is some sort of WIP code that is not meant to be functional currently).

@brecht not really, and other code might hit that issue as well. batch generation is merely revealing broken internal code here (lack of initialization of data which default CALLOCED content is invalid). Sure I can skip accessing those specific data from batch generation script, but that would really be just skipping dust under the carpet. Either we expose this to RNA, and then we must ensure underlying DNA data is valid, or we remove those from RNA alltogether (if we decide that this is some sort of WIP code that is not meant to be functional currently).

Hrm, guess it just iterates over RNA to back up, and just stumbles on some non-initialized runtime part? Not sure why to backup anything, just don't save .blend file and it should be fine? :)

Anyway, from the description sounds like initializing im_format's color management in BKE_scene_init will solve the issue. And is nice idea to have copy and init be in sync anyway.

Hrm, guess it just iterates over RNA to back up, and just stumbles on some non-initialized runtime part? Not sure why to backup anything, just don't save .blend file and it should be fine? :) Anyway, from the description sounds like initializing `im_format`'s color management in `BKE_scene_init` will solve the issue. And is nice idea to have copy and init be in sync anyway.
Sergey Sharybin was unassigned by Bastien Montagne 2019-03-11 14:14:49 +01:00
Bastien Montagne self-assigned this 2019-03-11 14:14:49 +01:00

The whole point is to save that .blend, with its previews! :p

Will add init then.

The whole point *is* to save that .blend, with its previews! :p Will add init then.

This issue was referenced by 1bc8ddbc6c

This issue was referenced by 1bc8ddbc6ce4c80919640aee9a29da63d8f6b442

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
5 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#62310
No description provided.