Not optmized bpy.data.screens for some Workspaces in template files #89187

Open
opened 2021-06-16 02:22:31 +02:00 by Paulo José Oliveira Amaro · 5 comments

System Information
Operating system: Windows 10

Blender Version
Broken: 2.93.0

Short description of error
In Blender, each workspace adds a screen struct at bpy.data.screens.
For instance, the "Animation" workspace adds a "Animation" screen at bpy.data.screens["Animation"].
{F10173259, size=full}
That's the expected behavior.

But some workspaces, like "Video Editing", add an extra screen with generic names, like "Default.024" and "Default.025".
{F10173268, size=full}

Looking further, I could easily redo the "Video Editing" workspace from scratch with only one screen:
Current: workspace-video-editing-full-bug.png
Fixed: workspace-video-editing-full-fixed.png

There is no visual difference that could justify the extra screen.

Affected workspaces
Not optimized workspaces and the screens they add:

Workspace Screen
2D Animation > 2D Animation "2D Animation", "Default.009"
2D Animation > 2D Full Canvas "2D Full Canvas", "Default.001"
2D Animation > Compositing "Compositing", "Default.016"
2D Animation > Rendering "Rendering", "Default.020"
Sculpting > Sculpting "Default.012"
Sculpting > Shading "Default.003"
VFX > Compositing "Default.021", "Default.022"
VFX > Masking "Default.025", "Default.026"
VFX > Motion Tracking "Default.000", "Default.001"
VFX > Rendering "Default.019", "Default.020"
Video Editing > Rendering "Default.019", "Default.020"
Video Editing > Video Editing "Default.024", "Default.025"

Steps to reproduce the issue

  • Delete all workspaces, and leave just "Layout"
  • File > Clean Up > Unused Data Blocks
  • Outliner > display mode "Blender File" > expand "Screens"
  • There should be only one screen called "Layout"
  • Add one of the affected workspaces
  • Check the new screens in the Outliner

Workaround
It was easy to correct screen names, but I couldn't find a way to remove extra screens through the UI or bpy.
Each copy of an affected workspace also duplicate the extra screen, and it can't be dissociated.
So I remade the affected workspaces from scratch using only one screen, and replaced the template files in:
{​BLENDER_SYSTEM_SCRIPTS}\startup\bl_app_templates_system
In my system it is in:
"C:\Program Files\Blender Foundation\Blender 2.93\2.93\scripts\startup\bl_app_templates_system"

The fixed files: bl_app_templates_system.zip

Fixed workspaces:
Optimized workspaces and the screen they add:

Workspace Screen
2D Animation > 2D Animation "2D Animation"
2D Animation > 2D Full Canvas "2D Full Canvas"
2D Animation > Compositing "Compositing"
2D Animation > Rendering "Rendering"
Sculpting > Sculpting "Sculpting"
Sculpting > Shading "Shading"
VFX > Compositing "Compositing"
VFX > Masking "Masking"
VFX > Motion Tracking "Motion Tracking"
VFX > Rendering "Rendering"
Video Editing > Rendering "Rendering"
Video Editing > Video Editing "Video Editing"

The actual fix
If this bug is confirmed, would it be enough to patch these files?
I feel like the real bug may be what's causing a workspace to have extra screens.
Maybe something that was fixed ages ago, but still after the templates were created?
I couldn't reproduce the behavior of adding a new workspace with extra screens by copying a non affected workspace.

