diff options
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 75 |
1 files changed, 1 insertions, 74 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 375027a84d0..ae2b8c8060c 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -70,7 +70,6 @@ #include "BKE_particle.h" #include "BKE_paint.h" #include "BKE_report.h" -#include "BKE_sca.h" #include "BKE_screen.h" #include "DEG_depsgraph.h" @@ -1316,8 +1315,7 @@ static uiLayout *draw_modifier( UI_block_emboss_set(block, UI_EMBOSS_NONE); /* When Modifier is a simulation, show button to switch to context rather than the delete button. */ if (modifier_can_delete(md) && - (!modifier_is_simulation(md) || - STREQ(scene->view_render.engine_id, RE_engine_id_BLENDER_GAME))) + !modifier_is_simulation(md)) { uiItemO(row, "", ICON_X, "OBJECT_OT_modifier_remove"); } @@ -2927,77 +2925,6 @@ void uiTemplateLayers( } } -void uiTemplateGameStates( - uiLayout *layout, PointerRNA *ptr, const char *propname, - PointerRNA *used_ptr, const char *used_propname, int active_state) -{ - uiLayout *uRow, *uCol; - PropertyRNA *prop, *used_prop = NULL; - int groups, cols, states; - int group, col, state, row; - int cols_per_group = 5; - Object *ob = (Object *)ptr->id.data; - - prop = RNA_struct_find_property(ptr, propname); - if (!prop) { - RNA_warning("states property not found: %s.%s", RNA_struct_identifier(ptr->type), propname); - return; - } - - /* the number of states determines the way we group them - * - we want 2 rows only (for now) - * - the number of columns (cols) is the total number of buttons per row - * the 'remainder' is added to this, as it will be ok to have first row slightly wider if need be - * - for now, only split into groups if group will have at least 5 items - */ - states = RNA_property_array_length(ptr, prop); - cols = (states / 2) + (states % 2); - groups = ((cols / 2) < cols_per_group) ? (1) : (cols / cols_per_group); - - if (used_ptr && used_propname) { - used_prop = RNA_struct_find_property(used_ptr, used_propname); - if (!used_prop) { - RNA_warning("used layers property not found: %s.%s", RNA_struct_identifier(ptr->type), used_propname); - return; - } - - if (RNA_property_array_length(used_ptr, used_prop) < states) - used_prop = NULL; - } - - /* layers are laid out going across rows, with the columns being divided into groups */ - - for (group = 0; group < groups; group++) { - uCol = uiLayoutColumn(layout, true); - - for (row = 0; row < 2; row++) { - uiBlock *block; - uiBut *but; - - uRow = uiLayoutRow(uCol, true); - block = uiLayoutGetBlock(uRow); - state = groups * cols_per_group * row + cols_per_group * group; - - /* add layers as toggle buts */ - for (col = 0; (col < cols_per_group) && (state < states); col++, state++) { - int icon = 0; - int butlay = 1 << state; - - if (active_state & butlay) - icon = ICON_LAYER_ACTIVE; - else if (used_prop && RNA_property_boolean_get_index(used_ptr, used_prop, state)) - icon = ICON_LAYER_USED; - - but = uiDefIconButR_prop(block, UI_BTYPE_ICON_TOGGLE, 0, icon, 0, 0, UI_UNIT_X / 2, UI_UNIT_Y / 2, ptr, prop, - state, 0, 0, -1, -1, sca_state_name_get(ob, state)); - UI_but_func_set(but, handle_layer_buttons, but, SET_INT_IN_POINTER(state)); - but->type = UI_BTYPE_TOGGLE; - } - } - } -} - - /************************* List Template **************************/ static void uilist_draw_item_default( struct uiList *ui_list, struct bContext *UNUSED(C), struct uiLayout *layout, |