Re: How to distinguish between Viewer and Inspector renders in Motion?
Re: How to distinguish between Viewer and Inspector renders in Motion?
- Subject: Re: How to distinguish between Viewer and Inspector renders in Motion?
- From: Pauli Ojala <email@hidden>
- Date: Tue, 7 Apr 2009 22:06:07 +0300
On 7.4.2009, at 21.57, Darrin Cardani wrote:
On Apr 7, 2009, at 11:51 AM, Pauli Ojala wrote:
In Motion, an FxPlug's render method gets called twice: first for
the "real" render, then for the small preview at the top of the
Inspector window. My plugin now performs analysis on the input
texture, and I don't want the analysis results to get updated when
the tiny preview is rendered, so I need a way to distinguish
between the two types of renders.
Is there a flag passed somewhere that would directly indicate which
type of frame is being rendered? (I may be missing something
completely obvious here...)
We don't supply any way to do this. However, could you do something
like cache the results of the last analysis and reuse them if it's
the same frame value? Or, it's not ideal, but you could cache a
struct holding the frame size and frame number. When asked to
render, if the frame number exists in the cache, only do the
analysis if the frame size is larger than what's stored in the
cache. (Of course, you'll have to figure out if that works for very
small frames, as it may be possible for the actual layer to be
smaller than its preview, I think, in extremely rare cases.)
Thanks, I guess that's what I'm going to do -- caching the frame
number and size should work just fine for what I'm trying to
accomplish. (I'm not too worried about the rare case where the preview
might be larger than the original layer, my main concern is just that
I don't want to pointlessly overwrite the latest analysis results with
a lower-resolution version of the same frame.)
--
Pauli Ojala
Lacquer oy/ltd
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden