Re: Forcing redraw on custom param pushbutton in FCP FxPlug plug-in whenever the frame is changed
Re: Forcing redraw on custom param pushbutton in FCP FxPlug plug-in whenever the frame is changed
- Subject: Re: Forcing redraw on custom param pushbutton in FCP FxPlug plug-in whenever the frame is changed
- From: Benjamin Kent <email@hidden>
- Date: Fri, 07 Dec 2007 15:15:13 +0000
Hi Darrin,
Sorry, it's taken me a while to try out your timer idea - seems to work
okay as far as getting the timer to force a redraw on the custom
parameter UI. The only problem is that when you shift along the timeline
to a previously cached frame, [actionAPI currentTime] doesn't return the
correct time - it seems to just return the last time the effect did any
processing. So for example, go to frame n, let the effect process, shift
to frame n+1, let the effect process, then go back to frame n,
currentTime still returns n+1. Any way to force it to update the time?
Cheers
Ben
Ben Kent, Senior Software Engineer
The Foundry, 1 Wardour Street, London, W1D 6PA, UK
Tel: +44 (0)20 7434 0449 • Fax: +44 (0)20 7434 1550 • Web:
www.thefoundry.co.uk
The Foundry Visionmongers Ltd • Registered in England and Wales No: 4642027
Darrin Cardani wrote:
On Nov 12, 2007, at 9:18 AM, Benjamin Kent wrote:
My plug-in requires an animatable bool parameter (representing the
validity of a frame at given time). So a user will set a single frame
X as invalid, but all other frames should still be valid. This action
really requires setting a value of false at frame X and a value of
true at X-1 and X+1 all in one go (otherwise when setting a value of
false at X, all other frame values would also be set to false).
On other hosts this is either done with a pushbutton which sets the
three key frames on an animatable bool or an animatable integer
parameter, but as it isn't possible for a plug-in to create keyframes
on a parameter in FCP, this was a way around it (using an internal
data structure to store the key frame information and a pushbutton
check box to display the boolean value at a given frame to the user).
I'm sorry, I still don't understand the interaction you're describing.
This all sounds very bizarre to me.
But to answer your original question, about redrawing your button,
here's one method that I can think of. (I don't think this would be
the ideal solution, though.)
You could set up an NSTimer to call back into your plugin
periodically. In your timer callback, you could call -startAction:,
followed by -currentTime: to check if the current time is the same
time as the last time you redrew your UI. If it's not, then you could
call -setNeedsDisplay: on your button, and the OS will tell it to
redraw. Then, of course, call -endAction. In your -drawRect: method,
get the current time and save it for the next time your callback gets
called.
It sounds like what you really want, though, is a way to set keyframes
on check boxes. You're not the only person who wants that, so it's
possible we might add that functionality in the future. (That's not a
guarantee, though! :) ) I'm still not getting why you need to set
keyframes on the previous and next frame, though. It doesn't sound
like something a typical user would understand, either.
Would it be better to have your own timeline in your custom control?
(Again, not a perfect solution, but a workable one.) Then you could
have it do anything you wanted with keyframes, and it would at least
be familiar to users what was happening.
Darrin
--
Darrin Cardani
email@hidden <mailto: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