Friday, October 20, 2006

Clips

There was a question this week about code reuse in QC, and now I fell compelled to talk about that and modularity. The original question was "Now that I've created all these javascript patches, what do I do if I want to reuse them?" The answer is to make a clip, by saving a composition with just the patch(es) you wish to reuse and publish the important ports. You can save them in ~/Library/Application Support/Apple/Developer Tools/Quartz Composer/Clips and they will be available to you in the Clip Library. When you drag those clips to your workspace, they become macros which are fully editable if you double click on them.

*Insert convenient segue here* Speaking of macros, it's a good idea to organize your compositions inside macros in order to make them more readable. More importantly, name them too. It's a lot easier to figure out why your composition isn't drawing anything when you put all your background elements in one macro and realize that it's drawing above your animation :)