Thursday, April 24, 2008

Massively Useful Software: AutoHotkey

Like most people, the first time you need to use a macro program it's for something completely immature and nonconstructive. For me, I needed something like AutoHotkey to quickly generate my 3-line Cute Bunny Giving You the Bird ASCII graphic into the game chat before someone realized what was going on—which was usually around the "( ._.) ..!." line—and then they assault it by quickly sending something like "asdf" which decapitates my bunny!

I wasn't going to take that kind of treatment anymore, and no bunny deserves to be decapitated, so I used AutoHotkey to create a macro that creates the bunny immediately without having to type it in by hand. No one could stop it and no more bunnies ever died again. Well, that's not entirely true. There were a couple of stray lines of text that killed a few Cute Bunnies Giving You the Bird, but the mortality rate was much lower.

Of course macros are useful for constructive things too. This neat little open source Windows program is extremely robust. It uses a powerful scripting language that not only lets you create simple keyboard macros, but you can also run programs, manipulate files, receive input from joysticks, control the mouse cursor, modify variables, and then save it either as a script file or an .exe file so AutoHotkey doesn't even have to be installed to use the script.

But for me, since I don't want to learn the scripting language that much, the only thing I really use it for is entering high bit characters, HTML entity references, and of course Cute Bunnies Giving You the Bird. Creating a script is simple, and there's a tool that comes with it that makes it easier.

Here's a script that I made that lets me use Unicode punctuation marks in the name of good typography: the en dash, the em dash, the ellipsis, and actual left/right quotation marks instead of the ambidextrous quotation marks that are on your keyboard (which are called primes actually, and they are only supposed to be used as inch and foot marks). The script is lovingly called "typography_nut", and it's in response to one of the things that I love about Macs.

The Mac already has neat shortcuts like Option-Hyphen to create and en dash. In Windows you have to hold down Alt, type 0150 on the numeric keypad, and then release the Alt key to create one. Once again AutoHotkey comes to the rescue, and this is one of the many reasons why it's one of my massively useful programs. I'll even go as far as saying that this is a must-have script for graphic designers that use a PC.

Anyway, here's the script:

; Script: typography_nut

; This AutoHotkey script lets you quickly input typographical characters without
; having to memorize the Alt code number. The glyph, Alt code number and hotkey
; are listed below. You are welcome to change the hotkeys to whatever you feel
; comfortable with. - Glen Moyes

; Em Dash - Alt 0151
; Ctrl-Hyphen

^-::Send, {ALTDOWN}{Numpad0}{Numpad1}{Numpad5}{Numpad1}{ALTUP}

; En Dash - Alt 0150
; Ctrl-Alt-Hyphen

^!-::Send, {ALTDOWN}{Numpad0}{Numpad1}{Numpad5}{Numpad0}{ALTUP}

; Ellipsis - Alt 0133
; Ctrl-Period

^.::Send, {ALTDOWN}{Numpad0}{Numpad1}{Numpad3}{Numpad3}{ALTUP}

; Left Single Quote - Alt 0145
; Ctrl-[

^[::Send, {ALTDOWN}{Numpad0}{Numpad1}{Numpad4}{Numpad5}{ALTUP}

; Right Single Quote - Alt 0146
; Ctrl-]

^]::Send, {ALTDOWN}{Numpad0}{Numpad1}{Numpad4}{Numpad6}{ALTUP}

; Left Double Quote - Alt 0147
; Ctrl-Alt-[

^![::Send, {ALTDOWN}{Numpad0}{Numpad1}{Numpad4}{Numpad7}{ALTUP}

; Right Double Quote - Alt 0148
; Ctrl-Alt-]

^!]::Send, {ALTDOWN}{Numpad0}{Numpad1}{Numpad4}{Numpad8}{ALTUP}
The script has all the documentation so you can read what the hotkeys are and what they do.

If you want to use this macro, just copy and paste it into a text file called "typography_nut.ahk" and double-click on the file after you've installed AutoHotkey. There will be an icon loaded on your System Tray for every script you have loaded.

Also, make sure that whatever shortcut you choose for your macro isn't also the same shortcut as one that's used in the current application. For example, the above macro uses Ctrl-[ and Ctrl-] as shortcuts, which is an Illustrator shortcut as well, meaning that the shortcut can only be used by the macro. Changing the "^" to a "#" (representing the Windows key) in the script will fix that problem because the Windows key is not used in individual applications, so there won't be any shortcut conflicts. However, you may not like the having the Start Menu pop up when you fumble on a shortcut. And remember that you can turn the macro off at any time easily.

So have fun with this script and have fun with AutoHotkey.

Friday, April 11, 2008

Previous Work Re-rendered in HD

I never intended on revisited any of my school work, but since Vimeo's HD service is so good I was strongly compelled to re-render my motion design work in 720p. It also helped that I have a trial version of After Effects installed, so this will be the only chance I'll have to do this for a while, now that I'm away from school and don't have access to the Mac Lab.

So here it is: all three projects from my motion design class, including one which you haven't seen before, in HD.

Wonder
This is the first project that I revisited earlier this week. I had to determine what version of Blender I used to make it because it wouldn't render properly with the newest version. Instead of rendering at the original 1024x576 resolution with no anti-aliasing, I re-rendered it at 1280x720 with 8x anti-aliasing. It took 2 days, but it's oh so pretty! Of course only after rendering did I noticed a couple of mistakes with the petals in the background. One would snap to a different rotation for a second and then go back again, and a couple of petals in the background would pop into existence while in-frame (I used a particle system to create the petals, and the petal's birth was supposed to happen off-frame so you couldn't see it happen).

I fixed both of those issues and had it render for another day, but now it's done and it looks awesome.

>> Watch this video streamed in HD (720p)

Sneakers
I made this one in the Mac Lab, so naturally all of the fonts were broken. Fixing that was tedious because of the crazy text animation I did. There was also a few problems in the animation that I fixed as well (at that smaller resolution I never noticed that the last S in the Sneakers title drifted down). Anyway, it's done and available for your viewing pleasure.

>> Watch this video streamed in HD (720p)

One thing I will add that is really nice about Vimeo's service is that you can replace the videos with newer ones, so I didn't have to re-link anything on my blog even going from web quality to HD.

Bad Robot

>> Watch this video streamed in HD (720p)

Now this video was HD to begin with; I was planning on having all of my projects rendered in HD. However, this video was also the reason why the rest for that class were 1024x576. First off, QuickTime is stupid. If you open a video file that's larger than the screen size it doesn't scale it to fit until you press Command-3 (and there's no full-screen mode unless you "go Pro" for $30). I was surprised that no one besides myself knew about that shortcut, even my Mac-using instructors. He didn't like having a video larger than the screen and later asked the class to send him all videos in 320x240 for concerns about frame and file size (some students used a raw codec to save the files). I of course rebelled, and made the videos just big enough to fit on screen, and encoded it properly so the file size was reasonable. There weren't any complaints though.

Anyway, I revisited Bad Robot just so I could get a clean rendering of the video and in a format that I like. I've been using Blender a lot to encode videos because it has good ffmpeg support (in Windows anyway). Since revisiting these projects I've now used Blender to encode all of the files that I uploaded to Vimeo so far (except for the Touch the Table video, but that's not motion design).

I really like Vimeo. I just can't wait until embed videos, like what I have on my blog, can be viewed in HD instead of following the link to view it on their site.