Drivers UI Fix: Use uiLayoutSetContextFromBut() so that operators will work in the panel

This fixes the problem where the "Show in Drivers Editor" button would
not actually select and highlight the driver under the mouse.

(TODO: The channels still aren't getting selected properly in the
channels list, but at least the properties show correctly)
This commit is contained in:
Joshua Leung 2018-06-11 18:51:15 +12:00
parent 9ab26bec27
commit 1ff28c2650
Notes: blender-bot 2023-02-14 07:39:46 +01:00
Referenced by issue #55145, Implement Driver Workflow Changes
1 changed files with 6 additions and 0 deletions

View File

@ -1019,6 +1019,12 @@ static void graph_panel_drivers_popover(const bContext *C, Panel *pa)
&ptr, prop, index,
NULL, NULL, &driven, &special);
/* Hack: Force all buttons in this panel to be able to know the driver button
* this panel is getting spawned from, so that things like the "Open Drivers Editor"
* button will work.
*/
uiLayoutSetContextFromBut(layout, but);
/* Populate Panel - With a combination of the contents of the Driven and Driver panels */
if (fcu) {
ID *id = ptr.id.data;