Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_files.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| /* In case we are given a valid thumbnail data, just generate image from it. */ | /* In case we are given a valid thumbnail data, just generate image from it. */ | ||||
| ibuf_thumb = BKE_main_thumbnail_to_imbuf(NULL, thumb); | ibuf_thumb = BKE_main_thumbnail_to_imbuf(NULL, thumb); | ||||
| } | } | ||||
| else if (BLI_thread_is_main()) { | else if (BLI_thread_is_main()) { | ||||
| int file_preview_type = U.file_preview_type; | int file_preview_type = U.file_preview_type; | ||||
| if (file_preview_type == USER_FILE_PREVIEW_AUTO) { | if (file_preview_type == USER_FILE_PREVIEW_AUTO) { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| bool do_render = (scene != NULL && scene->camera != NULL && | bool do_render = (scene != NULL && scene->camera != NULL && CTX_wm_screen(C) != NULL && | ||||
Severin: I'd rather have a variable and avoid calling `CTX_wm_screen(C)` twice. Not a big deal, but it… | |||||
| (BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_VIEW3D, 0) != NULL)); | (BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_VIEW3D, 0) != NULL)); | ||||
| file_preview_type = do_render ? USER_FILE_PREVIEW_CAMERA : USER_FILE_PREVIEW_SCREENSHOT; | file_preview_type = do_render ? USER_FILE_PREVIEW_CAMERA : USER_FILE_PREVIEW_SCREENSHOT; | ||||
| } | } | ||||
| switch (file_preview_type) { | switch (file_preview_type) { | ||||
| case USER_FILE_PREVIEW_SCREENSHOT: { | case USER_FILE_PREVIEW_SCREENSHOT: { | ||||
| ibuf_thumb = blend_file_thumb_from_screenshot(C, &thumb); | ibuf_thumb = blend_file_thumb_from_screenshot(C, &thumb); | ||||
| break; | break; | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||
I'd rather have a variable and avoid calling CTX_wm_screen(C) twice. Not a big deal, but it does some unnecessary work, possibly including a Python dictionary lookup.