Hi Charlie,

just google "state machine", there are lots of definitions out there. In short: A state machine is a programming pattern, where the "state" of your machine is always a single one out of a set. In your case: each of your animation phases is a state and you switch from one state to another only if a certain condition is met.

Find enclosed a composition where I tried to build your animation with a state machine implemented in _javascript_.

In our Video Production Software BoinxTV we use a lot of state machines in the QuartzCompositions because they are very robust.

best,

Achim Breidenbach
Boinx Software

Attachment: Simple Swipe-In.qtz
Description: application/quartzcomposer


On 02.11.2010, at 16:36, Charlie Francis wrote:

Thank you very much Keith.

This is exactly the kind of thing I was looking for to solve this particular problem.
I edited it to animate the mask image, animating the crop x value using a maths function connected to the 0 to 1 scale.

Achim:
I have been using the Sample & Hold patch quite a lot, but my main problem has been generating the point of sampling.
I'll certainly look into the Swipe patch, there are so many patches in Quartz that it's impossible to just stumble upon them without a guide.
Could you please explain to me what a state machine is, and how to create it?

I was thinking about trying to make an animation queuing system, but I think it's completely beyond me. Especially as I come a background of PHP programming (scripting if you will).

Regards,
Charlie

On 1 November 2010 22:49, Keith Lang <[email protected]> wrote:
Hi Charlie,

This is how I would do it with the minimum of patches and no
_javascript_ (not that it should be avoided).

I'm using a Smooth patch here for the most robust interaction, where
potentially the user is changing input values again while the
transition is still taking place.

Basically, the patch
1. watches for a change in input
2. Sets target alpha to 0
3. Alpha is smoothed down to 0
4. When smoothed output hits 0, the text is updated to match current
input using Sample & Hold (as per Achim's suggestion)
5. Target alpha is set to 1
6. Alpha smoothly moves back to 1

I'm not sure what you were doing with the mask etc, I'll leave that
bit up to you.


Keith


On Tue, Nov 2, 2010 at 6:19 AM, Achim Breidenbach <[email protected]> wrote:
> Hi Charlie,
>
> just my two cents:
>
> - have a look at the "Sample & Hold" patch, which can help you keeping the old string as long as you needed to fade it out, then switching to the new text from your string input patch.
>
> - you properly don't need to create your own mask with the gradient, try to apply the "Swipe" patch on your text image.
>
> - maybe it would be much simpler to implement a state machine in a _javascript_ patch instead of doing all the transition controlling in pure QC.
>
> Best,
>
> Achim Breidenbach
> Boinx Software
>
>
> On 01.11.2010, at 17:49, Charlie Francis wrote:
>
>> Hi,
>>
>> I'm currently trying to create a composition that will animate a mask over an image, change the text supplied to that image, and then animate the mask back. All on a command input.
>>
>> I have created a composition that does this, but I don't feel that it is Robust enough, and it flickers when the text changes.
>> The way I would like this to happen is that the first text string is stored in a multiplexer as a default value, any time the update string is left blank, the animation fades out and replaces it with default value.
>> If the string is updated with another value, then the current string should fade out and then be replaced by the new string.
>>
>> I've attached a copy of the test composition I've been working on. I'm still a big beginner in this Quartz Animation stuff, so would like to know some guidelines on how I can improve my skills! And better ways of setting up this type of 'command, fire animation, fire animation, end' stack
>>
>> Regards,
>> Charlie
>> <fade_animation.qtz> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Quartzcomposer-dev mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/quartzcomposer-dev/achim%40boinx.com
>>
>> This email sent to [email protected]
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Quartzcomposer-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/quartzcomposer-dev/songcarver%40gmail.com
>
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/charlief%40cellcastonline.com

This email sent to [email protected]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/achim%40boinx.com

This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to