picture home | art | events | music | rack extensions | downloads | pixel blog

omino pixel blog

pixels, motion, and scripting
entries for category "after effects"
david van brink // Wed 2008.09.24 18:26 // {after effects}

After Effects CS4: Pixel Bender!

Ah! Ah! Yes. Ok. Here’s the rather understated but incredibly-significant feature added in CS4: Pixel Bender effects.

Keven Goldsmith of Adobe explains.

Pixel Bender is Adobe’s way of packaging up (essentially) OpenGL Shader Language, for use as effects plugins to their imaging products.

The outcome will be a lot of extremely cool effects plugins. Some of these will be old effects that run much faster, meaning we can use them more freely. Some of these will new effects that would have been prohibitively slow, but are now merely non-realtime.

This is getting good.

oh, i dont know. what do you think?


david van brink // Tue 2008.09.23 21:22 // {after effects}

After Effects CS4: Yawn?

Ok. Here’s my obligatory chime-in on CS4.

It’s too soon to tell. And I know I’ll upgrade anyway. But So far it looks pretty unspectacular!

When I first started After Effectsing (to verb a product) it was just after expressions were introduced, and just before scripting (scripting!) was added. Those were the days!

And then CS3, that was all right. Puppet tool is pretty cool. I haven’t much cottoned to shapes. The graph editor… there’s things about the old one I liked better.

And floating-point color was in there somewhere along the way too.

Great stuff!

Anyway, about CS4. Let’s see…

Adobe info here and here.

Let’s get bullety.

  • User interface change, window renamed from The Smoother to Smoother. Smoother than what? It had to be said.
  • Compositions for mobile devices. Ok.
  • Animate X, Y, and Z positions independently. Could already do this just fine with slider controls and expressions thanks.

Ok, here’s two I like:

  • Handle 3d photoshop files. This is a good direction! I certainly look forward to ever more 3d features!
  • XML file format. Ok. God I’m geeky, but this is really important! You can save to .aep or .aepx. The XML flavor can, of course, be edited (or maybe created from scratch). But the doc cautions against using .aepx as your primary file format. Also, not everything is rendered as text; much is hex-coded binary. So, overall, probably better to stick with scripting to modify your projects, for now.

I suspect that there’s been ongoing under-the-hood work being done, which will eventually manifest as the real new features.

But for this release, it seems, well, pretty LITE.

Still, can’t wait to try it out!

oh, i dont know. what do you think?


david van brink // Sun 2008.09.21 19:35 // {after effects extendscript photoshop}

Omino Dialog Maker for ExtendScript

ExtendScript

My favorite Adobe applications are all scriptable. They use a scripting language called ExtendScript. I think it’s pure and compliant JavaScript (aka EcmaScript)… if it has any deviations, it’s in some subtle fashion that hasn’t affected me.

One thing you frequently need in a script is a means to gather input choices, so the script can be flexible. I rolled something up that handles this for many simple situations. I call it the Omino Dialog Maker. It’s a software library that lets you bring up an input dialog with just a couple of lines of code. It is mostly about 2 years old now, works pretty well.

Omino Dialog Maker

Here’s a simple example of a dialog made with the Omino Dialog Maker.

And here’s the code to produce it:

#include "ominoDialogMaker.jsx"

var omd = newOminoDialog("Example Omino Dialog");

omd.number("a number","n",88.21);
omd.string("a string","s","your name here");
var result = omd.run();

if(result == null)
	alert("Cancelled\nYou clicked \"cancel\".");
else
	alert("n is " + result.n + ", and s is \"" + result.s + "\"");

That’s pretty handy, isn’t it? As you can see, omd.run() populates a result variable with the contents of the dialog.

I admit it: tt’s not the best possible dialog and layout. It’s a little clunky looking. But it gets the job done, lets me type in a few numbers and set meat of the script to work.

More UI Elements

Here’s a dialog which shows the various UI elements supported by Omino Dialogs:

And, here’s the code which produced it:

#include "ominoDialogMaker.jsx"
function go()
{
	// setting up a dialog is easy. you can add entries for basic types of
	// string and number, and checkbox and radio buttons, and the
	// dialog is presented reasonably, with very little work.

	var omd = newOminoDialog("Example Omino Dialog");

	omd.boxedText(5,"This is an example of an Omino Dialog. It runs \n"
		+ "with After Effects, Illustrator, and Photoshop, or just in the\n"
		+ "ExtendScript toolkit itself. It can handle simple parameter types."
		+ " (Running in " + app.name + " v" + app.version + ")"
	);
	omd.number("a number","n",15.7);
	omd.string("a string","s","a text value");
	omd.separator();
	omd.sectionLabel("basics");
	omd.checkbox("a checkbox","x",true,"subtitle");
	omd.menu("a menu","menu","cherries",["apples","bananas","cherries","dates","figs"]);
	omd.radioButtons("Choose One","r","red",["red","maroon","scarlet","crimson"]);
	omd.separator();
	omd.sectionLabel("files");
	omd.openFile("a file","jpgFileName","foo.jpg","Choose a JPEG File",".jpg");
	omd.selectFolder("a folder","folderName","/tmp","Choose a folder");
	omd.saveFile("save as","gifFileName","foo.gif","Save as GIF",".gif");s

	// when we "run" the dialog, we get back a result variable.
	// if you hit CANCEL, then the result is null.
	// if you hit OK, then the values are populated into the result.

	// note: you can kill photoshop by running the dialog from ExtendScript toolkit, then halting
	// the script with the dialog still up.

	var result = omd.run();

	if(result == null)
		alert("Cancelled\nYou clicked \"cancel\".");
	else
	{
		var s = "result from dialog:\n";
		for(var f in result)
			s += "   " + f + " := " + result[f] + "\n";
		alert(s);
	}
}
go();

If you’ve read this far, you’re hopefully asking, “Gee, where can I get the actual library?” Here’s the code, shown directly out of my source code repository. Download with the download button.


 

Trivia: UI Differences Across Adobe Applications

Omino Dialog Maker can be used for scripts in After Effects, Photoshop, and Illustrator, at least, and possibly other Adobe applications. I have noticed that the dialogs look slightly different in each of these apps! Not critically… For reference, here are screen shots from several.

12 comments
Austin Wallender // Mon 2008.09.22 09:549:54 am

This looks amazing. Can’t wait to try it out! Thanks for the hard work….

Justin Putney // Sun 2008.11.23 16:214:21 pm

Thanks a ton for posting, David! This is extremely useful. I used the Omino Dialog Maker code in my Merge Text for Illustrator extension:
http://ajarproductions.com/blog/2008/11/23/merge-text-extension-for-illustrator/

david van brink // Sun 2008.11.23 22:4710:47 pm

Yay! Glad you found it useful.

James Talmage // Sat 2008.11.29 08:298:29 am

David,
Thank you for sharing this much-needed script. I’ve just successfully modified one of my scripts which formerly relied upon three separate prompt() statements to obtain the user inputs needed for the script.

I have noticed one caveat, though, which I hope you can explain. In both my script modified to use Omino Dialog, and in your first sample script (the one which invokes a dialog with two inputs), if the user clicks Cancel, the alert appears as expected, but then Illustrator’s window minimizes, effectively “taking” the user to whatever OS or app window was previously active.

Any ideas on that?

Again, thanks much for Omino Dialog.

Illustrator CS3
Windows Vista Basic

david van brink // Sat 2008.11.29 16:294:29 pm

Hi James — thanks for your note. I’ve only used it extensively on Mac OS X; I use After Effects on Windows a little but haven’t seen that symptom. Will investigate further…

Thanks for the bug report! Any further info very welcome.

Joel // Tue 2008.12.30 16:104:10 pm

