Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_files.c
| Show First 20 Lines • Show All 427 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void wm_file_read_report(bContext *C) | void wm_file_read_report(bContext *C) | ||||
| { | { | ||||
| ReportList *reports = NULL; | ReportList *reports = NULL; | ||||
| Scene *sce; | Scene *sce; | ||||
| for (sce = G.main->scene.first; sce; sce = sce->id.next) { | for (sce = G.main->scene.first; sce; sce = sce->id.next) { | ||||
| if (sce->r.engine[0] && | ViewRender *view_render = &sce->view_render; | ||||
| BLI_findstring(&R_engines, sce->r.engine, offsetof(RenderEngineType, idname)) == NULL) | if (view_render->engine_id[0] && | ||||
| BLI_findstring(&R_engines, view_render->engine_id, offsetof(RenderEngineType, idname)) == NULL) | |||||
| { | { | ||||
| if (reports == NULL) { | if (reports == NULL) { | ||||
| reports = CTX_wm_reports(C); | reports = CTX_wm_reports(C); | ||||
| } | } | ||||
| BKE_reportf(reports, RPT_ERROR, | BKE_reportf(reports, RPT_ERROR, | ||||
| "Engine '%s' not available for scene '%s' (an add-on may need to be installed or enabled)", | "Engine '%s' not available for scene '%s' (an add-on may need to be installed or enabled)", | ||||
| sce->r.engine, sce->id.name + 2); | view_render->engine_id, sce->id.name + 2); | ||||
| } | } | ||||
| } | } | ||||
| if (reports) { | if (reports) { | ||||
| if (!G.background) { | if (!G.background) { | ||||
| WM_report_banner_show(); | WM_report_banner_show(); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 541 Lines • ▼ Show 20 Lines | if (!(recent) || (BLI_path_cmp(recent->filepath, G.main->name) != 0)) { | ||||
| GHOST_addToSystemRecentFiles(G.main->name); | GHOST_addToSystemRecentFiles(G.main->name); | ||||
| } | } | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* screen can be NULL */ | /* screen can be NULL */ | ||||
| static ImBuf *blend_file_thumb(const bContext *C, Scene *scene, SceneLayer *sl, bScreen *screen, BlendThumbnail **thumb_pt) | static ImBuf *blend_file_thumb(const bContext *C, Scene *scene, SceneLayer *scene_layer, bScreen *screen, BlendThumbnail **thumb_pt) | ||||
| { | { | ||||
| /* will be scaled down, but gives some nice oversampling */ | /* will be scaled down, but gives some nice oversampling */ | ||||
| ImBuf *ibuf; | ImBuf *ibuf; | ||||
| BlendThumbnail *thumb; | BlendThumbnail *thumb; | ||||
| char err_out[256] = "unknown"; | char err_out[256] = "unknown"; | ||||
| /* screen if no camera found */ | /* screen if no camera found */ | ||||
| ScrArea *sa = NULL; | ScrArea *sa = NULL; | ||||
| Show All 24 Lines | static ImBuf *blend_file_thumb(const bContext *C, Scene *scene, SceneLayer *scene_layer, bScreen *screen, BlendThumbnail **thumb_pt) | ||||
| if (scene->camera == NULL && v3d == NULL) { | if (scene->camera == NULL && v3d == NULL) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| /* gets scaled to BLEN_THUMB_SIZE */ | /* gets scaled to BLEN_THUMB_SIZE */ | ||||
| if (scene->camera) { | if (scene->camera) { | ||||
| ibuf = ED_view3d_draw_offscreen_imbuf_simple( | ibuf = ED_view3d_draw_offscreen_imbuf_simple( | ||||
| &eval_ctx, scene, sl, scene->camera, | &eval_ctx, scene, scene_layer, scene->camera, | ||||
| BLEN_THUMB_SIZE * 2, BLEN_THUMB_SIZE * 2, | BLEN_THUMB_SIZE * 2, BLEN_THUMB_SIZE * 2, | ||||
| IB_rect, OB_SOLID, false, false, false, R_ALPHAPREMUL, 0, false, NULL, | IB_rect, OB_SOLID, false, false, false, R_ALPHAPREMUL, 0, false, NULL, | ||||
| NULL, NULL, err_out); | NULL, NULL, err_out); | ||||
| } | } | ||||
| else { | else { | ||||
| ibuf = ED_view3d_draw_offscreen_imbuf( | ibuf = ED_view3d_draw_offscreen_imbuf( | ||||
| &eval_ctx, scene, sl, v3d, ar, | &eval_ctx, scene, scene_layer, v3d, ar, | ||||
| BLEN_THUMB_SIZE * 2, BLEN_THUMB_SIZE * 2, | BLEN_THUMB_SIZE * 2, BLEN_THUMB_SIZE * 2, | ||||
| IB_rect, false, R_ALPHAPREMUL, 0, false, NULL, | IB_rect, false, R_ALPHAPREMUL, 0, false, NULL, | ||||
| NULL, NULL, err_out); | NULL, NULL, err_out); | ||||
| } | } | ||||
| if (ibuf) { | if (ibuf) { | ||||
| float aspect = (scene->r.xsch * scene->r.xasp) / (scene->r.ysch * scene->r.yasp); | float aspect = (scene->r.xsch * scene->r.xasp) / (scene->r.ysch * scene->r.yasp); | ||||
| ▲ Show 20 Lines • Show All 1,158 Lines • Show Last 20 Lines | |||||