Archive for April, 2008

Tip: Save QuickTime 7 movies to disk without a Pro key

Thursday, April 24th, 2008

macosxhints.com describes a handy way to save downloaded QuickTime 7 movies without a Pro key. It works by exploiting in combination two trivial bugs in QuickTime Player:

Bug #1: Cut remains enabled in the contextual menu even without a Pro key

The Cut feature, the one that lets you cut a portion of the movie to the clipboard, is disabled in the main menu when you don’t have a Pro key, but it remains enabled in the contextual menu. Press Command-X to cut and you’ll see the you need to upgrade to QuickTime Pro dialog, but control-click to choose Cut from the contextual menu and everything works fine: no dialog, and the current selection gets cut from the movie onto the clipboard. This sets the stage for the second bug.

Bug #2: Closing a modified movie displays a Save As dialog even without a Pro key

The Save command is disabled in the File menu if you don’t have a Pro key, so Command-S won’t work. But when you’re closing a modified movie, you’ll still see the Save As dialog.

And there’s the connection: since the first bug let you modify the movie—you cut a frame—the second bug displays the Save As… dialog when you attempt to close the window. This combination lets you successfully save the movie.

Humorous, and perhaps embarrassing for some Apple engineer, at least until Apple gets around to fixing it. But that tip was posted on macosxhints.com two years ago and the bugs still haven’t been fixed.

Animation: From Cartoons to the User Interface

Wednesday, April 23rd, 2008

Why does the Genie effect of an OS X window minimizing to the Dock look so cartoony? Why is the pop! of an iChat invitation so exaggerated? When you unlock your iPhone, why do the icons dance?

The answers might lie in Animation: From Cartoons to the User Interface, a research paper written in 1995 by Bay-Wei Chang and David Ungar:

User interfaces are often based on static presentations, a model ill suited for conveying change. Consequently, events on the screen frequently startle and confuse users. Cartoon animation, in contrast, is exceedingly successful at engaging its audience; even the most bizarre events are easily comprehended.
Animation: From Cartoons to the User Interface, March 1995

Chang and Ungar discuss cartoon-style animation with reference to the Self programming language popular in the 1980s and 1990s, but the points they make about how such animation can be used to improve transition and feedback apply uncannily well to Apple’s software designs. Without cartoon techniques, they say, user interfaces are hard because you have to think too hard to make sense of things appearing and disappearing, or jumping from point to point:

Users overcome obstacles like these by experience. The first few encounters are the worst; eventually users learn the behavior of the interface and come to interact with it efficiently. Yet while some of the cognitive load of interpreting changes in the interface may be reduced through repeated exposure, it is likely that some burden remains. For example, a user may know that clicking an icon will open a window, but the sudden change to the screen when the window opens may still require a moment of assessment. 

In the real world, the writers say, things don’t appear and disappear, and they don’t jump around instantly. In the real world, things are physical and have weight.

Cartoon characters do not simply disappear from one place and appear in another; they appear to move solidly and continuously. Cartoon objects do not flash suddenly into different sizes and shapes; they appear to grow and deform smoothly. Animation provides the visual cues necessary to understand what is happening before, during, and after the action. Unlike user interfaces which burden the user with the responsibility of relying on experience and deductive ability to interpret changes, cartoon animation leverages off of human experience of how objects change and move smoothly in the real world.

Drawing from classic animations texts, they discuss how things can made to seem more real by applying animation principals emphasizing solidity, exaggeration, and reinforcement. Read the paper to learn more about how these principals can be implemented, but it’s clear they’ve influenced Apple designers.

And to my knowledge, Apple hasn’t yet used two of the techniques mentioned by the writers. The first technique, motion blur, you know already from Warner Bros cartoons if you’ve seen the Road Runner speeding down the highway in a blue and red streak with Wile E. Coyote in hot pursuit, his own legs spinning furiously. Motion blur is useful to compensate for movement so rapid that an object moves from here to there too quickly for the eye to follow, making the glimpses of the movement you do catch seem disjointed and confusing. With motion blur, as with the Road Runner’s blistering speed, the sense and direction of movement are strengthened by clarifying the motion from here to there with a blurred representation of the moving object. This is already commonplace in Pixar movies. The next time you’re watching The Incredibles on DVD, slow down virtually any scene—especially Dash’s run through the forest and onto the water—and you’ll see a surprising amount of blur.

Apple hasn’t used motion blur in OS X yet, possibly due to the processing power needed, but it would be a natural addition.

Arcs, the second technique Apple has yet to use, capitalize on the simple fact that nature rarely moves in a straight line, but rather travels along smooth curves. When you throw a baseball to someone, you throw it high enough to arc across to the catcher; When you’re running and decide to go left, you lean and curve to your left. It’s so natural you don’t even notice it, because you’re used to dealing with the natural world and that’s how the natural world works.