Thanks so much for the scripts! HOWEVER, I’m wondering if you or anyone can advise as to what is causing my “Window does not have a constructor” error that prevents this from working? Illustrator refuses to instantiate a window for me (jerk!).
I’m using AI CS2 on a Mac running Tiger and I am clueless as to the source of my misery. Thanks!!!

david van brink // Tue 2008.12.30 21:569:56 pm

Joel… I’ve only used CS3 and CS4. It’s… probably a clue. 🙁

Dave Stewart // Fri 2009.04.10 07:297:29 am

Just checking your work out now. Great stuff!

I’m wondering why you don’t use proper JavaScript for creating your objects though? Why not just make newOminoDialog a OminoDialog object, and instantiate with the “new” keyword?

Do you need some help writing JavaScript prototypes?

Let me know if you do – it will tidy up the global space a LOT.

Cheers,
Dave

david van brink // Sat 2009.04.11 17:005:00 pm

^^^ Dave, thanks!

If I understand rightly, the “real object-ness” is orthogonal to the global namespace pollution. That is, I could (and should) allow “new OminoDialog()” to work, and depending where the functions live will be in or out of the global name space.

But the real answer to your question is: When I first wrote this, I didn’t know about either of those issues. Version 2!

Dave Stewart // Sun 2009.04.12 07:367:36 am

Hey David,

Ah, yes, I understand! JavaScript is a bit of a dark horse – there’s a lot of power hidden away in there!

Well, as it happens I got all curious ysterday and decided to whip something OOP up yesterday, and I’m nearly done. I may put it on hold for a week or two as I have other projects pressing, but I’ll happily send it your way so you can see what it’s all about when I’ve finished.

Some nice ideas in your work, especially saving the values in once central place.

Cheers for now,
Dave

heavyboots // Mon 2009.05.4 16:014:01 pm

Wow, this is just the ticket. Barely stumbling around in JS (I usually use Applescript) so this looks like it will ease the pain a lot. Thanks!

PS: FWIW, I immediately hacked the buttons over to the right side as they just looked too weird on the left.

okRect.left = D_DIALOG_WIDTH – D_MARGIN – D_BUTTONWIDTH;
okRect.top = y;
okRect.right = okRect.left + D_BUTTONWIDTH;
okRect.bottom = okRect.top + D_CONTROLHEIGHT;

cancelRect.left = okRect.left – D_MARGIN – D_MARGIN – D_BUTTONWIDTH;
cancelRect.top = y;
cancelRect.right = cancelRect.left + D_BUTTONWIDTH;
cancelRect.bottom = cancelRect.top + D_CONTROLHEIGHT;

david van brink // Mon 2009.05.4 18:416:41 pm

!! you’re so right about the button placement! Always interested to see what you’re making with it.

oh, i dont know. what do you think?


david van brink // Sun 2008.09.14 22:07 // {after effects}

tv static

Sometimes you just have to take joy from trivia. Here’s a little tv-static animated GIF I made, for use with a WordPress plugin.

Feel free to steal and use this gif.

It’s only 6 frames, 128×128, 18k.
It is tileable, and looks pretty good, large!

Here’s the after effects project for it.

It’s just Noise, Fast Blur, Curves, and Offset. The Offset filter is used to reduce the visibility of the seams, by mixing two layers.

I guess that’s all.

2 comments
rich // Tue 2008.09.23 23:4311:43 pm

Do you have a version where you can’t see the seams?

Rich

david van brink // Wed 2008.09.24 08:128:12 am

Hi Rich —
Well… yes… on this version *I* can’t see the seams. Well hmm. Now that I’m all looking harder for it, I kind-of can.

Grab the project file and give it a go!

–> david

oh, i dont know. what do you think?



Deprecated: Function the_block_template_skip_link is deprecated since version 6.4.0! Use wp_enqueue_block_template_skip_link() instead. in /home/polyomino/omino.com/pixelblog/wp-includes/functions.php on line 6114

0.0306s
(c) 2003-2023 omino.com / contact poly@omino.com