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

omino pixel blog

pixels, motion, and scripting
david van brink // Sun 2011.02.6 09:22 // {after effects}

AE: Omino Python

For immediate download: Omino Python Plug-in for After Effects.

This plug-in lets you write a script in Python and then run it on every frame. The script can do drawing, access other layers, and so forth. Because sometimes, you just need to write code to get the job done. Omino Python gives you a straightforward way to provide drawing code directly in your After Effects work flow.

This isn’t for everyone; but if you have a little bit of scripting experience, Omino Python should be very easy for you to pick up.

Mac OS X on AECS5 only, for now…

Here’s a little demo.

Here’s another youtube demo, too.

The download includes plenty of documentation, or you can read it right now.

I’ll be posting some tips and examples — there are so many possibilities opened up! — but to break the ice, here’s a simple Omino Python script to do some drawing.

The script in Python. I didn’t know Python before starting the project, but it’s a nice easy little language, and quite popular, so there’s plenty of resources to learn it. It’s not so different from JavaScript or anything else. No semicolons and no curly braces, though! Here it is:

import math
import random

def ompy_main(c):
    ctx = c.layer_out_context

    w = int(c.width)
    h = int(c.height)

    # draw a red circle...
    ctx.set_source_rgb(1,0,0)
    ctx.arc(w/2,h/2,100,0,2 * math.pi)
    ctx.fill()

    # effect parameter controls size
    size = c.floats[0]
    ctx.set_font_size(size)

    # draw a grid of random numbers, spaced by 30
    random.seed(c.frame) # start the random sequence
    for x in range(0,w,30):
        for y in range(0,h,30):
            # random color
            ctx.set_source_rgb(random.random(),random.random(),random.random())
            # random number
            n = str(random.randint(0,9))
            # draw it.
            ctx.move_to(x,y)
            ctx.show_text(n)

And here’s a screen shot showing the output:

Op scrnshot 6

Your script can access a collection of parameters — some floats, some colors, &c — and use them as needed. In this case, I just used one float parameter to control the size of the random numbers printed.

This is just the beginning! Read the doc for the full story. Try out the plug-in.

More to come!

8 comments
GCoda // Mon 2011.02.14 02:582:58 am

This is great.
How about integrate this with http://code.google.com/p/pybox2d. Is it theoretically posible ?

Tutorialz | Copy. Share. Enjoy. » Omino Python: Python Plug-in for After effects // Mon 2011.02.14 05:495:49 am

[…] Van Brink (@polyomino) released Omino Python, a free After Effects CS5 plug-in for Mac OS X only (for now) that embeds a Python interpreter: […]

Jonas Hummelstrand // Tue 2011.02.15 03:593:59 am

Way cool, David!

Tweets that mention David Van Brink brings Python back to AE. Awesome! Useful Things was a favorite. -- Topsy.com // Tue 2011.02.15 04:314:31 am

[…] This post was mentioned on Twitter by Jonas Hummelstrand and kripats, Dale Bradshaw. Dale Bradshaw said: David Van Brink brings Python back to AE. Awesome! Useful Things was a favorite. http://t.co/Gui2CLA […]

Omino Python: Python Plug-in for After Effects | Wizpress.com // Tue 2011.02.15 09:359:35 am

[…] Van Brink (@polyomino) released Omino Python, a free After Effects CS5 plug-in for Mac OS X only (for now) that embeds a Python interpreter: […]

Mylenium’s Blog » The Snake comes back! // Tue 2011.02.15 11:4511:45 am

[…] How do you know that you are "old" in the After Effects world? When you can remember pretty much every cool plug-in that there once was and whose demise you regret. One of those was Useful Things, a custom framework for building your own effects using Python. I’ve long been a sucker for parametrical/ generative graphics – anything from L-Systems to statistical visualization – and have long wished we could have something like Processing would make its way to After Effects to fill that gap, but it hasn’t happened. Luckily, things are beginning to look a bit better, as we are getting a new Python plug-in thanks to David van Brink. […]

Michael Delaney // Thu 2011.06.2 22:4510:45 pm

Wanting to try out the plugin. Its throwing this though.

“Could’nt find main entry point for omino_python.plugin

48 :: 72”

I’m on OSX 10.6 with AE 10.0.0.458

david van brink // Wed 2011.12.28 19:467:46 pm

A little bit late, I reply: Try the newest version, fresh today. I rejiggered the installer significantly, hopefully addressing exactly this kind of problem. But please ping me here or poly@omino.com, I want to help!

Comments are closed.
/\/\/\/\/\/\/\/\

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