Apple has hinted at these arcs in places such as the Genie effect as you minimize a window to the Dock, but not to the degree the writers advocate. To date, In OS X things usually move in a straight line. Hit F9 now to activate Expose and notice how the windows move in straight lines to their destinations. Now imagine how much more natural and organic it would look, how much more real it would look if the windows moved in gentle curves instead.

Perhaps Apple has already tried it and didn’t like it, but with Core Animation, applying gentle curves to these motions has never been easier. Maybe we’ll see more curves in future releases.

Core Animation: Creating a Jack-in-the-box with CAKeyframeAnimation

Sunday, April 20th, 2008

jack.png

A previous example demonstrated how CAKeyframeAnimation can move layers along a CGPath, but CAKeyframeAnimation can also move a layer through a succession of points with a custom timing for each point. You might animate a pendulum with two points representing the extreme limits of its swing, for example, easing the pendulum into and out of each swing.

But pendulums are boring—so let’s animate a Jack-in-the-box instead! Our Jack-in-the-box will be simple: just a box and lid containing a spring with a clown’s head attached. When you close the box, the spring and head are hidden inside. And when you open the box, the lid flies open and the spring and head bounce out.

These motions require 4 animations:

  1. The lid of the box opens with enough force that it bounces back, then gradually settles into its open position.
  2. The spring bounces from compressed to full height, then gradually bounces down to its relaxed position.
  3. Jack’s head bounces in tandem with the attached spring.
  4. Jack’s head wobbles exaggeratedly until coming to rest in an upright position.

We’ll use CAKeyframeAnimation for each of the animations.

(more…)

Core Animation: 3D Perspective

Monday, April 14th, 2008

Last time, we looked at how Core Animation lets you perform simple animations, including animating along paths.

Now, using Core Animation, let’s look at a way to simulate a 3D perspective. Core Animation is not ideal for 3D graphics—use OpenGL for that—but it’s handy to be able to use 3D perspective at times for simpler things.

For this example, we’ll display a two-room house with a front door.

plot.png

(more…)

Tip: Make iChat speak your messages in Leopard

Sunday, April 13th, 2008

Leopard’s new Alex voice is much better than the voices included in previous versions of Mac OS X. In fact, Alex is good enough to use in iChat, where you can have messages read to you as they arrive. It’s a surprisingly nice effect.

Here’s how to tell Alex to read your messages in iChat:

1. Open iChat Preferences.

2. Click the Alerts tab.

3. Choose Message Received from the Event popup menu at the top of the window.

3. Turn off Play sound.

4. Turn on Announce when event occurs.

Your window should like this:

ichat_speak_sound.png

When you’re working with iChat hidden in the background and a message comes in, it can be handy at times to hear Alex speak up.

Core Animation: Paths

Thursday, April 10th, 2008

We’ve seen early uses of animation in Mac OS X and some of the ways Core Animation is used in Leopard, but whether Core Animation will be broadly adopted depends in part on how easy it is to code. If it’s hard to code, developers will avoid it, but if it’s easy they’ll use it everywhere.

So let’s take a closer look at Core Animation from the developer’s perspective by writing some code, starting with three simple animations: spinning a wheel; moving that spinning wheel along an arbitrary path; and rotating that path in all three dimensions while the wheel spins and moves along it.

animate_rotate_element.png animate_along_path.png animate_rotate_scene.png
Spinning a wheel Animating along a path Rotating path in 3 dimensions

(more…)

Tip: You will ♡ Apple’s Character Palette

Thursday, April 3rd, 2008

Did you know you can type a snowman , and a phone ? How about musical symbols liks ��, ��, ��, ��, and ��?

Apple’s Character Palette lets you type interesting characters like these without straining your memory.

Here’s how to open the Character Palette:

1. Open System Preferences and click on the International icon.

system_prefs_international.png

2. Click on the Input Menu panel (the one on the right), then make sure both Show input menu in menu bar (bottom-left corner) and Character Palette (first item in the list) are checked.

international.png

3. Close System Preferences. You should now see a new flag icon up in your menu bar, near Spotlight in the upper-right corner.

4. Choose Show Character Palette from the menu. If you have a lot of fonts, it may take some time for the Character Palette to appear the first time.

international_menubar.png

The Character Palette groups characters into various categories like Geometrical , Arrows , Mathematical , and Currency .

When you see character you’re looking for, just double-click it to insert it into your document.

character_palette.png

There’s a lot more to the Character Palette, including a powerful search feature, detail panels for character info and variations. You can designate favorites, too.

Once you give it a try, you’ll appreciate not having to remember how to type those characters—just open the Character Palette!