Secret Quicksilver animation effects


You may have had a shot at creating a Quicksilver interface. (If you haven’t, see the tutorial). While it’s good fun to play with changing the colors and positions of the controls, there is a whole lot of really clever code in Quicksilver that lets you go beyond that and play with some weird and wacky effects on any window.

[Quicksilver Cube Effect]
Quicksilver is capable of some very futuristic transition effects

Standard Animation Effects

Quicksilver adds a category to the NSWindow class to allow for some pretty cool effects. The following should be pretty self-explanatory:

-(void)pulse:(id)sender;
-(void)flare:(id)sender;
-(void)shrink:(id)sender;
-(void)fold:(id)sender;

What these methods essentially mean, is that you can pulse, flare, shrink or fold any window you have a reference to in a plugin - whether it’s an interface or dialog or something completely different. Eg, just call [window shrink:nil] and watch that NSWindow shrink down to nothing, or [window flare:nil] to make it burst away!

Private Core Graphics Animations

Quicksilver also adds methods to use private Core Graphics transitions for instances of NSWindow or its subclasses. The main method is defined something like:

- (void) displayWithTransition:(CGSTransitionType)type option:(CGSTransitionOption)option duration:(float)duration;

The transitions you have access to are fade, zoom, reveal, slide, warp-fade, swap, warp-switch and the famous cube animation. You can use them on any window, for example:

[window displayWithTransition:CGSCube option:CGSLeft duration:1.3];

To learn more about Core Graphics transitions, see the Core Graphics ebook, or play around with the Core Transitions Framework.

Quicksilver’s CGSPrivate.h file is missing CGSFlip, but you can run the Dashboard-style flip effect by using the integer 9.

Quicksilver’s own animations

Alcor has used various techniques to write several very interesting animation effects into Quicksilver. You’ll be familiar with some of these (just watch the Primer interface activate and deactivate) but for whatever reason, many of these bizarre animations never made into an interface. They’re really very clever. I’ve played around with some of these:

  • QSGrowEffect
  • QSShrinkEffect
  • QSSlightGrowEffect
  • QSSlightShrinkEffect
  • QSBingeEffect
  • QSPurgeEffect
  • QSExplodeEffect
  • QSExtraExtraEffect
  • QSShakeItLikeAPolaroidPictureEffect
  • QSBoobTubeEffect
  • QSVExpandEffect
  • QSVillainousKryptonianEffect
  • QSMMBlowEffect
  • QSLudicrousSpeedEffect

Very interesting to look at, but how does one use these effects?

As we are dealing with Quicksilver, the solution is (as expected) very elegant. There are very simple methods to set a show, hide or execute effect for a window. These methods don’t even require an explanation; they’re so simple:

// Effect for showing the QSWindow
[window setShowEffect:[NSDictionary dictionaryWithObjectsAndKeys:@"QSSlightGrowEffect",@"transformFn",@"show",@"type",[NSNumber numberWithFloat:2.0],@"duration",nil]];

// Effect for hiding the QSWindow
[window setHideEffect:[NSDictionary dictionaryWithObjectsAndKeys:@"QSSlightShrinkEffect",@"transformFn",@"hide",@"type",[NSNumber numberWithFloat:2.0],@"duration",nil]];

// The "execute" effect is slightly different:
[window setWindowProperty:[NSDictionary dictionaryWithObjectsAndKeys:@"QSExplodeEffect",@"transformFn",@"hide",@"type",[NSNumber numberWithFloat:1.5],@"duration",nil] forKey:kQSWindowExecEffect];

Easy!

Sample plugin

[Plugin Icon] I don’t dare mention all this private goodness and not even provide a demonstration. I’ve created an “Effects” plugin that will allow you to change the activate, deactivate and execute effects for any Quicksilver interface temporarily to play around with the effects. Just for good measure, I’ve also thrown in an action that lets you explore Core Graphics transitions as well.

This is not really a bona fide Quicksilver plugin; while it does let you have some fun with the effects, it’s not very user-friendly and doesn’t save your configuration. If these animations prove to be popular, then I’ll write a proper plugin to let you configure the effects more easily (probably through a preference pane) and remembers your settings.

Download Quicksilver Effects Plugin

Usage

Type in the name of the effect you want, then use “Set Hide Effect”, “Set Show Effect” or the “Set Exec Effect” action. The list of effects is given above; just type one in and run the relevant action.

To run a Core Graphics transition, type in the name of the transition, and use the “Run CoreGraphics Transition” action. You can optionally specify a direction in the indirect selector. (You can enter text in the direct and indirect selectors by pressing the period “.” key)

For example

  • “QSBingeEffect” -> Set Show Effect
  • “QSPurgeEffect” -> Set Hide Effect
  • “QSExplodeEffect” -> Set Exec Effect
  • “flip” -> Run CoreGraphics Transition
  • “slide” -> Run CoreGraphics Transition -> “up”
  • “swap” -> Run CoreGraphics Transition -> “inout”

Set Show Effect Set Hide Effect Set Exec Effect Core Graphics Cube Effect Core Graphics Swap Effect
Pictures show how to use the effects plugin. Actual animations are not shown.


Quicksilver has many such hidden surprises and nifty time-saving methods; it’s so well thought out and full of these amazing gems!

What do you think about these animations? Be sure to let me know if you’d like a proper, more user-friendly plugin to use these effects.


Back to Top ↑

8 Comments so far

Leave a comment
  1. 1

    I’d love a more user-friendly plugin to use these effects, because right now I can’t seem to get it to work.

    I type . and then the name of the effect like “QSShakeItLikeAPolaroidPictureEffect”, tab over and “set show effect”, but nothing happens any differently then before.

  2. 2

    Nevermind, I spoke to soon about not getting it to work.

    But i’d still like to see a more proper plug-in to set these animations and perhaps being able to test them out easier ^^

  3. 3

    Cool plugin!

    note: you need to have superfluous visual effects enabled for the non-CoreAnimation effects to work (tick the box on the Appearance preference screen).

    I guess that almost goes without saying.. but I thought I’d say it to prevent any head scratching

  4. 4

    Hey Ankur, another awesome article and some -great- work! Keep up all this fantastic effort on making the fantastic QS even better for us all. I’ve blogged this and made a video of the QSExtraExtraEffect and QSShrinkEffect too, but Youtube’s still processing.

    I just want to encourage you to keep working on all this fantastic stuff you’ve got going on and let me know if you ever need any help.

  5. 5

    I love the Fumo interface, but I cant seem to find the effects from the Effects plugin. Any idea why?

  6. 6

    ZBeard, type the name of the effect in as text, then use one of the actions.

  7. 7

    I love this very much. But the “Set Show Effect” doesn’t work for me. With “Set Hide Effect” and “Set Exec Effect” it works well. Any suggestions?

  8. 8

    Thomas, some of the interfaces (like Bezel) don’t use an effect to show, so even if you change it nothing happens. Try a different interface with the “Set Show Effect” action.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Comments may be edited for formatting.