Debug Assert for Asset Library Path Context Menu #102591

Closed
opened 2022-11-17 21:12:07 +01:00 by Harley Acheson · 7 comments
Member

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 745/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 517.48

Blender Version
Broken: version: 3.5.0 Alpha, branch: Unknown, commit date: Unknown Unknown, hash: rBUnknown
Worked: (newest version of Blender that worked as expected)

Short description of error
Right-clicking on default Asset Libraries path causes debug BLI_assert

Exact steps for others to reproduce the error

  • Factory Startup File
  • Factory Preferences
  • Edit / Preferences / Asset Libraries / right-click in "Path" input box.
  • BLI_assert failed: ...editors\interface\interface_context_menu.c:442, ui_but_menu_add_path_operators(), at 'subtype == PROP_FILEPATH'

This seems to happen because my default assets path is "C:\Users\Harley\Documents\Blender\Assets", which does not end in a backslash. Within ui_but_menu_add_path_operators we do a BLI_split_dirfile so that we can add different options for paths, depending on whether it is a file path or directory path. In this case, without trailing backslash, it looks like a file so wants to add "Open File Externally" rather than "Open Location Externally". These should both do the same things with different menu names, but the first is guarded by a BLI_assert(subtype == PROP_FILEPATH); and this is PROP_DIRPATH.

I could be relatively unique in having that path without backslash, and/or this might already be fixed for new users, but worth checking.

**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 745/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 517.48 **Blender Version** Broken: version: 3.5.0 Alpha, branch: Unknown, commit date: Unknown Unknown, hash: `rBUnknown` Worked: (newest version of Blender that worked as expected) **Short description of error** Right-clicking on default Asset Libraries path causes debug BLI_assert **Exact steps for others to reproduce the error** - Factory Startup File - Factory Preferences - Edit / Preferences / Asset Libraries / right-click in "Path" input box. - BLI_assert failed: ...editors\interface\interface_context_menu.c:442, ui_but_menu_add_path_operators(), at 'subtype == PROP_FILEPATH' ``` ``` This seems to happen because my default assets path is "C:\Users\Harley\Documents\Blender\Assets", which does not end in a backslash. Within `ui_but_menu_add_path_operators` we do a `BLI_split_dirfile` so that we can add different options for paths, depending on whether it is a file path or directory path. In this case, without trailing backslash, it looks like a file so wants to add "Open File Externally" rather than "Open Location Externally". These should both do the same things with different menu names, but the first is guarded by a `BLI_assert(subtype == PROP_FILEPATH);` and this is PROP_DIRPATH. I could be relatively unique in having that path without backslash, and/or this might already be fixed for new users, but worth checking.

image.png
I couldn't get a crash in today's master debugging (lite)

![image.png](https://archive.blender.org/developer/F13937943/image.png) I couldn't get a crash in today's master debugging (lite)
Author
Member

I'm guessing that your path ends with a backslash?

I'm guessing that your path ends with a backslash?
[2022-11-17 23-21-22.mp4](https://archive.blender.org/developer/F13937953/2022-11-17_23-21-22.mp4)
Author
Member

If I select a NEW folder, then that path does include the backslash and works correctly.

But I can delete my local preferences from my "config" folder, launch Blender, NOT load old settings, and that path is without backslash.

I think this is caused by BKE_preferences_asset_library_default_add, which looks for documents folder then uses BLI_path_join on that, N_("Blender"), and N_("Assets"). This wouldn't append a backslash to the end AFAIK.

There is a comment above it that says /* Add new "Default" library under '[doc_path]/Blender/Assets'. */ which also shows it without trailing slash

If I select a NEW folder, then that path does include the backslash and works correctly. But I can delete my local preferences from my "config" folder, launch Blender, NOT load old settings, and that path is without backslash. I _think_ this is caused by `BKE_preferences_asset_library_default_add`, which looks for documents folder then uses `BLI_path_join` on that, `N_("Blender")`, and `N_("Assets")`. This wouldn't append a backslash to the end AFAIK. There is a comment above it that says `/* Add new "Default" library under '[doc_path]/Blender/Assets'. */` which also shows it without trailing slash
Author
Member

yes needs something like:

diff --git a/source/blender/blenkernel/intern/preferences.c b/source/blender/blenkernel/intern/preferences.c
index dd76f9eddc17..658628f19db7 100644
--- a/source/blender/blenkernel/intern/preferences.c
+++ b/source/blender/blenkernel/intern/preferences.c
@@ -114,8 +114,9 @@ void BKE_preferences_asset_library_default_add(UserDef *userdef)
   bUserAssetLibrary *library = BKE_preferences_asset_library_add(
       userdef, DATA_(BKE_PREFS_ASSET_LIBRARY_DEFAULT_NAME), NULL);
 
-  /* Add new "Default" library under '[doc_path]/Blender/Assets'. */
-  BLI_path_join(library->path, sizeof(library->path), documents_path, N_("Blender"), N_("Assets"));
+  /* Add new "Default" library under '[doc_path]/Blender/Assets/'. */
+  BLI_path_join(
+      library->path, sizeof(library->path), documents_path, N_("Blender"), N_("Assets"), SEP_STR);
 }
 
 /** \} */

yes needs something like: ``` diff --git a/source/blender/blenkernel/intern/preferences.c b/source/blender/blenkernel/intern/preferences.c index dd76f9eddc17..658628f19db7 100644 --- a/source/blender/blenkernel/intern/preferences.c +++ b/source/blender/blenkernel/intern/preferences.c @@ -114,8 +114,9 @@ void BKE_preferences_asset_library_default_add(UserDef *userdef) bUserAssetLibrary *library = BKE_preferences_asset_library_add( userdef, DATA_(BKE_PREFS_ASSET_LIBRARY_DEFAULT_NAME), NULL); - /* Add new "Default" library under '[doc_path]/Blender/Assets'. */ - BLI_path_join(library->path, sizeof(library->path), documents_path, N_("Blender"), N_("Assets")); + /* Add new "Default" library under '[doc_path]/Blender/Assets/'. */ + BLI_path_join( + library->path, sizeof(library->path), documents_path, N_("Blender"), N_("Assets"), SEP_STR); } /** \} */ ```
Harley Acheson self-assigned this 2022-11-17 21:37:53 +01:00
Bastien Montagne added this to the Pipeline, Assets & IO project 2023-02-09 15:39:30 +01:00

For the records, this still happens. @Harley are you still planning to fix that? Otherwise better to unassign yourself from it.

For the records, this still happens. @Harley are you still planning to fix that? Otherwise better to unassign yourself from it.
Author
Member

For the records, this still happens. @Harley are you still planning to fix that? Otherwise better to unassign yourself from it.

Yikes. Yes, this report was before before we got multiple asset paths and it was all moved into the "File Path" area. I assumed (wrongly) that this was no longer a problem, but can recreate the issue now. Will fix ASAP.

> For the records, this still happens. @Harley are you still planning to fix that? Otherwise better to unassign yourself from it. Yikes. Yes, this report was before before we got multiple asset paths and it was all moved into the "File Path" area. I assumed (wrongly) that this was no longer a problem, but can recreate the issue now. Will fix ASAP.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-10-03 18:45:11 +02: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 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#102591
No description provided.