Page MenuHome
Paste P1502

Multires up and down buttons
ActivePublic

Authored by Hans Goudey (HooglyBoogly) on Jul 2 2020, 9:11 PM.
int total_levels = RNA_int_get(&ptr, "total_levels");
split = uiLayoutSplit(layout, 0.25f, false);
PointerRNA op_ptr;
uiItemFullO(split,
"OBJECT_OT_subdivision_set",
"",
ICON_REW,
NULL,
WM_OP_INVOKE_DEFAULT,
UI_ITEM_R_EXPAND,
&op_ptr);
RNA_int_set(&op_ptr, "level", total_levels);
uiItemFullO(split,
"OBJECT_OT_subdivision_set",
"",
ICON_TRIA_LEFT,
NULL,
WM_OP_INVOKE_DEFAULT,
UI_ITEM_R_EXPAND,
&op_ptr);
RNA_int_set(&op_ptr, "level", -1);
RNA_boolean_set(&op_ptr, "relative", true);
uiItemFullO(split,
"OBJECT_OT_subdivision_set",
"",
ICON_TRIA_RIGHT,
NULL,
WM_OP_INVOKE_DEFAULT,
UI_ITEM_R_EXPAND,
&op_ptr);
RNA_int_set(&op_ptr, "level", 1);
RNA_boolean_set(&op_ptr, "relative", true);
uiItemFullO(split,
"OBJECT_OT_subdivision_set",
"",
ICON_FF,
NULL,
WM_OP_INVOKE_DEFAULT,
UI_ITEM_R_EXPAND,
&op_ptr);
RNA_int_set(&op_ptr, "level", total_levels);