Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_draw.c
| Show First 20 Lines • Show All 308 Lines • ▼ Show 20 Lines | static void outliner_object_set_flag_recursive_fn(bContext *C, | ||||
| else { | else { | ||||
| BKE_layer_collection_sync(scene, view_layer); | BKE_layer_collection_sync(scene, view_layer); | ||||
| DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); | DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); | ||||
| } | } | ||||
| } | } | ||||
| /** | /** | ||||
| * Object properties. | * Object properties. | ||||
| * */ | */ | ||||
| static void outliner__object_set_flag_recursive_fn(bContext *C, void *poin, void *poin2) | static void outliner__object_set_flag_recursive_fn(bContext *C, void *poin, void *poin2) | ||||
| { | { | ||||
| Object *ob = poin; | Object *ob = poin; | ||||
| char *propname = poin2; | char *propname = poin2; | ||||
| outliner_object_set_flag_recursive_fn(C, NULL, ob, propname); | outliner_object_set_flag_recursive_fn(C, NULL, ob, propname); | ||||
| } | } | ||||
| /** | /** | ||||
| * Base properties. | * Base properties. | ||||
| * */ | */ | ||||
| static void outliner__base_set_flag_recursive_fn(bContext *C, void *poin, void *poin2) | static void outliner__base_set_flag_recursive_fn(bContext *C, void *poin, void *poin2) | ||||
| { | { | ||||
| Base *base = poin; | Base *base = poin; | ||||
| char *propname = poin2; | char *propname = poin2; | ||||
| outliner_object_set_flag_recursive_fn(C, base, NULL, propname); | outliner_object_set_flag_recursive_fn(C, base, NULL, propname); | ||||
| } | } | ||||
| /** Create either a RNA_LayerCollection or a RNA_Collection pointer. */ | /** Create either a RNA_LayerCollection or a RNA_Collection pointer. */ | ||||
| ▲ Show 20 Lines • Show All 356 Lines • ▼ Show 20 Lines | if (tselem->type == 0) { | ||||
| WM_event_add_notifier(C, NC_SCENE, NULL); | WM_event_add_notifier(C, NC_SCENE, NULL); | ||||
| break; | break; | ||||
| case ID_OB: { | case ID_OB: { | ||||
| Object *ob = (Object *)tselem->id; | Object *ob = (Object *)tselem->id; | ||||
| if (ob->type == OB_MBALL) { | if (ob->type == OB_MBALL) { | ||||
| DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | ||||
| } | } | ||||
| DEG_id_tag_update(&ob->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(&ob->id, ID_RECALC_COPY_ON_WRITE); | ||||
| WM_event_add_notifier(C, NC_ID | NA_RENAME, NULL); | |||||
| break; | break; | ||||
| } | } | ||||
| default: | default: | ||||
| WM_event_add_notifier(C, NC_ID | NA_RENAME, NULL); | |||||
| break; | break; | ||||
| } | } | ||||
| WM_event_add_notifier(C, NC_ID | NA_RENAME, NULL); | |||||
| /* Check the library target exists */ | /* Check the library target exists */ | ||||
| if (te->idcode == ID_LI) { | if (te->idcode == ID_LI) { | ||||
| Library *lib = (Library *)tselem->id; | Library *lib = (Library *)tselem->id; | ||||
| char expanded[FILE_MAX]; | char expanded[FILE_MAX]; | ||||
| BKE_library_filepath_set(bmain, lib, lib->filepath); | BKE_library_filepath_set(bmain, lib, lib->filepath); | ||||
| BLI_strncpy(expanded, lib->filepath, sizeof(expanded)); | BLI_strncpy(expanded, lib->filepath, sizeof(expanded)); | ||||
| ▲ Show 20 Lines • Show All 1,975 Lines • ▼ Show 20 Lines | static void outliner_draw_iconrow_number(const uiFontStyle *fstyle, | ||||
| int ys, | int ys, | ||||
| const int num_elements) | const int num_elements) | ||||
| { | { | ||||
| const float color[4] = {0.0f, 0.0f, 0.0f, 1.0f}; | const float color[4] = {0.0f, 0.0f, 0.0f, 1.0f}; | ||||
| float ufac = 0.25f * UI_UNIT_X; | float ufac = 0.25f * UI_UNIT_X; | ||||
| float offset_x = (float)offsx + UI_UNIT_X * 0.35f; | float offset_x = (float)offsx + UI_UNIT_X * 0.35f; | ||||
| UI_draw_roundbox_corner_set(UI_CNR_ALL); | UI_draw_roundbox_corner_set(UI_CNR_ALL); | ||||
| UI_draw_roundbox_aa(true, | UI_draw_roundbox_aa( | ||||
| offset_x + ufac, | &(const rctf){ | ||||
| (float)ys - UI_UNIT_Y * 0.2f + ufac, | .xmin = offset_x + ufac, | ||||
| offset_x + UI_UNIT_X - ufac, | .xmax = offset_x + UI_UNIT_X - ufac, | ||||
| (float)ys - UI_UNIT_Y * 0.2f + UI_UNIT_Y - ufac, | .ymin = (float)ys - UI_UNIT_Y * 0.2f + ufac, | ||||
| .ymax = (float)ys - UI_UNIT_Y * 0.2f + UI_UNIT_Y - ufac, | |||||
| }, | |||||
| true, | |||||
| (float)UI_UNIT_Y / 2.0f - ufac, | (float)UI_UNIT_Y / 2.0f - ufac, | ||||
| color); | color); | ||||
| /* Now the numbers. */ | /* Now the numbers. */ | ||||
| uchar text_col[4]; | uchar text_col[4]; | ||||
| UI_GetThemeColor3ubv(TH_TEXT_HI, text_col); | UI_GetThemeColor3ubv(TH_TEXT_HI, text_col); | ||||
| text_col[3] = 255; | text_col[3] = 255; | ||||
| uiFontStyle fstyle_small = *fstyle; | uiFontStyle fstyle_small = *fstyle; | ||||
| Show All 33 Lines | static void outliner_draw_active_indicator(const float minx, | ||||
| const float maxy, | const float maxy, | ||||
| const float icon_color[4], | const float icon_color[4], | ||||
| const float icon_border[4]) | const float icon_border[4]) | ||||
| { | { | ||||
| const float ufac = UI_UNIT_X / 20.0f; | const float ufac = UI_UNIT_X / 20.0f; | ||||
| const float radius = UI_UNIT_Y / 4.0f; | const float radius = UI_UNIT_Y / 4.0f; | ||||
| UI_draw_roundbox_corner_set(UI_CNR_ALL); | UI_draw_roundbox_corner_set(UI_CNR_ALL); | ||||
| UI_draw_roundbox_aa(true, minx, miny + ufac, maxx, maxy - ufac, radius, icon_color); | UI_draw_roundbox_aa( | ||||
| UI_draw_roundbox_aa(false, minx, miny + ufac, maxx, maxy - ufac, radius, icon_border); | &(const rctf){ | ||||
| .xmin = minx, | |||||
| .xmax = maxx, | |||||
| .ymin = miny + ufac, | |||||
| .ymax = maxy - ufac, | |||||
| }, | |||||
| true, | |||||
| radius, | |||||
| icon_color); | |||||
| UI_draw_roundbox_aa( | |||||
| &(const rctf){ | |||||
| .xmin = minx, | |||||
| .xmax = maxx, | |||||
| .ymin = miny + ufac, | |||||
| .ymax = maxy - ufac, | |||||
| }, | |||||
| false, | |||||
| radius, | |||||
| icon_border); | |||||
| GPU_blend(GPU_BLEND_ALPHA); /* Roundbox disables. */ | GPU_blend(GPU_BLEND_ALPHA); /* Roundbox disables. */ | ||||
| } | } | ||||
| static void outliner_draw_iconrow_doit(uiBlock *block, | static void outliner_draw_iconrow_doit(uiBlock *block, | ||||
| TreeElement *te, | TreeElement *te, | ||||
| const uiFontStyle *fstyle, | const uiFontStyle *fstyle, | ||||
| int xmax, | int xmax, | ||||
| int *offsx, | int *offsx, | ||||
| ▲ Show 20 Lines • Show All 934 Lines • Show Last 20 Lines | |||||