**System Information** Operating system: Windows 10 **Blender Version** Broken: 2.93.0 **Short description of error** In Blender, each workspace adds a screen struct at `bpy.data.screens`. For instance, the "Animation" workspace adds a "Animation" screen at `bpy.data.screens["Animation"]`. {[F10173259](https://archive.blender.org/developer/F10173259/workspace-animation.png), size=full} That's the expected behavior. But some workspaces, like "Video Editing", add an extra screen with generic names, like "Default.024" and "Default.025". {[F10173268](https://archive.blender.org/developer/F10173268/workspace-video-editing.png), size=full} Looking further, I could easily redo the "Video Editing" workspace from scratch with only one screen: Current: ![workspace-video-editing-full-bug.png](https://archive.blender.org/developer/F10173349/workspace-video-editing-full-bug.png) Fixed: ![workspace-video-editing-full-fixed.png](https://archive.blender.org/developer/F10173355/workspace-video-editing-full-fixed.png) There is no visual difference that could justify the extra screen. **Affected workspaces** Not optimized workspaces and the screens they add: | Workspace | Screen | -- | -- | | 2D Animation > 2D Animation | "2D Animation", "Default.009" | 2D Animation > 2D Full Canvas | "2D Full Canvas", "Default.001" | 2D Animation > Compositing | "Compositing", "Default.016" | 2D Animation > Rendering | "Rendering", "Default.020" | Sculpting > Sculpting | "Default.012" | Sculpting > Shading | "Default.003" | VFX > Compositing | "Default.021", "Default.022" | VFX > Masking | "Default.025", "Default.026" | VFX > Motion Tracking | "Default.000", "Default.001" | VFX > Rendering | "Default.019", "Default.020" | Video Editing > Rendering | "Default.019", "Default.020" | Video Editing > Video Editing | "Default.024", "Default.025" **Steps to reproduce the issue** * Delete all workspaces, and leave just "Layout" * File > Clean Up > Unused Data Blocks * Outliner > display mode "Blender File" > expand "Screens" * There should be only one screen called "Layout" * Add one of the affected workspaces * Check the new screens in the Outliner **Workaround** It was easy to correct screen names, but I couldn't find a way to remove extra screens through the UI or bpy. Each copy of an affected workspace also duplicate the extra screen, and it can't be dissociated. So I remade the affected workspaces from scratch using only one screen, and replaced the template files in: `{​BLENDER_SYSTEM_SCRIPTS}\startup\bl_app_templates_system` In my system it is in: `"C:\Program Files\Blender Foundation\Blender 2.93\2.93\scripts\startup\bl_app_templates_system"` The fixed files: [bl_app_templates_system.zip](https://archive.blender.org/developer/F10173768/bl_app_templates_system.zip) **Fixed workspaces:** Optimized workspaces and the screen they add: | Workspace | Screen | -- | -- | | 2D Animation > 2D Animation | "2D Animation" | 2D Animation > 2D Full Canvas | "2D Full Canvas" | 2D Animation > Compositing | "Compositing" | 2D Animation > Rendering | "Rendering" | Sculpting > Sculpting | "Sculpting" | Sculpting > Shading | "Shading" | VFX > Compositing | "Compositing" | VFX > Masking | "Masking" | VFX > Motion Tracking | "Motion Tracking" | VFX > Rendering | "Rendering" | Video Editing > Rendering | "Rendering" | Video Editing > Video Editing | "Video Editing" **The actual fix** If this bug is confirmed, would it be enough to patch these files? I feel like the real bug may be what's causing a workspace to have extra screens. Maybe something that was fixed ages ago, but still after the templates were created? I couldn't reproduce the behavior of adding a new workspace with extra screens by copying a non affected workspace.

Added subscriber: @PauloJoseOliveiraAmaro

Added subscriber: @PauloJoseOliveiraAmaro

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Can you summarize what change was needed to get nice name for screens? If you changed .blend files in templates this should be probably done through versioning, rather than patching .blend files.

I can reproduce this issue, so will confirm.

Can you summarize what change was needed to get nice name for screens? If you changed .blend files in templates this should be probably done through versioning, rather than patching .blend files. I can reproduce this issue, so will confirm.

@iss I just recreated the workspace using the good template, adding new workspaces, then splitting existing regions and set them up exactly like the problematic ones. Then I renamed the new screens accordingly. No much to tell about it, I guess.

In #89187#1182242, @iss wrote:
Can you summarize what change was needed to get nice name for screens? If you changed .blend files in templates this should be probably done through versioning, rather than patching .blend files.

I can reproduce this issue, so will confirm.

@iss I just recreated the workspace using the good template, adding new workspaces, then splitting existing regions and set them up exactly like the problematic ones. Then I renamed the new screens accordingly. No much to tell about it, I guess. > In #89187#1182242, @iss wrote: > Can you summarize what change was needed to get nice name for screens? If you changed .blend files in templates this should be probably done through versioning, rather than patching .blend files. > > I can reproduce this issue, so will confirm.
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:23:23 +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
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#89187
No description provided.