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: Mon, 19 Nov 2007 18:47:41 +0000
Essentially, yes, I do want to just set keyframes on check boxes. But
the behaviour we need is that the box is checked on a given frame unless
the user has explicitly unchecked it at that frame. Now, with a normal
keyframeable check box with a default value of checked, when the user
sets the first keyframe by unchecking a box, it will uncheck the box at
all frames. So we need to set a keyframe either side of this frame to
stop this happening.
So, given a sequence with the check box represented by a binary value,
and bold indicating a keyframe, the default state is:
1 1 1 1 1 1 1 1 1
The user then sets a keyframe by unchecking the box at a frame - the
normal behaviour would be:
0 0 0 0 *0 *0 0 0 0
Whereas we want this behaviour:
1 1 1 1 *0 *1 1 1 1
So we set the keyframes either side:
1 1 1 *1 0 1 *1 1 1
One way round this I suppose would be to automatically set a keyframe
with value 1 at every frame when initializing the plug-in. But frankly
this is all a little moot being as there aren't keyframeable check boxes
anyway :)
If this makes sense now, you couldn't expand on your idea for a timeline
in a custom control could you? Or any other ideas that come to mind. I
haven't had a chance to try the timer approach yet - I'll give it a go,
but as you say it's not ideal - sounds bound to come back and bite me.
Cheers
Ben
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