Re: Cutting a generator on the timeline
Re: Cutting a generator on the timeline
- Subject: Re: Cutting a generator on the timeline
- From: Darrin Cardani <email@hidden>
- Date: Thu, 2 Apr 2009 08:53:46 -0700
On Apr 2, 2009, at 2:20 AM, Kristian Harms wrote:
Den 2. april. 2009 kl. 02.57 skrev Brian Gardner:
When I put my generator on the timeline and cut it in half,
the second half now restarts the generator at frame 1.
I'd like to have the generated frames on either side of
the cut look identical to how they looked before the cut.
Can I do that?
-- Brian
I'd very much like to second what Brian is saying here, this is
something our users would also benefit from. Maybe an auxiliary step
to "freeze" a generator, take a rendered generator and turn it into
something that behaves more like video item could be employed, after
which the cut-in-half operation would behave like Brian describes.
We've actually discussed this before, and it was part of the impetus
for the FxTimingAPI. You can use the FxTimingAPI to figure out when
your effect, generator or transition starts and how long it is. I'm
not sure if that gives you everything you need or not, but it looks
like these 2 methods from FxTimingAPI.h will give you some of the
information you need:
/*!
@method startTimeForEffect:
@abstract Returns the start time of the given effect.
@param effect The plug-in object.
@result The effect's start time, expressed in timeline frames.
*/
- (double)startTimeForEffect:(id<FxBaseEffect>)effect;
/*!
@method durationForEffect:
@abstract Returns the duration of the given effect.
@param effect The plug-in object.
@result The effect's duration, expressed in timeline frames.
*/
- (double)durationForEffect:(id<FxBaseEffect>)effect;
So if the normal case is that the user cuts the generator in 2, but
doesn't move it, then you can use the start time of the effect as an
offset. Just add it to the renderInfo.frame value before doing your
time-based calculations and it should work like you want. (You might
need to convert to timeline time, or something like that - I don't
remember off the top of my head.)
In the case where you're using image wells in your generator, you'd
need to add the start time of the generator to the time you send to -
getBitmap/Texture:fromParm:atTime:.
A somewhat related request that I would like to put forward (related
because it also involves getting two generator instances from one,
without making a new instance from scratch) is to have some sort of
notification when the user uses copy and paste on a generator. While
there would be many who wouldn't have any use for this, in our
particular case it would be most helpful. The value of our custom
parameter contains a persistent ID which we map to objects in an
internal data structure (shared by our generator instances), and the
current situation will sometimes lead to multiple generators with
the same ID. While we have managed to maintain correct operation, it
does create a performance hit.
That seems like an extremely specialized bit of functionality. I'm
trying to figure out how we'd notify your plugin that it was a
duplicate of the other one rather than a fresh instance just added to
the project and when we'd have to make the distinction. Would the case
of copying and pasting into the same document be different from
copying and pasting into another document? What about when using the
clone feature in Motion? Again, I'm having a hard time seeing where
this would be useful to plugin developers in general. Maybe there's a
way to keep the functionality in your plugin but make it perform better?
Darrin
--
Darrin Cardani
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