Regression: Asset disappearing on refresh #102610

Closed
opened 2022-11-18 19:04:23 +01:00 by Eugenio Pignataro · 25 comments

System Information
Operating system: Ubuntu 22.04.1
Graphics card: NVIDIA GeForce GTX 1070 Ti

Blender Version
Broken: version: 3.5.0 Alpha
Worked: Latest 3.4
Caused by 1efc94bb2f

Short description of error
Libraries disappear after refresh button is pressed.
Terminal shows "can't find .blend"

Exact steps for others to reproduce the error

  • Create asset library and assign correct path in preferences > File path > Asset libraries
  • Open asset browser and select asset library
  • Click "Refresh" the entire library disappears.
    Load factory settings doesn't fix the problem.

The follow video shows the problem better tan 1000 words.

2022-11-18 14-53-58.mp4

**System Information** Operating system: Ubuntu 22.04.1 Graphics card: NVIDIA GeForce GTX 1070 Ti **Blender Version** Broken: version: 3.5.0 Alpha Worked: Latest 3.4 Caused by 1efc94bb2f **Short description of error** Libraries disappear after refresh button is pressed. Terminal shows "can't find .blend" **Exact steps for others to reproduce the error** - Create asset library and assign correct path in preferences > File path > Asset libraries - Open asset browser and select asset library - Click "Refresh" the entire library disappears. Load factory settings doesn't fix the problem. The follow video shows the problem better tan 1000 words. [2022-11-18 14-53-58.mp4](https://archive.blender.org/developer/F13942194/2022-11-18_14-53-58.mp4)
Author
Member

Added subscriber: @EugenioPignataro

Added subscriber: @EugenioPignataro

#102624 was marked as duplicate of this issue

#102624 was marked as duplicate of this issue
Author
Member

More info:
I've run this command to check the libs intetegrity... and looks fine

import bpy
from pathlib import Path

prefs = bpy.context.preferences
filepaths = prefs.filepaths
asset_libraries = filepaths.asset_libraries

for asset_library in asset_libraries:

  library_name = asset_library.name
  library_path = Path(asset_library.path)
  blend_files = [fp for fp in library_path.glob("**/*.blend") if fp.is_file()]
  print(f"Checking the content of library '{library_name}' :")
  for blend_file in blend_files:
      with bpy.data.libraries.load(str(blend_file), assets_only=True) as (file_contents, _):
          print(file_contents.node_groups)

Screenshot from 2022-11-19 09-48-43.png

More info: I've run this command to check the libs intetegrity... and looks fine import bpy from pathlib import Path prefs = bpy.context.preferences filepaths = prefs.filepaths asset_libraries = filepaths.asset_libraries for asset_library in asset_libraries: ``` library_name = asset_library.name library_path = Path(asset_library.path) blend_files = [fp for fp in library_path.glob("**/*.blend") if fp.is_file()] print(f"Checking the content of library '{library_name}' :") for blend_file in blend_files: with bpy.data.libraries.load(str(blend_file), assets_only=True) as (file_contents, _): print(file_contents.node_groups) ``` ![Screenshot from 2022-11-19 09-48-43.png](https://archive.blender.org/developer/F13945611/Screenshot_from_2022-11-19_09-48-43.png)
Member

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

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

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Looks like a regression on quick testing. Will check again.

Looks like a regression on quick testing. Will check again.
Author
Member

If I clean cache directory the files appear again, but only for 1 time!
2022-11-19 17-32-13.mp4

If I clean cache directory the files appear again, but only for 1 time! [2022-11-19 17-32-13.mp4](https://archive.blender.org/developer/F13947193/2022-11-19_17-32-13.mp4)
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

1efc94bb2f is the first bad commit
cc @JulianEisel

1efc94bb2f is the first bad commit cc @JulianEisel
Pratik Borhade changed title from Asset Library can't find files to Regression: Asset disappearing on refresh 2022-11-20 10:53:02 +01:00
jhonesnow commented 2022-11-21 11:10:05 +01:00 (Migrated from localhost:3001)

Added subscriber: @jhonesnow

Added subscriber: @jhonesnow
jhonesnow commented 2022-11-21 11:10:05 +01:00 (Migrated from localhost:3001)

This comment was removed by @jhonesnow

*This comment was removed by @jhonesnow*

Added subscriber: @ThomasDinges

Added subscriber: @ThomasDinges
Member

It's not clear to me how to reproduce this issue. The file in the video seems to be saved already into the directory that is later used as asset library, but it's not clear to me in what state it is, e.g. if the asset is already stored (and thus tracked by the asset index/cache) in there or not. The banner hides the title bar which contains interesting information.

From the video it seems weird that something is made an asset in the current file but doesn't show up in the Current File asset library. That definitely seems wrong.
Could somebody provide clear steps to reproduce this starting with factory settings?

It's not clear to me how to reproduce this issue. The file in the video seems to be saved already into the directory that is later used as asset library, but it's not clear to me in what state it is, e.g. if the asset is already stored (and thus tracked by the asset index/cache) in there or not. The banner hides the title bar which contains interesting information. From the video it seems weird that something is made an asset in the current file but doesn't show up in the *Current File* asset library. That definitely seems wrong. Could somebody provide clear steps to reproduce this starting with factory settings?
Member

Changed status from 'Confirmed' to: 'Needs User Info'

Changed status from 'Confirmed' to: 'Needs User Info'
Member

@JulianEisel hi, you probably could have been able to relate the video with original description. But I later edited and added the steps to redo the bug from scratch.
Let me know whether the attached video is helpful.
#102610.mp4

@JulianEisel hi, you probably could have been able to relate the video with original description. But I later edited and added the steps to redo the bug from scratch. Let me know whether the attached video is helpful. [#102610.mp4](https://archive.blender.org/developer/F13956311/T102610.mp4)

Added subscriber: @Premik

Added subscriber: @Premik

To reproduce this on my installation (see the #102624) I follow these steps:

  1. Open any blend file from the MyAsset library folder. Say /data/mylib/baseball.blend.
  • Assets editor/CurrentFile/All: Correctly shows the baseball Collection (which is marked as asset).
  • Assets editor/MyAssets/All: Also correctly shows the same baseball Collection. But no other assets from the same library.
  1. Select the Assets editor/MyAssets and Hit the Refresh Asset Library.
  • Correctly refreshes the bassebal assets (i.e. no change). The asset won't disappear here.
  • The other existing assets from other blend files in the /data/mylib still won't show up.
  1. Save the file (make any negligible change).
  2. Main menu /File/New/General:
  • Assets editor/MyAssets/All: Still correctly shows the baseball asset. But only if the file in 3) was saved. I.e. it is no enough to just open the baseball.blend file.
  1. Press Assets editor/Refresh. Or just change to Current File and back to MyAssets
  • The baseball asset disappears.

4b) Close Blender. Open new Blender instance. New/General.

  • Assets editor/MyAssets/All: baseball asset not shown.

I guess all action in 4) 5) and 4b) somehow trigger asset library refresh.

