I could track the object count in a variable and compare it to the size of bpy.context.scene.objects in a draw call, or similarly track the collection keys, but that feels imprecise and perhaps prone to sync issues. I'd much prefer to subscribe to something through msgbus and receive a notification when the size of the object collection changes, for example. But what to subscribe to? I managed to kill Blender a few times while experimenting with various things but so far have come up blank. My best guess is the size of a collection is computed rather than a stored property with RNA that can be used with msgbus, but I'd appreciate knowing for sure. Any smart folks out there who've been msgbus wrangling, I'd sure appreciate any advice, even if it's just to confirm that this is a silly idea. Thanks for your brain rental!
$\begingroup$ $\endgroup$
4
Noneafter the delete operator, however is not picked up by msgbus. An idea would be to make a pointer property to the prior selection, which if None on the next selection indicates it was removed. $\endgroup$