I've been running into what seems like a basic problem - I need to take an input list of images, modify them, and output the result as a new list. Everything I've seen so far uses a rather hackish chunk of JavaScript to perform that function when reading images from a directory, but I can't seem to make it work without the image downloader. I then tied "outputCurrentImage" to "inputPreviousImage" through a "Image Transform" patch.
Unfortunately, It doesn't seem to work, and I don't understand why.

To understand why it doesn't work: The image transform will only operate on one image per frame (unless inside an iterator, then it'll operate on as many images as there are iterations). You don't have any iterators, so we'll ignore that case for now.

You're expecting the JavaScript patch to pass each image through the transform, and then rebuild the list, outputting a nice modified structure. But it works a bit differently:

The javascript patch will execute exactly once per frame, and only when inputs change -- if you add an outputIndex to your JS patch, (and set it to _index), you'll see that it's not doing anything -- that's the beginning of the problem. You can add a __number doStuff input, and attach an LFO, and that'll force it to execute each frame, but it still won't do what you're wanting -- this is because the Image transform patch is set to scale the X dimension by 0 -- that means the image is gone. You'll want to change that to 1.

Here's a cooked version that gives output: 

Attachment: Doesn't Work.qtz
Description: application/quartzcomposer



Currently, this will do basically what you're wanting -- however, it actually takes 1 frame per image, so if you're working on large groups of images, there will be a noticeable delay between starting the composition and having all the processed images available.

Note that this will endlessly rebuild the structure, which probably isn't what you want (add a check if index is at the end, and if so, do nothing), and since you're moving images through the javascript patch, it might start leaking memory like a sieve (or maybe that bug's been fixed recently ... no idea).

--
[ christopher wright ]
[email protected]
http://kineme.net/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to