Creating PDFs in Processing and post-processing them in Adobe Illustrator, I frequently find myself wanting to do things like adjust global transparency levels, colors etc. So far that’s been frustrated by the rather poor color adjustment options built into Illustrator, but today I finally got impatient enough to look into a scripting solution.
Illustrator has had Javascript support since CS 1, exposing the document object model to anyone with a bit of scripting savvy. Adobe is good about publishing technical documents, perhaps a holdover from the days when they relied on PostScript to build their empire. So anyone can go to the online scripting documentation and download a complete PDF with a description of the Illustrator API.
As might be expected, coding Javascript is not without its troubles, and I found myself having dotcom flashbacks to the days when I would do client-side scripting. In particular, debugging is always been a pain with Javascript, especially when one is not intimate with the DOM and API. Fortunately, the ExtendScript Toolkit provided by Adobe functions both as a IDE and a debugger. Still, I find myself wanting a few nice details, like the possibility of displaying a progress bar when a script is executing.
To give you an idea of the oddities of coding for Illustrator, I am posting a script that allows the user to input a multiplier, which is then used to adjust the opacity of all path items in the active document. This covers for the lack of such a function in Illustrator proper. To be honest I was surprised at the speed with which I was able to accomplish my goal. I would seriously consider this as a way to do brute-force post-processing of vector files.
That said, I doubt it will ever be as fun and quirky as Scriptographer…
Source code - OpacityAdj.js
Read the rest of this entry »
21:15 | October 22nd, 2006 | marius watz | +del.icio.us | +digg | trackback
Adobe has released a public preview of ActionScript 3.0, which will be part of Flash 9. This follows the release of Flash Player 9, which will support AS3 features. At a glance this release seems to reinforce the evolution of Flash and ActionScript into a serious application development. Runtime types, non-dynamic classes and runtime exceptions brings AS3 in line with regular programming languages and hopefully simplifying the process of debugging Flash. In the past, grown programmers have been known to break down and cry at the thought of figuring out what is wrong with a complex Flash app. Perhaps now they will only sigh deeply.
The real reason for these changes is that run-time types and non-dynamic classes give a major performance boost. Flash Player 9 contains a new ActionScript virtual machine, the AVM2. This VM is expected to boost Flash performance up to 10-fold, to a point where the VM can run complex applications at reasonable speeds.
And guess what: Flash now has a revolutionary new primitive type: The “int”. The fact that this was missing in the first place is mind-boggling. My apologies if this sounds snide, but I remember wondering why Macromedia didn’t “professionalize” ActionScript over 4 years ago. Ok, so AS2 had OOP but it felt like a kludge and the willy-nilly handling of pointers made you cringe.
More good news: There are indications (see overview, search for “DisplayList”) that AS3 will ditch the MovieClip class in favor of more logical DisplayList and Shape classes, as well as doing away with the hopelessly outdated layer system for deciding depth of objects.
The recent developments are good, but my suspicion is that they will still fall short of making Flash a real application environment without relying on obscure tricks and guru knowledge. I understand the desire to keep Flash accessible to non-hardcore coders, but surely it would be possible to make the language scaleable without sacrificing consistency.
Don’t get me wrong, Flash is invaluable as a platform for rich media content that can actually be seen by the majority of Internet users. And this new version is inching towards a better Flash world. But if Adobe allows Flash to continue the “fix a kludge with a kludge” tradition that has always plagued Director, they’ll eventually have to scrap the whole platform and build something new from scratch. Let’s hope that doesn’t happen.
Links:
(Via Create Digital Motion)
12:09 | June 29th, 2006 | marius watz | +del.icio.us | +digg | trackback
Some exciting news about VVVV, the “multipurpose toolkit” from the best boys at Meso. They’ve launched a redesigned and much improved VVVV site, combining Wiki and blog functionality into one user-friendly setup. VVVV has never been the most well-documented tool and the previous site suffered slightly from geek tendencies, but this time they got it right. The documentation page should now have something even for those with no visual programming experience, and if not they can just head over to the Fan Club to look for answers.
And for anyone who is unaware of the powers of VVVV, have a look at David Dessen’s new blog, Sanch TV. David has been producing some amazing results using VVVV’s built-in support for vertex shaders. Shaders run directly on the GPU of your graphics card, and so get a major performance boost compared with CPU-based methods. That feature alone should be reason enough to start experimenting with the VVVV toolkit (Windows only.)
Note: I blogged David Dessen’s work in more detail over on Generator.x.
09:44 | June 26th, 2006 | marius watz | +del.icio.us | +digg | trackback
I just posted an entry about NodeBox over on Generator.x. NodeBox is a Python-based coding environment that specializes in producing vector graphics, with very high quality results. Like Processing’s use of Java, NodeBox uses a simplified syntax but has access to the full power of Python for advanced programmers. It also has some interesting libraries, like the Pixie handwriting library or the PhotoBot image processing library.
Unfortunately, NodeBox is only for Mac OS, but the source is available under a MIT license. It looks like a fun alternative to Processing with a slightly different bias on what kind of work it is useful for. Have a look at the Gallery for some examples.
12:19 | June 6th, 2006 | marius watz | +del.icio.us | +digg | trackback
Today is the last day of the workshop. Zach spoke about the role of the question mark in art. Don’t just ask “how”, but also “why”. I spoke about code-related blog resources, and presented VVVV and visual programming as an alternative to text-based programming environments.
VVVV is a tool created by the German media design group Meso, and is an excellent tool for VJ’ing and other visually oriented tasks. Because it is a patching system, it lends itself to spontaneous hacking, and even live coding (see Toplap).
Finally we had demos of what people have been working on over the course of the workshop. Some very nice projects were presented, hopefully we will be able to publish some results of the workshop online.
16:30 | May 12th, 2006 | marius watz | +del.icio.us | +digg | trackback