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 🙂

One Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s