Fix for #35253, Cannot animate X, Y, Z values in nodes with vector sub-menu. The "component menu" template used for these socket buttons opens a popup, but this ui function does not support RNA info directly. Setting the uiBut rna pointer directly solves it.
This commit is contained in:
@@ -3115,6 +3115,7 @@ void uiTemplateComponentMenu(uiLayout *layout, PointerRNA *ptr, const char *prop
|
||||
{
|
||||
ComponentMenuArgs *args = MEM_callocN(sizeof(ComponentMenuArgs), "component menu template args");
|
||||
uiBlock *block;
|
||||
uiBut *but;
|
||||
|
||||
args->ptr = *ptr;
|
||||
BLI_strncpy(args->propname, propname, sizeof(args->propname));
|
||||
@@ -3122,7 +3123,11 @@ void uiTemplateComponentMenu(uiLayout *layout, PointerRNA *ptr, const char *prop
|
||||
block = uiLayoutGetBlock(layout);
|
||||
uiBlockBeginAlign(block);
|
||||
|
||||
uiDefBlockButN(block, component_menu, args, name, 0, 0, UI_UNIT_X * 6, UI_UNIT_Y, "");
|
||||
but = uiDefBlockButN(block, component_menu, args, name, 0, 0, UI_UNIT_X * 6, UI_UNIT_Y, "");
|
||||
/* set rna directly, uiDefBlockButN doesn't do this */
|
||||
but->rnapoin = *ptr;
|
||||
but->rnaprop = RNA_struct_find_property(ptr, propname);
|
||||
but->rnaindex = 0;
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user