blender 2.27 python API

Hello,

I would like to learn how to write python scripts for blender specifically for the emitting of the internal data about and object’s coords, faces, uv coords, which textures they are attached to, etc. I’m a newbie to python, but learning the language isn’t really my problem, my problem is that I can’t seem to find up to date descriptions of the python API blender 2.27 supports.

I found this site:
http://download.blender.org/documentation/NaN_docs/Manual2.0/PythonScripting.html

but it seems somehow out of date with a small python example code I found in this group which works fine, but uses fields in the face structure not detailed in the API description on that web page. The example script just prints out the UV coords for a face in a cube. I figured out how to load it into blender and run it, but without a decent API description I’m at a loss for how to grovel around in the structures looking for specific things.

Basically, I want to write the Videospace format, but augmented with UV coords for each face plus the texture name(the actual file name) they are associated with. Getting some normal data for the faces would be pretty cool too.

Can anyone point me to the current python API for blender 2.27?

I appreciate the help very much.

Thank you.

-pete

http://www.blender.org/modules/documentation/225PythonDoc/index.html
The 2.25 API is essentially the same in 2.27. If something doesn’t work, try using:

print dir(Blender)

which can also be done for most any Python object, or try

import pydoc
pydoc.help(Blender)

which works for some imported modules. Good luck!

Oh! That’s exactly what I’m looking for. Thank you very much. I’m sure this stuff has been written before, but when I’m done I’ll see if anyone else wants it as well. Basically, I just want a nice object file format I can load into some games I’m making. :slight_smile:

Thanks much.

-pete

Hi,
I am very new to python and I would like to learn about the new blender 2.28 beta api. The implementation of armature support has peaked my interest. I’m interested in possibly porting my maxscript which exports .mdl files for warcraft 3 to blender. I have always been interested in writing a warcraft 3 .mdl exporter for blender so making custom models and animations for warcraft 3 would be more accesible, but I had to wait for armature support because the format uses skeletal animation.

I tried these commands that you suggested to the other fellow and they don’t appear to work for me.

print dir(Blender)
import pydoc
pydoc.help(Blender)

I have my pythonpath environment variable set up pointing to my blender directory but it just keeps telling me at the console that “Blender” is not recognized. I also tried

import Blender

and it tells me the module does not exist. Is there something besides environment variables I have failed to set up correctly?

Hi,

The Python scripting is available only from within Blender. Open the text window in Blender and add a new script. From there you can do a:

import Blender

print dir (Blender)

Hope this helps.

With regards,
Michel

Thank you very much that solved my problem. I assumed that you were supposed to type those commands into the python console. This is great I finally have this all up and running and I can finally try some blender coding :smiley: