Page MenuHome

Debug Assert in wm_messagebus: Occurs when manipulating collection visibility and (un)linking from a python script
Closed, ResolvedPublic

Description

System Information
Operating system: Win10
Graphics card: nVidia Quadro 600

Blender Version
Broken: 2.80 (sub 40), branch: master, commit date: 2019-01-07 04:34, hash: 6015a03255af
Worked: Most likely a build in the Dec. time frame

Short description of error
The following assert is triggered when attempting to set the visibility of a collection and then deleting it:

BLI_assert failed: c:\users\_removed_\source\repos\blender-git\blender\source\blender\windowmanager\message_bus\intern\wm_message_bus.c:147, WM_msgbus_handle(), at 'mbus->messages_tag_count == 0'

Exact steps for others to reproduce the error

  • Load attached .blend file
  • Run the script that is currently loaded in the text editor
  • Execute bpy.ops.test.trigger_assert() to run that code and trigger the assert

Removing the following line from the script will prevent the assert from triggering: col_bool.hide_viewport = False

This is a reduced repro -- disregard the fact I'm attempting to remove a collection that still has objects inside etc. as the assert happens even if I delete the object.

Event Timeline

Jesse Y (deadpin) updated the task description. (Show Details)

For the records, the Python script is:

parent_col = context.scene.collection
col_bool = bpy.data.collections["DC_boolean_Cube"]
col_bool.hide_viewport = False
parent_col.children.unlink(col_bool)
bpy.data.collections.remove(col_bool)

There is a chance the issue is related to T57857 and how we remove hidden collections from the depsgraph.
That said @Campbell Barton (campbellbarton) may want to investigate this a bit since it is message bus related.

(Note I didn't try to confirm the bug, but I try tomorrow with a debug build).