I just finished writing a short tutorial for the Things API. You can get it on my wiki:
otherwise.relics.co.za or from the CVS on the official website.
The tarball contains a PDF, an SVG file and a bunch of python files. You will still need to fetch the actual API and make a link to it where you want to run the tutorial samples.
It should all make a kind of sense. If it does not, then you need to panic! Run around yelling! Or something.
Have fun with Things.
\d
Tuesday, May 19, 2009
Saturday, May 9, 2009
Things! An easy animation API for Python.
Announcing "Things" - Vector animation in Python
I just got my Savannah project approved and have uploaded the code to CVS. I have never used a cvs before, so I don't really know what I am doing.
You can visit the project here:
http://savannah.nongnu.org/projects/things/
"Things" is a way to make quick visual metaphors and animate them. Things can contain other things -- in this way you can have one Thing moving left-right and then put that into another Thing moving up-down and you'd get an animation doing both.
There's more to it than that; you can tell individual things when to stop and start; what to do and when to do it; how to move and so on.
There is a primitive event-system going; so you can produce buttons and hit areas and so forth.
Inkscape and SVGs
Things was written with Inkscape in mind. You draw your graphics there, give stuff id's and then in your Things Python code, you can refer to those ids and use the SVG directly. The whole idea was to use Inkscape as the "IDE" and Things as the animation engine.
There are ways to create:
1. "Sprites" - Single frame drawings.
2. "Loops" - Drawings that will change over time -- like a walk cycle.
3. "Paths" - Simple paths for things like line drawing or following.
4. "Masks" - Also simple paths, but intended for clipping and hit-detection etc.
Each of these is drawn in a layer within Inkscape (and there are a few simple rules to follow) after which you simply pull them out in Python and use 'em!
Help code! Take it away!
So, come on over and give it a whirl. Perhaps you can improve it and code it into some fast C/assembler. It sure needs more love and skill than I can bring :)
\d
I just got my Savannah project approved and have uploaded the code to CVS. I have never used a cvs before, so I don't really know what I am doing.
You can visit the project here:
http://savannah.nongnu.org/projects/things/
"Things" is a way to make quick visual metaphors and animate them. Things can contain other things -- in this way you can have one Thing moving left-right and then put that into another Thing moving up-down and you'd get an animation doing both.
There's more to it than that; you can tell individual things when to stop and start; what to do and when to do it; how to move and so on.
There is a primitive event-system going; so you can produce buttons and hit areas and so forth.
Inkscape and SVGs
Things was written with Inkscape in mind. You draw your graphics there, give stuff id's and then in your Things Python code, you can refer to those ids and use the SVG directly. The whole idea was to use Inkscape as the "IDE" and Things as the animation engine.
There are ways to create:
1. "Sprites" - Single frame drawings.
2. "Loops" - Drawings that will change over time -- like a walk cycle.
3. "Paths" - Simple paths for things like line drawing or following.
4. "Masks" - Also simple paths, but intended for clipping and hit-detection etc.
Each of these is drawn in a layer within Inkscape (and there are a few simple rules to follow) after which you simply pull them out in Python and use 'em!
Help code! Take it away!
So, come on over and give it a whirl. Perhaps you can improve it and code it into some fast C/assembler. It sure needs more love and skill than I can bring :)
\d
Sunday, February 1, 2009
My new website!
I have put together a Django-powered website of my own -- come visit it at otherwise.relics.co.za -- I have a bunch of comics, tutorials and some writing there.
\d
\d
Friday, July 25, 2008
Email attachment limits
Why is this not a done deed?
How many of you out there know someone who simply wants to send pictures by email but has no clue about how big the darn things are? Attach, attach, clickety-click and then off goes a 10mb email... Man this is crazytown. Why is there no thought given to this for email clients like kmail and evolution?
This is a cry-out to the boffins to please (pretty, pretty please) create some kind of layer between the images attached and the email sent that will:
I have crafted two (horrible) solutions to the second route, one for kmail and another for evolution. I can't get my brain around how to do this from the first route -- the answer for evolution is some kind of plugin, but that's a step too far for me right now.
My solutions for kmail and evolution can be a subject for another blog if anyone is interested...
\d
How many of you out there know someone who simply wants to send pictures by email but has no clue about how big the darn things are? Attach, attach, clickety-click and then off goes a 10mb email... Man this is crazytown. Why is there no thought given to this for email clients like kmail and evolution?
This is a cry-out to the boffins to please (pretty, pretty please) create some kind of layer between the images attached and the email sent that will:
- Compress them in scale and size to a target size (see Phatch if you think this can't be done!)
- Limit the total Kb size of all the attachments so that it tells Aunt Sue, "Please remove a few pictures because this email is too big to send."
I have crafted two (horrible) solutions to the second route, one for kmail and another for evolution. I can't get my brain around how to do this from the first route -- the answer for evolution is some kind of plugin, but that's a step too far for me right now.
My solutions for kmail and evolution can be a subject for another blog if anyone is interested...
\d
Otherwise Poetry
Me again,
I have delayed putting a link to my little book of poems (available on Lulu.com) for many, many months now; feeling a little shy about such marketing, but today I felt a rush of optimism and I just did it.
So, this is a quick post to mention it. I hope someone out there enjoys a few of the poems in my book, but I have never had any feedback so I really don't know if they are any good. The hardcover is priced as low as I could go and the ebook is free.
There are a few new ones towards the end that came from my admiration of Prof. Dawkins' work and what I have learned from him and others (a nod to James Randi) about reality and how deluded we humans really are.
Well, there, it's all said now. Gulp!
Note: I created the entire book (printed version and ebook) using 100% free software on Kubuntu. I used Lyx to do the writing (and produce the PDF and the PS) and Inkscape & Scribus to hack the cover. Thank the FSM for such capable and fantastic software. Oh, I used Fonty Python to manage my fonts too ;) (But the quality of that software is up for debate.)
\d
I have delayed putting a link to my little book of poems (available on Lulu.com) for many, many months now; feeling a little shy about such marketing, but today I felt a rush of optimism and I just did it.
So, this is a quick post to mention it. I hope someone out there enjoys a few of the poems in my book, but I have never had any feedback so I really don't know if they are any good. The hardcover is priced as low as I could go and the ebook is free.
There are a few new ones towards the end that came from my admiration of Prof. Dawkins' work and what I have learned from him and others (a nod to James Randi) about reality and how deluded we humans really are.
Well, there, it's all said now. Gulp!
Note: I created the entire book (printed version and ebook) using 100% free software on Kubuntu. I used Lyx to do the writing (and produce the PDF and the PS) and Inkscape & Scribus to hack the cover. Thank the FSM for such capable and fantastic software. Oh, I used Fonty Python to manage my fonts too ;) (But the quality of that software is up for debate.)
\d
Notes from July
Greetings,
I have one more operation to go (I hope that's all) and I should be all repaired. Man I wish I was as simple as a motherboard and I could get opened-up with a screwdriver and have bits swapped-out.
Otherwise July has been good to me; we have moved into our house and I have a reliable Internet connection (the most important thing :D ) and I am starting to edge towards coding again.
Plans:
Ciao world,
\d
I have one more operation to go (I hope that's all) and I should be all repaired. Man I wish I was as simple as a motherboard and I could get opened-up with a screwdriver and have bits swapped-out.
Otherwise July has been good to me; we have moved into our house and I have a reliable Internet connection (the most important thing :D ) and I am starting to edge towards coding again.
Plans:
- Learn Django!
- Finish my Python & Cairo animation app. This is very cool, but I need time to polish it.
- Get a web-server of my own (perhaps Linode) and muck about with some web apps.
- Polish Fonty Python some more (Nautilus & Konqueror integration for one).
Ciao world,
\d
Adding folders of fonts to a Pog
Hello world,
I was asked in an email the other day if I could add a function to gather all the fonts in a given folder into a Pog. While this is a cool idea for a future release, it's possible right now from the command-line. Lemme show you how.
Open a console/terminal (like konsole or gnome-terminal). I will use square brackets [ ] to surround the command you can type but don't type the brackets. I will use ~/somefonts as the example folder you want to use.
The idea is to build a pog, which is a plain text file containing full paths to each font file. Okay, let's start:
[fontypython newpog]
You can also install those fonts with:
[fontypython -i newpogs]
Have a look at [fontypython --help]
Simple, I hope ;)
\d
I was asked in an email the other day if I could add a function to gather all the fonts in a given folder into a Pog. While this is a cool idea for a future release, it's possible right now from the command-line. Lemme show you how.
Open a console/terminal (like konsole or gnome-terminal). I will use square brackets [ ] to surround the command you can type but don't type the brackets. I will use ~/somefonts as the example folder you want to use.
The idea is to build a pog, which is a plain text file containing full paths to each font file. Okay, let's start:
- Use [cd ~/.fontypython] to go where the pogs live.
- [echo "not installed" > newpog.pog] You can use any name you want. Just make *sure* you don't overwrite some other pog!
- [find ~/somefonts -iname "*.ttf" >> newpog.pog] That will go and find the ttfs (you can change that to say "*.otf" but Type1 fonts might be more tricky) and then it will append them to the 'newpog.pog' file you just started.
- If you want to add other fonts from other folders, just use the same find command, but change the path. Make sure you use 2 ">" symbols (>>) because that means append-to.
[fontypython newpog]
You can also install those fonts with:
[fontypython -i newpogs]
Have a look at [fontypython --help]
Simple, I hope ;)
\d
Subscribe to:
Posts (Atom)