Exemplo n.º 1
0
void ED_preview_kill_jobs(wmWindowManager *wm, Main *bmain)
{
	if (wm)
		WM_jobs_kill(wm, NULL, common_preview_startjob);

	ED_viewport_render_kill_jobs(wm, bmain, false);
}
Exemplo n.º 2
0
void ED_preview_kill_jobs(const struct bContext *C)
{
	wmWindowManager *wm = CTX_wm_manager(C);
	if (wm)
		WM_jobs_kill(wm, NULL, common_preview_startjob);
	
	ED_viewport_render_kill_jobs(C, false);
}
Exemplo n.º 3
0
void ED_viewport_render_kill_jobs(const bContext *C, bool free_database)
{
	wmWindowManager *wm = CTX_wm_manager(C);
	Main *bmain = CTX_data_main(C);
	bScreen *sc;
	ScrArea *sa;
	ARegion *ar;

	if (!wm)
		return;

	/* kill all actively running jobs */
	WM_jobs_kill(wm, NULL, render_view3d_startjob);

	/* loop over 3D view render engines */
	for (sc = bmain->screen.first; sc; sc = sc->id.next) {
		for (sa = sc->areabase.first; sa; sa = sa->next) {
			if (sa->spacetype != SPACE_VIEW3D)
				continue;
			
			for (ar = sa->regionbase.first; ar; ar = ar->next) {
				RegionView3D *rv3d;
				
				if (ar->regiontype != RGN_TYPE_WINDOW)
					continue;
				
				rv3d = ar->regiondata;

				if (rv3d->render_engine) {
					/* free render database now before we change data, because
					 * RE_Database_Free will also loop over blender data */
					if (free_database) {
						char name[32];
						Render *re;

						sprintf(name, "View3dPreview %p", (void *)ar);
						re = RE_GetRender(name);

						if (re)
							RE_Database_Free(re);

						/* tag render engine to update entire database */
						rv3d->render_engine->update_flag |= RE_ENGINE_UPDATE_DATABASE;
					}
					else {
						/* quick shader update */
						rv3d->render_engine->update_flag |= RE_ENGINE_UPDATE_MA;
					}
				}
			}
		}
	}
}
Exemplo n.º 4
0
void thumbnails_stop(struct FileList* filelist, const struct bContext* C)
{
	WM_jobs_kill(CTX_wm_manager(C), filelist, NULL);
}
Exemplo n.º 5
0
void ED_preview_kill_jobs(wmWindowManager *wm, Main *UNUSED(bmain))
{
  if (wm) {
    WM_jobs_kill(wm, NULL, common_preview_startjob);
  }
}