To reproduce this on my installation (see the #102624) I follow these steps: 1) Open any blend file from the `MyAsset` library folder. Say `/data/mylib/baseball.blend`. - `Assets editor/CurrentFile/All`: Correctly shows the baseball Collection (which is marked as asset). - `Assets editor/MyAssets/All`: Also correctly shows the same baseball Collection. But no other assets from the same library. 2) Select the `Assets editor/MyAssets` and Hit the `Refresh Asset Library`. - Correctly refreshes the bassebal assets (i.e. no change). The asset won't disappear here. - The other existing assets from other blend files in the `/data/mylib` still won't show up. 3) Save the file (make any negligible change). 4) Main menu `/File/New/General`: - Assets editor/MyAssets/All: Still correctly shows the baseball asset. But only if the file in 3) was saved. I.e. it is no enough to just open the `baseball.blend` file. 5) Press `Assets editor/Refresh`. Or just change to `Current File` and back to `MyAssets` - The baseball asset disappears. 4b) Close Blender. Open new Blender instance. New/General. - `Assets editor/MyAssets/All`: baseball asset not shown. I guess all action in 4) 5) and 4b) somehow trigger asset library refresh.
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev

Added subscriber: @NahuelBelich

Added subscriber: @NahuelBelich
Member

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'
Member

While I can't recreate the appearing and disappearing of assets as seen in the video, I did notice that assets started not showing up for me anymore. Turns out that after {1efc94bb2f7b}, the asset indexing would be broken, and basically just create empty files when it would update or create information for a .blend.
So to recreate that you can just re-save a file in an asset library with current master to force an update to the index. Its assets will not show up anymore from external files.

Disabling the asset index (enable {nav Preferences > Interface > Developer Extras} and disable {nav Preferences > Experimental > Asset Indexing}) should bring the assets back, but with slow load times.

Now, I have a fix ready for the creation of empty index files, however we need to somehow enforce updating the already created empty index files. Need to figure out a nice way to do this efficiently.

While I can't recreate the appearing and disappearing of assets as seen in the video, I did notice that assets started not showing up for me anymore. Turns out that after {1efc94bb2f7b}, the asset indexing would be broken, and basically just create empty files when it would update or create information for a .blend. So to recreate that you can just re-save a file in an asset library with current master to force an update to the index. Its assets will not show up anymore from external files. Disabling the asset index (enable {nav Preferences > Interface > Developer Extras} and disable {nav Preferences > Experimental > Asset Indexing}) should bring the assets back, but with slow load times. Now, I have a fix ready for the creation of empty index files, however we need to somehow enforce updating the already created empty index files. Need to figure out a nice way to do this efficiently.
Author
Member

Hi Julian, thanks for help us!

"Disabling the asset index (enable Preferences → Interface → Developer Extras and disable Preferences → Experimental → Asset Indexing) should bring the assets back, but with slow load times."

It works, but it is a little bit slower, you're right. We can deal with it.
Tell me please if you want more information, I would send you!

Hi Julian, thanks for help us! "Disabling the asset index (enable Preferences → Interface → Developer Extras and disable Preferences → Experimental → Asset Indexing) should bring the assets back, but with slow load times." It works, but it is a little bit slower, you're right. We can deal with it. Tell me please if you want more information, I would send you!

This issue was referenced by 6a7917162c

This issue was referenced by 6a7917162c560eef9c5db188bc0a4d608aff21ad
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Julian Eisel self-assigned this 2023-01-06 12:18:18 +01:00
Member

6a7917162c and 1229b96652 are committed now, so the indexing can safely be enabled again.

6a7917162c and 1229b96652 are committed now, so the indexing can safely be enabled again.
Bastien Montagne added this to the Pipeline, Assets & IO project 2023-02-09 15:40:01 +01:00
Bastien Montagne removed this from the Pipeline, Assets & IO project 2023-02-10 12:49:18 +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
8 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#102610
No description provided.