Module Types

Source Code for Module Types

 1  # The Blender.Types submodule 
 2   
 3  """ 
 4  The Blender.Types submodule 
 5  =========================== 
 6   
 7  This module is a dictionary of Blender Python types, for type checking. 
 8   
 9  Example:: 
10    import Blender 
11    from Blender import Types, Object, NMesh, Camera, Lamp 
12    # 
13    objs = Object.Get() # a list of all objects in the current scene 
14    for o in objs: 
15      print 
16      print o, type(o) 
17      data = o.getData() 
18      print type(data) 
19      if type(data) == Types.NMeshType: 
20        if len(data.verts): 
21          print "its vertices are obviously of type:", type(data.verts[0]) 
22        print "and its faces:", Types.NMFaceType 
23      elif type(data) == Types.CameraType: 
24        print "It's a Camera." 
25      elif type(data) == Types.LampType: 
26        print "Let there be light!" 
27   
28  @var ObjectType: Blender Object. The base object, linked to its specific data 
29       at its .data member variable. 
30  @var GroupType: Blender Group. A Group that references a list of objects that are a part of this group. 
31  @var NMeshType: Blender NMesh. The mesh structure. 
32  @var NMFaceType: Blender NMFace. A mesh face, with one (a point), two (an edge), 
33       three (a triangular face) or four (a quad face) vertices. 
34  @var NMVertType: Blender NMVert. A mesh vertex. 
35  @var NMColType: Blender NMCol. A mesh rgba color. 
36  @var MeshType: Blender Mesh. The mesh structure. 
37  @var MFaceType: Blender MFace. A mesh face, with  
38       three (a triangular face) or four (a quad face) vertices. 
39  @var MEdgeType: Blender MEdge. A mesh edge, with two vertices 
40  @var MVertType: Blender MVert. A mesh vertex which wraps a Blender mesh vertex 
41       (typically an object returned from the mesh.verts sequence). 
42  @var PVertType: Blender MVert. A mesh vertex which does not wrap a Blender 
43       mesh vertex (returned from L{Blender.Mesh.MVert()<Mesh.MVert.__init__>}). 
44  @var MColType: Blender MCol. A mesh rgba color. 
45  @var ArmatureType: Blender Armature. The "skeleton", for animating and deforming 
46  objects. 
47  @var BoneType: Blender Bone. Bones are, obviously, the "pieces" of an Armature. 
48  @var CurveType: Blender Curve. 
49  @var IpoType: Blender Ipo. 
50  @var MetaballType: Blender Metaball. 
51  @var CameraType: Blender Camera. 
52  @var ImageType: Blender Image. 
53  @var LampType: Blender Lamp. 
54  @var TextType: Blender Text. 
55  @var Text3dType: Blender Text3d. 
56  @var MaterialType: Blender Material. 
57  @var SceneType: A Blender Scene. Container of all other objects. 
58  @var ButtonType: Blender Button. One of the Draw widgets. 
59  @var vectorType: Blender vector. Used in NMesh, Mesh and elsewhere. 
60  @var matrix_Type: Blender matrix. 
61  @var quaternionType: Blender quaternion.  Used in armatures. 
62  @var eulerType: Blender euler. 
63  @var bufferType: Blender buffer. A contiguous piece of storage, used in BGL. 
64  @var constantType: Blender constant. A constant dictionary. 
65  @var rgbTupleType: Blender rgbTuple. A (red, green, blue) triplet. 
66  @var TextureType: Blender Texture. 
67  @var MTexType: Blender MTex.  Links materials to a texture. 
68  @var IDGroupType: Blender IDProperty Group type. 
69  @var IDArrayType: Blender IDProperty Array type. 
70  """ 
71