Problems with scripting my own exporter?

Hi, I’m writing my own exporter in blender. At the moment i’m trying to get the animation data from the NLA module.

The code:

nla = Blender.Armature.NLA

actions = nla.GetActions()

The GetActions() function is described in the API as


Get all actions and return them as a Key : Value Dictionary.
Returns: All the actions in blender
(type=Dictionary of PyActions)

I don’t know if i’m just reading this description wrong, but I get a list of strings return from this function and not action objects.

Is this even the way to get the data?


Its definitely a dictionary, just checked NLA.c
if you loop through a dictionary you’ll iterate over keys by default. try this.

for action in Blender.Armature.NLA.GetActions().values(): print

Thank you. Now i understand how that works. Maybe this isn’t the right place, but i’ve got a problem getting the texture that’s attached to a mesh. I can get the material and all textures inserted in the list. But when you attach a texture from the material in the UV/Image window. How do you get that specific texture?

Muffin, I believe you mean the texture that can be attached to faces of a mesh via the UV editor, right? You get those images via the faces sequence of a mesh. Each face can have a differenct image. Here’s an example for a selected mesh object with an image attached to it’s faces:

import Blender

scn = Blender.Scene.GetCurrent()
ob =
me = ob.getData(mesh=True)

for f in me.faces:
	print f, f.image, type(f.image)

Output in the terminal window should be something like this, one line for each face:

[MFace (0 1 2 3) 0] [Image "myimage.png"] <type 'Blender Image'>
[MFace (4 7 6 5) 1] [Image "myimage.png"] <type 'Blender Image'>

Thank’s for all your help.