Blender 2.8: workspace list from user configuration is empty #53008

Closed
opened 2017-10-05 18:34:47 +02:00 by Julian Eisel · 9 comments
Member

Short description of error
List of workspaces in user configuration sometimes is empty. Should never be the case.
If no workspaces.blend is found in the user configuration itself (which must never have 0 workspaces), the bundled default one is used as fallback (should be in [build_dir]/[release_dir]/datafiles/).
The user who reported this did have the bundled workspace.blend in the right place, so this is not the cause.

Exact steps for others to reproduce the error

  • Launch Blender from command line
  • Press "+" button to add a new workspace
  • If appearing menu only contains "Duplicate Current", there's the bug.

Mainly leaving this here for myself.

**Short description of error** List of workspaces in user configuration sometimes is empty. Should never be the case. If no `workspaces.blend` is found in the user configuration itself (which must never have 0 workspaces), the bundled default one is used as fallback (should be in `[build_dir]/[release_dir]/datafiles/`). The user who reported this did have the bundled `workspace.blend` in the right place, so this is not the cause. **Exact steps for others to reproduce the error** * Launch Blender from command line * Press "+" button to add a new workspace * If appearing menu only contains "Duplicate Current", there's the bug. ---- Mainly leaving this here for myself.
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Julian Eisel self-assigned this 2017-10-05 18:34:57 +02:00
Author
Member

Added subscriber: @xan2622

Added subscriber: @xan2622
Author
Member

Got it! Happens all the time when launching Blender from command line here. Still need to investigate but now I know how to recreate at least :)

Got it! Happens all the time when launching Blender from command line here. Still need to investigate but now I know how to recreate at least :)
Author
Member

Added subscribers: @Sergey, @ideasman42

Added subscribers: @Sergey, @ideasman42
Author
Member

So this only happens for dev builds executed from the build directory. It's caused by this loading a different release directory path for dev builds https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/appdir.c;33b5e8daff2cfe269bdb527cf0de6dd083b01daf$323-331.

I'd suggest this fix P554: Potential fix for #53008

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 78257cb7d1e..dbcc2e06022 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -412,11 +412,17 @@ if(WITH_OPENCOLORIO)
        )
 endif()
 
-# Add default workspaces.blend to build (under [version]/datafiles
+# Add default workspaces.blend to build datafiles. Copy to two locations, so it works
+# for dev & regular builds (see weird dev-build exception in get_path_system()).
 install(
        FILES ${CMAKE_SOURCE_DIR}/release/datafiles/workspaces.blend
        DESTINATION ${TARGETDIR_VER}/datafiles
 )
+configure_file(
+       ${CMAKE_SOURCE_DIR}/release/datafiles/workspaces.blend
+       ${CMAKE_BINARY_DIR}/release/datafiles/workspaces.blend
+       COPYONLY
+)
 
 # helpful tip when using make
 if("${CMAKE_GENERATOR}" MATCHES ".*Makefiles.*")

The ugly thing is it actually copies the default workspaces.blend to two directories:

  • Once during CMake configuration. Copied into [build_dir]/release/datafiles.
  • Once during make install. Copied into [install_dir]/[version]/datafiles.
    That said it should work fine with all cases.

Alternatively we could remove mentioned lines in appdir.c, although I don't know what it's currently used for. @ideasman42/@Sergey any opinion on that matter?

So this only happens for dev builds executed from the build directory. It's caused by this loading a different release directory path for dev builds https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/appdir.c;33b5e8daff2cfe269bdb527cf0de6dd083b01daf$323-331. I'd suggest this fix [P554: Potential fix for #53008](https://archive.blender.org/developer/P554.txt) ``` diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 78257cb7d1e..dbcc2e06022 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -412,11 +412,17 @@ if(WITH_OPENCOLORIO) ) endif() -# Add default workspaces.blend to build (under [version]/datafiles +# Add default workspaces.blend to build datafiles. Copy to two locations, so it works +# for dev & regular builds (see weird dev-build exception in get_path_system()). install( FILES ${CMAKE_SOURCE_DIR}/release/datafiles/workspaces.blend DESTINATION ${TARGETDIR_VER}/datafiles ) +configure_file( + ${CMAKE_SOURCE_DIR}/release/datafiles/workspaces.blend + ${CMAKE_BINARY_DIR}/release/datafiles/workspaces.blend + COPYONLY +) # helpful tip when using make if("${CMAKE_GENERATOR}" MATCHES ".*Makefiles.*") ``` The ugly thing is it actually copies the default workspaces.blend to two directories: * Once during CMake configuration. Copied into `[build_dir]/release/datafiles`. * Once during `make install`. Copied into `[install_dir]/[version]/datafiles`. That said it should work fine with all cases. Alternatively we could remove mentioned lines in `appdir.c`, although I don't know what it's currently used for. @ideasman42/@Sergey any opinion on that matter?

I think it's simplest to do datatoc as startup.blend unless there is a good reason to make this work differently.

AFAICS no big changes are needed for this, just follow existing conventions.


Update, swapping CWD & EXE dirs is far simpler!

I think it's simplest to do datatoc as startup.blend unless there is a good reason to make this work differently. AFAICS no big changes are needed for this, just follow existing conventions. ---- Update, swapping CWD & EXE dirs is far simpler!

This issue was referenced by 3133d2d58c

This issue was referenced by 3133d2d58c391544a48342860120336e2a0f944e
Author
Member

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
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#53008
No description provided.