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:
Lukas Toenne
2013-05-08 14:18:09 +00:00
parent 7bd7da7cc6
commit 89eb80fb68

View File

@@ -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);
}