[Bf-blender-cvs] [3a7101f9e8c] soc-2020-outliner: Merge branch 'master' into soc-2020-outliner

Nathan Craddock noreply at git.blender.org
Fri Jul 3 23:17:18 CEST 2020


Commit: 3a7101f9e8c8e97f521c63e09c04f948297d2359
Author: Nathan Craddock
Date:   Fri Jul 3 13:46:19 2020 -0600
Branches: soc-2020-outliner
https://developer.blender.org/rB3a7101f9e8c8e97f521c63e09c04f948297d2359

Merge branch 'master' into soc-2020-outliner

===================================================================



===================================================================

diff --cc source/blender/editors/space_outliner/outliner_draw.c
index 2708eb84639,47215f3ccda..c0ff88ee9af
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@@ -3204,30 -3069,9 +3202,30 @@@ static void outliner_draw_tree_element(
                            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. */
      }
  
 +    /* collection colors */
 +    if (outliner_is_collection_tree_element(te)) {
 +      Collection *collection = outliner_collection_from_tree_element(te);
 +
 +      if (collection->color != COLLECTION_COLOR_NONE) {
 +        bTheme *btheme = UI_GetTheme();
 +        float color[4];
 +        rgba_uchar_to_float(color, btheme->collection_color[collection->color - 1].color);
 +
 +        UI_draw_roundbox_corner_set(UI_CNR_ALL);
 +        UI_draw_roundbox_aa(true,
 +                            (float)startx + offsx + UI_UNIT_X,
 +                            (float)*starty + ufac,
 +                            (float)startx + offsx + 2.0f * UI_UNIT_X,
 +                            (float)*starty + UI_UNIT_Y - ufac,
 +                            UI_UNIT_Y / 4.0f,
 +                            color);
 +        GPU_blend(true);
 +      }
 +    }
 +
      if (tselem->type == TSE_VIEW_COLLECTION_BASE) {
        /* Scene collection in view layer can't expand/collapse. */
      }
@@@ -3421,8 -3265,8 +3419,8 @@@ static void outliner_draw_hierarchy_lin
      *starty -= UI_UNIT_Y;
  
      if (TSELEM_OPEN(tselem, soops)) {
 -      outliner_draw_hierarchy_lines_recursive(
 +      outliner_draw_hierarchy_lines_recursive_old(
-           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);
      }
    }
  
@@@ -3720,11 -3486,8 +3718,11 @@@ static void outliner_draw_tree(bContex
    const uiFontStyle *fstyle = UI_FSTYLE_WIDGET;
    int starty, startx;
  
 +  /* Move the tree a unit left in view layer mode */
 +  short mode_column_offset = (use_mode_column && (soops->outlinevis == SO_SCENES)) ? UI_UNIT_X : 0;
 +
    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 */
@@@ -3747,15 -3510,14 +3745,14 @@@
      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;
 +  starty = (int)region->v2d.tot.ymax - OL_Y_OFFSET;
 +  startx = mode_column_offset + 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;
 +  startx = mode_column_offset;
    LISTBASE_FOREACH (TreeElement *, te, &soops->tree) {
      outliner_draw_tree_element(C,
                                 block,
diff --cc source/blender/editors/space_outliner/outliner_select.c
index 7e77d08c138,8bf05c3018a..a6bdf3ac487
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@@ -529,11 -508,19 +529,9 @@@ static eOLDrawState tree_element_active
    Object *ob = (Object *)outliner_search_back(te, ID_OB);
  
    if (set != OL_SETSEL_NONE) {
 -    scene->camera = ob;
 -
 -    Main *bmain = CTX_data_main(C);
 -    wmWindowManager *wm = bmain->wm.first;
 -
 -    WM_windows_scene_data_sync(&wm->windows, scene);
 -    DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
 -    DEG_relations_tag_update(bmain);
 -    WM_event_add_notifier(C, NC_SCENE | NA_EDITED, NULL);
 -
      return OL_DRAWSEL_NONE;
    }
-   else {
-     return scene->camera == ob;
-   }
+   return scene->camera == ob;
  }
  
  static eOLDrawState tree_element_active_world(bContext *C,



More information about the Bf-blender-cvs mailing list