I can not figure out how Render plugin CreatePreview() should work.
Ok, I understand the basic concept, but how can is use it asynchronously?
I use progressive render type
protected override PreviewRenderTypes PreviewRenderType()
inside CreatePreview I handle only Quality.RefineThirdPass, and I use scene.PreviewNotifier.NotifyIntermediateUpdate(RenderWindow);
to update the preview.
I can do it fine if it is in the same thread as CreatePreview. But if I open a new Thread for preview calculations I can not call NotifyIntermediateUpdate from there because it triggers an exception. I guess after I return from CreatePreview the previewnotifier is not really valid anymore so my parallel calculation can not use it.
But what is the correct process?