Files
test2/source/blender/editors/interface
Julian Eisel 99fe6785d0 Fix issues with asset shelf context menu operators
Shortcut and quick favorite operators wouldn't show up in the regular asset
shelf. In the popup the shortcut operators would but they crashed with use
after frees.

Basic issue is that activating view-items by applying the button didn't work
well. That messes with button storage, but also the operator data (like
`uiBut.optype`) is unset after applying, in this case before the context menu
was built.

Instead, activate the view-item directly, and call the activate operator in its
`on_activate()` callback. The button shouldn't call this operator again, so
added a way to attach operators to buttons without calling them.

Seems generally useful to be able to attach an operator to buttons for
tooltips, "Assign Shortcut" and the like, without it being called on button
apply.

Pull Request: https://projects.blender.org/blender/blender/pulls/124466
2024-07-12 10:02:10 +02:00
..