diff options
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_draw.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 197 |
1 files changed, 76 insertions, 121 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 7d3b95721c6..a45b415b629 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -80,8 +80,8 @@ #include "outliner_intern.h" -/* disable - this is far too slow - campbell */ -// #define USE_GROUP_SELECT +/* Disable - this is far too slow - campbell. */ +/* #define USE_GROUP_SELECT */ /* ****************************************************** */ /* Tree Size Functions */ @@ -173,12 +173,12 @@ static void restrictbutton_recursive_bone(Bone *bone_parent, int flag, bool set_ } } -static void restrictbutton_r_lay_cb(bContext *C, void *poin, void *UNUSED(poin2)) +static void restrictbutton_r_lay_fn(bContext *C, void *poin, void *UNUSED(poin2)) { WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, poin); } -static void restrictbutton_bone_visibility_cb(bContext *C, void *poin, void *UNUSED(poin2)) +static void restrictbutton_bone_visibility_fn(bContext *C, void *poin, void *UNUSED(poin2)) { Bone *bone = (Bone *)poin; @@ -187,7 +187,7 @@ static void restrictbutton_bone_visibility_cb(bContext *C, void *poin, void *UNU } } -static void restrictbutton_bone_select_cb(bContext *C, void *UNUSED(poin), void *poin2) +static void restrictbutton_bone_select_fn(bContext *C, void *UNUSED(poin), void *poin2) { Bone *bone = (Bone *)poin2; if (bone->flag & BONE_UNSELECTABLE) { @@ -201,7 +201,7 @@ static void restrictbutton_bone_select_cb(bContext *C, void *UNUSED(poin), void WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL); } -static void restrictbutton_ebone_select_cb(bContext *C, void *UNUSED(poin), void *poin2) +static void restrictbutton_ebone_select_fn(bContext *C, void *UNUSED(poin), void *poin2) { EditBone *ebone = (EditBone *)poin2; @@ -217,7 +217,7 @@ static void restrictbutton_ebone_select_cb(bContext *C, void *UNUSED(poin), void WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL); } -static void restrictbutton_ebone_visibility_cb(bContext *C, void *UNUSED(poin), void *poin2) +static void restrictbutton_ebone_visibility_fn(bContext *C, void *UNUSED(poin), void *poin2) { EditBone *ebone = (EditBone *)poin2; if (ebone->flag & BONE_HIDDEN_A) { @@ -231,7 +231,7 @@ static void restrictbutton_ebone_visibility_cb(bContext *C, void *UNUSED(poin), WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL); } -static void restrictbutton_gp_layer_flag_cb(bContext *C, void *poin, void *UNUSED(poin2)) +static void restrictbutton_gp_layer_flag_fn(bContext *C, void *poin, void *UNUSED(poin2)) { ID *id = (ID *)poin; @@ -253,7 +253,7 @@ static void restrictbutton_id_user_toggle(bContext *UNUSED(C), void *poin, void } } -static void outliner_object_set_flag_recursive_cb(bContext *C, +static void outliner_object_set_flag_recursive_fn(bContext *C, Base *base, Object *ob, const char *propname) @@ -313,21 +313,21 @@ static void outliner_object_set_flag_recursive_cb(bContext *C, /** * Object properties. * */ -static void outliner__object_set_flag_recursive_cb(bContext *C, void *poin, void *poin2) +static void outliner__object_set_flag_recursive_fn(bContext *C, void *poin, void *poin2) { Object *ob = poin; char *propname = poin2; - outliner_object_set_flag_recursive_cb(C, NULL, ob, propname); + outliner_object_set_flag_recursive_fn(C, NULL, ob, propname); } /** * Base properties. * */ -static void outliner__base_set_flag_recursive_cb(bContext *C, void *poin, void *poin2) +static void outliner__base_set_flag_recursive_fn(bContext *C, void *poin, void *poin2) { Base *base = poin; char *propname = poin2; - outliner_object_set_flag_recursive_cb(C, base, NULL, propname); + outliner_object_set_flag_recursive_fn(C, base, NULL, propname); } /** Create either a RNA_LayerCollection or a RNA_Collection pointer. */ @@ -568,7 +568,7 @@ void outliner_collection_isolate_flag(Scene *scene, } } -static void outliner_collection_set_flag_recursive_cb(bContext *C, +static void outliner_collection_set_flag_recursive_fn(bContext *C, LayerCollection *layer_collection, Collection *collection, const char *propname) @@ -632,24 +632,24 @@ static void outliner_collection_set_flag_recursive_cb(bContext *C, * Layer collection properties called from the ViewLayer mode. * Change the (non-excluded) collection children, and the objects nested to them all. */ -static void view_layer__layer_collection_set_flag_recursive_cb(bContext *C, +static void view_layer__layer_collection_set_flag_recursive_fn(bContext *C, void *poin, void *poin2) { LayerCollection *layer_collection = poin; char *propname = poin2; - outliner_collection_set_flag_recursive_cb(C, layer_collection, NULL, propname); + outliner_collection_set_flag_recursive_fn(C, layer_collection, NULL, propname); } /** * Collection properties called from the ViewLayer mode. * Change the (non-excluded) collection children, and the objects nested to them all. */ -static void view_layer__collection_set_flag_recursive_cb(bContext *C, void *poin, void *poin2) +static void view_layer__collection_set_flag_recursive_fn(bContext *C, void *poin, void *poin2) { LayerCollection *layer_collection = poin; char *propname = poin2; - outliner_collection_set_flag_recursive_cb( + outliner_collection_set_flag_recursive_fn( C, layer_collection, layer_collection->collection, propname); } @@ -657,14 +657,14 @@ static void view_layer__collection_set_flag_recursive_cb(bContext *C, void *poin * Collection properties called from the Scenes mode. * Change the collection children but no objects. */ -static void scenes__collection_set_flag_recursive_cb(bContext *C, void *poin, void *poin2) +static void scenes__collection_set_flag_recursive_fn(bContext *C, void *poin, void *poin2) { Collection *collection = poin; char *propname = poin2; - outliner_collection_set_flag_recursive_cb(C, NULL, collection, propname); + outliner_collection_set_flag_recursive_fn(C, NULL, collection, propname); } -static void namebutton_cb(bContext *C, void *tsep, char *oldname) +static void namebutton_fn(bContext *C, void *tsep, char *oldname) { Main *bmain = CTX_data_main(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); @@ -709,9 +709,9 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname) Library *lib = (Library *)tselem->id; char expanded[FILE_MAX]; - BKE_library_filepath_set(bmain, lib, lib->name); + BKE_library_filepath_set(bmain, lib, lib->filepath); - BLI_strncpy(expanded, lib->name, sizeof(expanded)); + BLI_strncpy(expanded, lib->filepath, sizeof(expanded)); BLI_path_abs(expanded, BKE_main_blendfile_path(bmain)); if (!BLI_exists(expanded)) { BKE_reportf(CTX_wm_reports(C), @@ -731,7 +731,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname) else { switch (tselem->type) { case TSE_DEFGROUP: - BKE_object_defgroup_unique_name(te->directdata, (Object *)tselem->id); // id = object + BKE_object_defgroup_unique_name(te->directdata, (Object *)tselem->id); /* id = object. */ break; case TSE_NLA_ACTION: BLI_libblock_ensure_unique_name(bmain, tselem->id->name); @@ -790,7 +790,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname) break; } case TSE_POSEGRP: { - Object *ob = (Object *)tselem->id; // id = object + Object *ob = (Object *)tselem->id; /* id = object. */ bActionGroup *grp = te->directdata; BLI_uniquename(&ob->pose->agroups, @@ -809,7 +809,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname) /* always make layer active */ BKE_gpencil_layer_active_set(gpd, gpl); - // XXX: name needs translation stuff + /* XXX: name needs translation stuff. */ BLI_uniquename( &gpd->layers, gpl, "GP Layer", '.', offsetof(bGPDlayer, info), sizeof(gpl->info)); @@ -1073,7 +1073,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, 0, 0, TIP_("Use view layer for rendering")); - UI_but_func_set(bt, restrictbutton_r_lay_cb, tselem->id, NULL); + UI_but_func_set(bt, restrictbutton_r_lay_fn, tselem->id, NULL); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE); } @@ -1111,7 +1111,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, TIP_("Temporarily hide in viewport\n" "* Shift to set children")); UI_but_func_set( - bt, outliner__base_set_flag_recursive_cb, base, (void *)"hide_viewport"); + bt, outliner__base_set_flag_recursive_fn, base, (void *)"hide_viewport"); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); if (!props_active.base_hide_viewport) { UI_but_flag_enable(bt, UI_BUT_INACTIVE); @@ -1137,7 +1137,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, -1, TIP_("Disable selection in viewport\n" "* Shift to set children")); - UI_but_func_set(bt, outliner__object_set_flag_recursive_cb, ob, (char *)"hide_select"); + UI_but_func_set(bt, outliner__object_set_flag_recursive_fn, ob, (char *)"hide_select"); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); if (!props_active.object_hide_select) { UI_but_flag_enable(bt, UI_BUT_INACTIVE); @@ -1162,7 +1162,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, -1, TIP_("Globally disable in viewports\n" "* Shift to set children")); - UI_but_func_set(bt, outliner__object_set_flag_recursive_cb, ob, (void *)"hide_viewport"); + UI_but_func_set(bt, outliner__object_set_flag_recursive_fn, ob, (void *)"hide_viewport"); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); if (!props_active.object_hide_viewport) { UI_but_flag_enable(bt, UI_BUT_INACTIVE); @@ -1187,7 +1187,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, -1, TIP_("Globally disable in renders\n" "* Shift to set children")); - UI_but_func_set(bt, outliner__object_set_flag_recursive_cb, ob, (char *)"hide_render"); + UI_but_func_set(bt, outliner__object_set_flag_recursive_fn, ob, (char *)"hide_render"); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); if (!props_active.object_hide_render) { UI_but_flag_enable(bt, UI_BUT_INACTIVE); @@ -1301,7 +1301,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, -1, -1, TIP_("Restrict visibility in the 3D View")); - UI_but_func_set(bt, restrictbutton_bone_visibility_cb, bone, NULL); + UI_but_func_set(bt, restrictbutton_bone_visibility_fn, bone, NULL); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE); } @@ -1322,7 +1322,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, 0, 0, TIP_("Restrict selection in the 3D View")); - UI_but_func_set(bt, restrictbutton_bone_select_cb, ob->data, bone); + UI_but_func_set(bt, restrictbutton_bone_select_fn, ob->data, bone); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE); } @@ -1346,7 +1346,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, 0, 0, TIP_("Restrict visibility in the 3D View")); - UI_but_func_set(bt, restrictbutton_ebone_visibility_cb, NULL, ebone); + UI_but_func_set(bt, restrictbutton_ebone_visibility_fn, NULL, ebone); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE); } @@ -1367,7 +1367,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, 0, 0, TIP_("Restrict selection in the 3D View")); - UI_but_func_set(bt, restrictbutton_ebone_select_cb, NULL, ebone); + UI_but_func_set(bt, restrictbutton_ebone_select_fn, NULL, ebone); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE); } @@ -1376,13 +1376,13 @@ static void outliner_draw_restrictbuts(uiBlock *block, ID *id = tselem->id; bGPDlayer *gpl = (bGPDlayer *)te->directdata; - if (soops->show_restrict_flags & SO_RESTRICT_VIEWPORT) { + if (soops->show_restrict_flags & SO_RESTRICT_HIDE) { bt = uiDefIconButBitS(block, UI_BTYPE_ICON_TOGGLE, GP_LAYER_HIDE, 0, ICON_HIDE_OFF, - (int)(region->v2d.cur.xmax - restrict_offsets.viewport), + (int)(region->v2d.cur.xmax - restrict_offsets.hide), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -1392,7 +1392,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, 0, 0, TIP_("Restrict visibility in the 3D View")); - UI_but_func_set(bt, restrictbutton_gp_layer_flag_cb, id, gpl); + UI_but_func_set(bt, restrictbutton_gp_layer_flag_fn, id, gpl); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE); } @@ -1413,7 +1413,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, 0, 0, TIP_("Restrict editing of strokes and keyframes in this layer")); - UI_but_func_set(bt, restrictbutton_gp_layer_flag_cb, id, gpl); + UI_but_func_set(bt, restrictbutton_gp_layer_flag_fn, id, gpl); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); } } @@ -1450,7 +1450,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, "* Ctrl to isolate collection\n" "* Shift to set inside collections and objects")); UI_but_func_set(bt, - view_layer__layer_collection_set_flag_recursive_cb, + view_layer__layer_collection_set_flag_recursive_fn, layer_collection, (char *)"hide_viewport"); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); @@ -1479,7 +1479,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, "* Ctrl to isolate collection\n" "* Shift to set inside collections")); UI_but_func_set(bt, - view_layer__layer_collection_set_flag_recursive_cb, + view_layer__layer_collection_set_flag_recursive_fn, layer_collection, (char *)"holdout"); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); @@ -1510,7 +1510,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, "* Ctrl to isolate collection\n" "* Shift to set inside collections")); UI_but_func_set(bt, - view_layer__layer_collection_set_flag_recursive_cb, + view_layer__layer_collection_set_flag_recursive_fn, layer_collection, (char *)"indirect_only"); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); @@ -1542,13 +1542,13 @@ static void outliner_draw_restrictbuts(uiBlock *block, "* Shift to set inside collections and objects")); if (layer_collection != NULL) { UI_but_func_set(bt, - view_layer__collection_set_flag_recursive_cb, + view_layer__collection_set_flag_recursive_fn, layer_collection, (char *)"hide_viewport"); } else { UI_but_func_set(bt, - scenes__collection_set_flag_recursive_cb, + scenes__collection_set_flag_recursive_fn, collection, (char *)"hide_viewport"); } @@ -1579,13 +1579,13 @@ static void outliner_draw_restrictbuts(uiBlock *block, "* Shift to set inside collections and objects")); if (layer_collection != NULL) { UI_but_func_set(bt, - view_layer__collection_set_flag_recursive_cb, + view_layer__collection_set_flag_recursive_fn, layer_collection, (char *)"hide_render"); } else { UI_but_func_set( - bt, scenes__collection_set_flag_recursive_cb, collection, (char *)"hide_render"); + bt, scenes__collection_set_flag_recursive_fn, collection, (char *)"hide_render"); } UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); if (!props_active.collection_hide_render) { @@ -1614,13 +1614,13 @@ static void outliner_draw_restrictbuts(uiBlock *block, "* Shift to set inside collections and objects")); if (layer_collection != NULL) { UI_but_func_set(bt, - view_layer__collection_set_flag_recursive_cb, + view_layer__collection_set_flag_recursive_fn, layer_collection, (char *)"hide_select"); } else { UI_but_func_set( - bt, scenes__collection_set_flag_recursive_cb, collection, (char *)"hide_select"); + bt, scenes__collection_set_flag_recursive_fn, collection, (char *)"hide_select"); } UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); if (!props_active.collection_hide_select) { @@ -1657,7 +1657,6 @@ static void outliner_draw_userbuts(uiBlock *block, uiBut *bt; ID *id = tselem->id; const char *tip = NULL; - int icon = ICON_NONE; char buf[16] = ""; int but_flag = UI_BUT_DRAG_LOCK; @@ -1683,18 +1682,16 @@ static void outliner_draw_userbuts(uiBlock *block, UI_but_flag_enable(bt, but_flag); if (id->flag & LIB_FAKEUSER) { - icon = ICON_FILE_TICK; tip = TIP_("Data-block will be retained using a fake user"); } else { - icon = ICON_X; tip = TIP_("Data-block has no users and will be deleted"); } bt = uiDefIconButBitS(block, UI_BTYPE_ICON_TOGGLE, LIB_FAKEUSER, 1, - icon, + ICON_FAKE_USER_OFF, (int)(region->v2d.cur.xmax - OL_TOG_USER_BUTS_STATUS), te->ys, UI_UNIT_X, @@ -1707,25 +1704,6 @@ static void outliner_draw_userbuts(uiBlock *block, tip); UI_but_func_set(bt, restrictbutton_id_user_toggle, id, NULL); UI_but_flag_enable(bt, but_flag); - - bt = uiDefButBitS(block, - UI_BTYPE_ICON_TOGGLE, - LIB_FAKEUSER, - 1, - (id->flag & LIB_FAKEUSER) ? "F" : " ", - (int)(region->v2d.cur.xmax - OL_TOG_USER_BUTS_FAKEUSER), - te->ys, - UI_UNIT_X, - UI_UNIT_Y, - &id->flag, - 0, - 0, - 0, - 0, - TIP_("Data-block has a 'fake' user which will keep it in the file " - "even if nothing else uses it")); - UI_but_func_set(bt, restrictbutton_id_user_toggle, id, NULL); - UI_but_flag_enable(bt, but_flag); } } @@ -1864,7 +1842,7 @@ static void outliner_buttons(const bContext *C, len = sizeof(((ModifierData *)0)->name); } else if (tselem->id && GS(tselem->id->name) == ID_LI) { - len = sizeof(((Library *)0)->name); + len = sizeof(((Library *)0)->filepath); } else { len = MAX_ID_NAME - 2; @@ -1891,7 +1869,7 @@ static void outliner_buttons(const bContext *C, 0, 0, ""); - UI_but_func_rename_set(bt, namebutton_cb, tselem); + UI_but_func_rename_set(bt, namebutton_fn, tselem); /* returns false if button got removed */ if (false == UI_but_active_only(C, region, block, bt)) { @@ -2288,6 +2266,7 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te) data.icon = ICON_MATERIAL_DATA; break; case TSE_POSEGRP_BASE: + case TSE_POSEGRP: data.icon = ICON_GROUP_BONE; break; case TSE_SEQUENCE: @@ -2702,7 +2681,7 @@ static void tselem_draw_icon(uiBlock *block, 0.0, 1.0, alpha, - (data.drag_id && ID_IS_LINKED(data.drag_id)) ? data.drag_id->lib->name : ""); + (data.drag_id && ID_IS_LINKED(data.drag_id)) ? data.drag_id->lib->filepath : ""); } } @@ -2837,13 +2816,11 @@ int tree_element_id_type_to_index(TreeElement *te) if (id_index < INDEX_ID_OB) { return id_index; } - else if (id_index == INDEX_ID_OB) { + if (id_index == INDEX_ID_OB) { const Object *ob = (Object *)tselem->id; return INDEX_ID_OB + ob->type; } - else { - return id_index + OB_TYPE_MAX; - } + return id_index + OB_TYPE_MAX; } typedef struct MergedIconRow { @@ -3092,7 +3069,7 @@ static void outliner_draw_tree_element(bContext *C, icon_border); GPU_blend(true); /* roundbox disables it */ - te->flag |= TE_ACTIVE; // for lookup in display hierarchies + te->flag |= TE_ACTIVE; /* For lookup in display hierarchies. */ } if (tselem->type == TSE_VIEW_COLLECTION_BASE) { @@ -3103,7 +3080,7 @@ static void outliner_draw_tree_element(bContext *C, /* open/close icon, only when sublevels, except for scene */ int icon_x = startx; - // icons a bit higher + /* Icons a bit higher. */ if (TSELEM_OPEN(tselem, soops)) { UI_icon_draw_alpha((float)icon_x + 2 * ufac, (float)*starty + 1 * ufac, @@ -3129,33 +3106,14 @@ static void outliner_draw_tree_element(bContext *C, offsx += 2 * ufac; } - if (ELEM(tselem->type, 0, TSE_LAYER_COLLECTION) && ID_IS_LINKED(tselem->id)) { - if (tselem->id->tag & LIB_TAG_MISSING) { - UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, - (float)*starty + 2 * ufac, - ICON_LIBRARY_DATA_BROKEN, - alpha_fac); + if (ELEM(tselem->type, 0, TSE_LAYER_COLLECTION) || + ((tselem->type == TSE_RNA_STRUCT) && RNA_struct_is_ID(te->rnaptr.type))) { + const BIFIconID lib_icon = UI_library_icon_get(tselem->id); + if (lib_icon != ICON_NONE) { + UI_icon_draw_alpha( + (float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, lib_icon, alpha_fac); + offsx += UI_UNIT_X + 4 * ufac; } - else if (tselem->id->tag & LIB_TAG_INDIRECT) { - UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, - (float)*starty + 2 * ufac, - ICON_LIBRARY_DATA_INDIRECT, - alpha_fac); - } - else { - UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, - (float)*starty + 2 * ufac, - ICON_LIBRARY_DATA_DIRECT, - alpha_fac); - } - offsx += UI_UNIT_X + 4 * ufac; - } - else if (ELEM(tselem->type, 0, TSE_LAYER_COLLECTION) && ID_IS_OVERRIDE_LIBRARY(tselem->id)) { - UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, - (float)*starty + 2 * ufac, - ICON_LIBRARY_DATA_OVERRIDE, - alpha_fac); - offsx += UI_UNIT_X + 4 * ufac; } GPU_blend(false); @@ -3211,9 +3169,9 @@ static void outliner_draw_tree_element(bContext *C, *starty -= UI_UNIT_Y; LISTBASE_FOREACH (TreeElement *, ten, &te->subtree) { - /* check if element needs to be drawn grayed out, but also gray out - * childs of a grayed out parent (pass on draw_grayed_out to childs) */ - bool draw_childs_grayed_out = draw_grayed_out || (ten->flag & TE_DRAGGING); + /* Check if element needs to be drawn grayed out, but also gray out + * children of a grayed out parent (pass on draw_grayed_out to children). */ + bool draw_children_grayed_out = draw_grayed_out || (ten->flag & TE_DRAGGING); outliner_draw_tree_element(C, block, fstyle, @@ -3221,7 +3179,7 @@ static void outliner_draw_tree_element(bContext *C, region, soops, ten, - draw_childs_grayed_out, + draw_children_grayed_out, startx + UI_UNIT_X, starty, restrict_column_width, @@ -3268,10 +3226,10 @@ static void outliner_draw_hierarchy_lines_recursive(uint pos, /* For vertical lines between objects. */ y1 = y2 = y1_dashed = y2_dashed = *starty; for (te = lb->first; te; te = te->next) { - bool draw_childs_grayed_out = draw_grayed_out || (te->flag & TE_DRAGGING); + bool draw_children_grayed_out = draw_grayed_out || (te->flag & TE_DRAGGING); TreeStoreElem *tselem = TREESTORE(te); - if (draw_childs_grayed_out) { + if (draw_children_grayed_out) { immUniformColor3ubvAlpha(col, grayed_alpha); } else { @@ -3308,7 +3266,7 @@ static void outliner_draw_hierarchy_lines_recursive(uint pos, if (TSELEM_OPEN(tselem, soops)) { outliner_draw_hierarchy_lines_recursive( - pos, soops, &te->subtree, startx + UI_UNIT_X, col, draw_childs_grayed_out, starty); + pos, soops, &te->subtree, startx + UI_UNIT_X, col, draw_children_grayed_out, starty); } } @@ -3529,7 +3487,7 @@ static void outliner_draw_tree(bContext *C, int starty, startx; GPU_blend_set_func_separate( - GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); // only once + GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); /* Only once. */ if (soops->outlinevis == SO_DATA_API) { /* struct marks */ @@ -3552,13 +3510,12 @@ static void outliner_draw_tree(bContext *C, GPU_scissor(0, 0, mask_x, region->winy); } - // gray hierarchy lines - + /* Gray hierarchy lines. */ starty = (int)region->v2d.tot.ymax - UI_UNIT_Y / 2 - OL_Y_OFFSET; startx = UI_UNIT_X / 2 - (U.pixelsize + 1) / 2; outliner_draw_hierarchy_lines(soops, &soops->tree, startx, &starty); - // items themselves + /* Items themselves. */ starty = (int)region->v2d.tot.ymax - UI_UNIT_Y - OL_Y_OFFSET; startx = 0; LISTBASE_FOREACH (TreeElement *, te, &soops->tree) { @@ -3630,9 +3587,7 @@ static int outliner_width(SpaceOutliner *soops, int max_tree_width, float restri if (soops->outlinevis == SO_DATA_API) { return outliner_data_api_buttons_start_x(max_tree_width) + OL_RNA_COL_SIZEX + 10 * UI_DPI_FAC; } - else { - return max_tree_width + restrict_column_width; - } + return max_tree_width + restrict_column_width; } static void outliner_update_viewable_area(ARegion *region, @@ -3665,7 +3620,7 @@ void draw_outliner(const bContext *C) TreeViewContext tvc; outliner_viewcontext_init(C, &tvc); - outliner_build_tree(mainvar, tvc.scene, tvc.view_layer, soops, region); // always + outliner_build_tree(mainvar, tvc.scene, tvc.view_layer, soops, region); /* Always. */ /* If global sync select is dirty, flag other outliners */ if (ED_outliner_select_sync_is_dirty(C)) { |