Setting Workbench as Render Engine blocks loading of icon previews #69001

Closed
opened 2019-08-21 16:59:26 +02:00 by Mikhail Rachinskiy · 16 comments

System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce GTX 860M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.86

Blender Version
Broken: version: 2.81 (sub 2), branch: master, commit date: 2019-08-17 21:40, hash: e69fb44027

Short description of error
Setting Workbench as Render Engine blocks loading of icon previews, while setting it to EEVEE or Cycles does not.

Exact steps for others to reproduce the error

  • Open attached blend file: workbench_x_icons.zip
  • Use Run Script and check TEST tab in Sidebar (icon loads).

Change Render Engine to Workbench and use Run Script again (icon does not load).

workbench_x_icons.mp4

**System Information** Operating system: Windows-10-10.0.17134 64 Bits Graphics card: GeForce GTX 860M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.86 **Blender Version** Broken: version: 2.81 (sub 2), branch: master, commit date: 2019-08-17 21:40, hash: `e69fb44027` **Short description of error** Setting Workbench as Render Engine blocks loading of icon previews, while setting it to EEVEE or Cycles does not. **Exact steps for others to reproduce the error** - Open attached blend file: [workbench_x_icons.zip](https://archive.blender.org/developer/F7681096/workbench_x_icons.zip) - Use Run Script and check TEST tab in Sidebar (icon loads). # Change Render Engine to Workbench and use Run Script again (icon does not load). [workbench_x_icons.mp4](https://archive.blender.org/developer/F7681123/workbench_x_icons.mp4)
Author
Member

Added subscriber: @MikhailRachinskiy

Added subscriber: @MikhailRachinskiy

blender/blender-addons#80110 was marked as duplicate of this issue

blender/blender-addons#80110 was marked as duplicate of this issue

#76169 was marked as duplicate of this issue

#76169 was marked as duplicate of this issue

#74405 was marked as duplicate of this issue

#74405 was marked as duplicate of this issue
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Interesting, will have a quick look...

Interesting, will have a quick look...
Member

Afaict, bpy_utils_previews_load does its thing in three cases without something obvious going wrong, needs some further investigation still :(

Afaict, `bpy_utils_previews_load` does its thing in three cases without something obvious going wrong, needs some further investigation still :(

Added subscriber: @Andrew_D

Added subscriber: @Andrew_D
Member

Added subscribers: @Dervock, @BrendonMurphy

Added subscribers: @Dervock, @BrendonMurphy
Member

Added subscriber: @oswaldo.sndvl

Added subscriber: @oswaldo.sndvl

So I was able to recreate the problem and a temporary solution. I made a video of it. HopsIcons.mp4

So I was able to recreate the problem and a temporary solution. I made a video of it. [HopsIcons.mp4](https://archive.blender.org/developer/F8811045/HopsIcons.mp4)

Added subscriber: @rjg

Added subscriber: @rjg

When the workbench engine is used, the icon_preview_startjob isn't called, which results in the missing icon. icon_preview_startjob should've been called eventually once icon_preview_startjob_all_sizes is called (set as callback for window manager job by ED_preview_icon_job).

Callstack when Eevee is used:

icon_preview_startjob(void * customdata, short * stop, short * do_update) Line 1238	C
common_preview_startjob(void * customdata, short * stop, short * do_update, float * UNUSED_progress) Line 1343	C
other_id_types_preview_render(IconPreview * ip, IconPreviewSize * cur_size, const bool is_deferred, short * stop, short * do_update, float * progress) Line 1396	C
icon_preview_startjob_all_sizes(void * customdata, short * stop, short * do_update, float * progress) Line 1456	C
do_job_thread(void * job_v) Line 390	C

However, it doesn't when the render engine is set to Workbench because of the following check in icon_preview_startjob_all_sizes:

    if (!check_engine_supports_preview(ip->scene)) {
      continue;
    }

This checks if the render engine type has the RE_USE_PREVIEW flag set, which is to indicate whether the engine is able to render previews. This appears entirely irrelevant for the previewing of image icons as the one in the task. The Workbench engine doesn't have the flag set, thus icon_preview_startjob_all_sizes never calls other_id_types_preview_render.

When the workbench engine is used, the `icon_preview_startjob` isn't called, which results in the missing icon. `icon_preview_startjob` should've been called eventually once `icon_preview_startjob_all_sizes` is called (set as callback for window manager job by `ED_preview_icon_job`). Callstack when Eevee is used: ``` icon_preview_startjob(void * customdata, short * stop, short * do_update) Line 1238 C common_preview_startjob(void * customdata, short * stop, short * do_update, float * UNUSED_progress) Line 1343 C other_id_types_preview_render(IconPreview * ip, IconPreviewSize * cur_size, const bool is_deferred, short * stop, short * do_update, float * progress) Line 1396 C icon_preview_startjob_all_sizes(void * customdata, short * stop, short * do_update, float * progress) Line 1456 C do_job_thread(void * job_v) Line 390 C ``` However, it doesn't when the render engine is set to *Workbench* because of the following check in `icon_preview_startjob_all_sizes`: ``` if (!check_engine_supports_preview(ip->scene)) { continue; } ``` This checks if the render engine type has the `RE_USE_PREVIEW` flag set, which is to indicate whether the engine is able to render previews. This appears entirely irrelevant for the previewing of image icons as the one in the task. The Workbench engine doesn't have the flag set, thus `icon_preview_startjob_all_sizes` never calls `other_id_types_preview_render`.

I have to check if I've missed any edge case, but the following seems to do the job:

    if (!check_engine_supports_preview(ip->scene) && !(prv->tag & PRV_TAG_DEFFERED)) {
      continue;
    }

The prv->tag & PRV_TAG_DEFERRED is used to determine whether this preview is to be rendered or an image for which deferred loading is used. If it's the latter it shouldn't run into any unsupported cases in other_id_types_preview_render, common_preview_startjob or icon_preview_startjob.

I have to check if I've missed any edge case, but the following seems to do the job: ``` if (!check_engine_supports_preview(ip->scene) && !(prv->tag & PRV_TAG_DEFFERED)) { continue; } ``` The `prv->tag & PRV_TAG_DEFERRED` is used to determine whether this preview is to be rendered or an image for which deferred loading is used. If it's the latter it shouldn't run into any unsupported cases in `other_id_types_preview_render`, `common_preview_startjob` or `icon_preview_startjob`.

This issue was referenced by c0d2b10c59

This issue was referenced by c0d2b10c5947f49b316d39b66fb18ff6ab21a82a
Robert Guetzkow self-assigned this 2021-01-28 00:53:44 +01:00
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' 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
7 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#69001
No description provided.