Re: How to distinguish between Viewer and Inspector renders in Motion?
site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com On 7.4.2009, at 21.57, Darrin Cardani wrote: On Apr 7, 2009, at 11:51 AM, Pauli Ojala wrote: -- Pauli Ojala Lacquer oy/ltd pauli@lacquer.fi _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/site_archiver%40lists.ap... 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.) This email sent to site_archiver@lists.apple.com
participants (1)
-
Pauli Ojala