How can I initially disable a setting in a popup? Looks like this should work ,but it doesn’t. You have to toggle the setting first before it becomes disabled.
col = uiLayoutColumn(split, true);
uiLayoutSetEnabled(col, false);
const bool toggle = RNA_enum_get(&ptr, "toggle") == 1;
if (!toggle) {
uiLayoutSetEnabled(col, true);
}
else {
uiLayoutSetEnabled(col, false);
}
// setting to disable
uiItemR(col, &ptr, "enum", 0, NULL, ICON_NONE);
Doing something similar in python works in a panel.
col = split.column(align=True)
if not win.toggle:
col.enabled = True
else:
col.enabled = False
col.prop(win, "enum", text="")