Blender Git Loki
Git Commits -> Revision b0122c9
Revision b0122c9 by Julian Eisel (temp-asset-browser-poselib-merge) July 14, 2021, 16:18 (GMT) |
UI: Support UI list tooltips, defined via Python scripts Makes it possible to create tooltips for UI list rows, which can be filled in .py scripts, similar to how they can extend other menus. This is used by the (to be committed) Pose Library add-on to display pose operations (selecting bones of a pose, blending a pose, etc). It's important that the Python scripts check if the UI list is the correct one by checking the list ID. For this to work, a new `bpy.context.ui_list` can be checked. For example, the Pose Library add-on does the following check: ``` def is_pose_asset_view() -> bool: # Important: Must check context first, or the menu is added for every kind of list. list = getattr(context, "ui_list", None) if not list or list.bl_idname != "UI_UL_asset_view" or list.list_id != "pose_assets": return False if not context.asset_handle: return False return True ``` |
Commit Details:
Full Hash: b0122c98d65033243c3297c95c66a7d52c788e1d
Parent Commit: f749054
Lines Changed: +98, -7
9 Modified Paths:
/release/scripts/startup/bl_ui/__init__.py (+22, -2) (Diff)
/source/blender/editors/interface/interface_context_menu.c (+15, -1) (Diff)
/source/blender/editors/interface/interface_handlers.c (+1, -1) (Diff)
/source/blender/editors/interface/interface_intern.h (+1, -1) (Diff)
/source/blender/editors/interface/interface_template_search_menu.c (+2, -2) (Diff)
/source/blender/editors/screen/screen_context.c (+11, -0) (Diff)
/source/blender/makesrna/intern/rna_ui.c (+31, -0) (Diff)
/source/blender/windowmanager/intern/wm_uilist_type.c (+14, -0) (Diff)
/source/blender/windowmanager/WM_api.h (+1, -0) (Diff)
/source/blender/editors/interface/interface_context_menu.c (+15, -1) (Diff)
/source/blender/editors/interface/interface_handlers.c (+1, -1) (Diff)
/source/blender/editors/interface/interface_intern.h (+1, -1) (Diff)
/source/blender/editors/interface/interface_template_search_menu.c (+2, -2) (Diff)
/source/blender/editors/screen/screen_context.c (+11, -0) (Diff)
/source/blender/makesrna/intern/rna_ui.c (+31, -0) (Diff)
/source/blender/windowmanager/intern/wm_uilist_type.c (+14, -0) (Diff)
/source/blender/windowmanager/WM_api.h (+1, -0) (Diff)