Blender 2.5 Python API : my little problems...

Hi, I finally made the jump into the deep end and I started to use 2.5 alpha.

I struggle.

I’ve started to play with the Python API (for PyDrivers that don’t work when imported from an 2.49 file, because of the older python2.6 2.49 API).
1st problem: how on earth do you select an object?

I used to use something like:

#Object.Get("My Object")

What is the way now ?

That page was of no help: I don’t know where to search: everything is so different ! I mean Python 3, Blender 2.50…

Would you say scripting has been made easier, more efficient with the new API ?

Yes, it is different, but yes, it is better. It is better because there are built in features that allow you to help yourself.

I got a lot out of this video by foxdog.

your best friend is this statement:

print(dir(anyVariableGoesHere))

Open up 2.5 and select the scripting layout.
Type this into the console.

print(dir(bpy))

The blue text that prints out are all the things you can add with a dot syntax to bpy, which is the root of all access to everything in 2.5.

So try…

print(dir(bpy.context))

You get another list of blue text.

Now try…

print(dir(bpy.context.object))

Also visit.
http://blenderartists.org/forum/showthread.php?t=164765

http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro

Ohhh… thanks Broken, that’ll be a good read!

hi, you can join irc #blenderpython also.
most nights there’s plenty of people to help.