Package bpy :: Module types :: Class Main
[hide private]
[frames] | no frames]

Class Main

The Main Object

Main data structure representing a .blend file and all its datablocks.

References

Instance Methods [hide private]
Object
add_object(type, name)
Add a new object.
 
remove_object(object)
Remove an object if it has zero users.
Mesh
add_mesh(name)
Add a new mesh.
 
remove_mesh(mesh)
Remove a mesh if it has zero users.
Armature
add_armature(name)
Add a new armature.
 
remove_armature(armature)
Remove an armature if it has zero users.
Lamp
add_lamp(name)
Add a new lamp.
Material
add_material(name)
Add a new material.
Texture
add_texture(name)
Add a new texture.
Image
add_image(filename)
Add a new image.
Instance Variables [hide private]
Collection of Action (readonly) actions
Action datablocks.
Collection of Armature (readonly) armatures
Armature datablocks.
Collection of Brush (readonly) brushes
Brush datablocks.
Collection of Camera (readonly) cameras
Camera datablocks.
Collection of Curve (readonly) curves
Curve datablocks.
string (readonly) filename
Path to the .blend file.
Collection of GreasePencil (readonly) gpencil
Grease Pencil datablocks.
Collection of Group (readonly) groups
Group datablocks.
Collection of Image (readonly) images
Image datablocks.
Collection of Lamp (readonly) lamps
Lamp datablocks.
Collection of Lattice (readonly) lattices
Lattice datablocks.
Collection of Library (readonly) libraries
Library datablocks.
Collection of Material (readonly) materials
Material datablocks.
Collection of Mesh (readonly) meshes
Mesh datablocks.
Collection of MetaBall (readonly) metaballs
Metaball datablocks.
Collection of NodeTree (readonly) nodegroups
Node group datablocks.
Collection of Object (readonly) objects
Object datablocks.
Collection of ParticleSettings (readonly) particles
Particle datablocks.
Collection of Scene (readonly) scenes
Scene datablocks.
Collection of Screen (readonly) screens
Screen datablocks.
Collection of ID (readonly) scripts
Script datablocks (DEPRECATED).
Collection of Sound (readonly) sounds
Sound datablocks.
Collection of Text (readonly) texts
Text datablocks.
Collection of Texture (readonly) textures
Texture datablocks.
Collection of VectorFont (readonly) vfonts
Vector font datablocks.
Collection of WindowManager (readonly) windowmanagers
Window manager datablocks.
Collection of World (readonly) worlds
World datablocks.
Method Details [hide private]

add_object(type, name)

 

Add a new object.

Parameters:
  • type (enum)
  • name (string)
Returns: Object
New object.

remove_object(object)

 

Remove an object if it has zero users.

Parameters:

add_mesh(name)

 

Add a new mesh.

Parameters:
  • name (string)
Returns: Mesh
New mesh.

remove_mesh(mesh)

 

Remove a mesh if it has zero users.

Parameters:

add_armature(name)

 

Add a new armature.

Parameters:
  • name (string)
Returns: Armature
New armature.

remove_armature(armature)

 

Remove an armature if it has zero users.

Parameters:

add_lamp(name)

 

Add a new lamp.

Parameters:
  • name (string)
Returns: Lamp
New lamp.

add_material(name)

 

Add a new material.

Parameters:
  • name (string)
Returns: Material
New material.

add_texture(name)

 

Add a new texture.

Parameters:
  • name (string)
Returns: Texture
New texture.

add_image(filename)

 

Add a new image.

Parameters:
  • filename (string)
Returns: Image
New image.

Instance Variable Details [hide private]

filename

Path to the .blend file. (maximum length of 240)
Type:
string (readonly)