Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_jobs.c
| Context not available. | |||||
| void (*startjob)(void *, short *stop, short *do_update, float *progress); | void (*startjob)(void *, short *stop, short *do_update, float *progress); | ||||
| /* update gets called if thread defines so, and max once per timerstep */ | /* update gets called if thread defines so, and max once per timerstep */ | ||||
| /* it runs outside thread, blocking blender, no drawing! */ | /* it runs outside thread, blocking blender, no drawing! */ | ||||
| void (*update)(void *); | float (*update)(void *); | ||||
campbellbarton: there is no need for this, `startjob` takes a progress pointer which can be reused. | |||||
| /* free entire customdata, doesn't run in thread */ | /* free entire customdata, doesn't run in thread */ | ||||
| void (*free)(void *); | void (*free)(void *); | ||||
| /* gets called when job is stopped, not in thread */ | /* gets called when job is stopped, not in thread */ | ||||
| Context not available. | |||||
| /* always call note and update when ready */ | /* always call note and update when ready */ | ||||
| if (wm_job->do_update || wm_job->ready) { | if (wm_job->do_update || wm_job->ready) { | ||||
| if (wm_job->update) | if (wm_job->update) { | ||||
| wm_job->update(wm_job->run_customdata); | if (wm_job->job_type == WM_JOB_TYPE_OBJECT_FRACTURE) { | ||||
Not Done Inline ActionsHaving special checks for fracture here raises some alarm bells, surely it can be made to work with existing job system? campbellbarton: Having special checks for fracture here raises some alarm bells, surely it can be made to work… | |||||
| /* sigh, need to get progress from somewhere... */ | |||||
| wm_job->progress = wm_job->update(wm_job->run_customdata); | |||||
| } | |||||
| else { | |||||
| wm_job->update(wm_job->run_customdata); | |||||
| } | |||||
| } | |||||
| if (wm_job->note) | if (wm_job->note) | ||||
| WM_event_add_notifier(C, wm_job->note, NULL); | WM_event_add_notifier(C, wm_job->note, NULL); | ||||
| if (wm_job->flag & WM_JOB_PROGRESS) | if (wm_job->flag & WM_JOB_PROGRESS) | ||||
| WM_event_add_notifier(C, NC_WM | ND_JOB, NULL); | WM_event_add_notifier(C, NC_WM | ND_JOB, NULL); | ||||
| wm_job->do_update = false; | |||||
| if (wm_job->job_type != WM_JOB_TYPE_OBJECT_FRACTURE) { | |||||
| /* why on earth is this set to false here ? need the timer update... or not ?*/ | |||||
| wm_job->do_update = false; | |||||
| } | |||||
| } | } | ||||
| if (wm_job->ready) { | if (wm_job->ready) { | ||||
| Context not available. | |||||
there is no need for this, startjob takes a progress pointer which can be reused.