# Blender Class Reference

[Blender Index] [Blender Hierarchy]

This is in fact no class it is a module in Python More...

`#include <blender.h>`

## Public Members

- Blender ()
- ~Blender ()
- PyObject* addMesh (const char* type)
- PyObject* connect (PyObject* obj1, PyObject* obj2)
- PyObject* getCamera (const char* name)
- PyObject* getCurrentScene ()
- PyObject* getDisplaySettings ()
- PyObject* getFilename ()
- PyObject* getLamp (const char* name)
- PyObject* getLinkedData ()
- PyObject* getMaterial (const char* name)
- PyObject* getMesh (const char* name)
- PyObject* getObject (const char* name)
- PyObject* isCamera (const char* name)
- PyObject* isLamp (const char* name)
- PyObject* isMesh (const char* name)
- PyObject* loadFile (const char* filename)
- PyObject* setCurrentFrame (int frame)

## Detailed Description

This is in fact no class it is a module in Python. But I use it here as a class to document the global functions availabe in the Blender module.

## PyObject* addMesh(const char* type)

This reflects what happens if you press SPACE in Blender and select ADD->Mesh. The type string is one of the strings shown in Blender's submenu ("Plane", "Cube", etc.).

## PyObject* connect(PyObject* obj1, PyObject* obj2)

This should connect things like it is shown in the OOPS window. At the moment you can only connect objects with meshes and scenes with objects. This is likely to change in the future.

## PyObject* getCamera(const char* name)

Even if you can't see the connected data to an camera object in the OOPS window yet you can get access to the camera settings by calling this function with the name of the camera data.

## PyObject* getCurrentScene()

Gives access to the current scene. For export scripts this should be one of the first things you should do. The names of the objects in the scene are stored and you can step through this names and get access to the associated data by calling getObject(name).

## PyObject* getDisplaySettings()

Because you can't create instances of the class DisplaySettings you have to call this function to create one for you. Then you can retrieve the data from the returned instance.

## PyObject* getFilename()

Gets the filename (including the path) of the current file.

## PyObject* getLamp(const char* name)

Gives access to the lamp data by using the unique name.

## PyObject* getLinkedData()

Get access to data linked to a script in the script buttons. This can be: Object, Camera, Lamp, Material, and World.

## PyObject* getMaterial(const char* name)

Gives access to the material data by using the unique name.

## PyObject* getMesh(const char* name)

Gives access to the mesh data by using the unique name.

## PyObject* getObject(const char* name)

Gives access to the object data by using the unique name.

## PyObject* isCamera(const char* name)

If you want to check if the connected data to this object (with this name) is really a camera use this function.

## PyObject* isLamp(const char* name)

If you want to check if the connected data to this object (with this name) is really a lamp use this function.

## PyObject* isMesh(const char* name)

If you want to check if the connected data to this object (with this name) is really a mesh use this function.

## PyObject* loadFile(const char* filename)

This functions loads a BLEND file. The string should contain the filename and the path.

## PyObject* setCurrentFrame(int frame)

If you want to export an animation you have to step through all the frames. This function allows you to do so and updates all objects which have some IPOs (InterPOlation curves) connected.

- Author: Jan Walter
- Documentation generated by jan@nvidea on Mon Mar 5 16:57:27 CET 2001

K doc