Added Mesh.New() method; can now create new meshes within the module

Changed Object.link() to allow link objects with both BPython-type meshes
Changed Object.getData() to allow retrieving both types of BPython-type meshes

Added new mesh types to Types module
This commit is contained in:
Ken Hughes
2005-10-04 15:17:27 +00:00
parent 772459f15c
commit ac668ea561
10 changed files with 130 additions and 22 deletions

View File

@@ -47,6 +47,15 @@ def Get(name=None):
If no parameter is given, it returns all the meshs in the current scene.
"""
def New(name='Mesh'):
"""
Create a new mesh data object called I{name}.
@type name: string
@param name: The name of the mesh data object.
@rtype: Mesh
@return: a new Blender mesh.
"""
class MCol:
"""
The MCol object

View File

@@ -4,8 +4,9 @@
The Blender.Object submodule
B{New}:
- L{Object.getData} now accepts an optional bool keyword argument to
define if the user wants the data object or just its name.
- L{Object.getData} now accepts two optional bool keyword argument to
define (1) if the user wants the data object or just its name
and (2) if a mesh object should use NMesh or Mesh.
- L{Object.clearScriptLinks} accepts a parameter now.
- Object attributes: renamed Layer to L{Layers<Object.Object.Layers>} and
added the easier L{layers<Object.Object.layers>}. The old form "Layer"
@@ -206,11 +207,19 @@ class Object:
other value, or no value at all will update the scene hierarchy.
"""
def getData(name_only = False):
def getData(name_only=False, mesh=False):
"""
Returns the Datablock object (Mesh, Lamp, Camera, etc.) linked to this Object. If the keyword parameter 'name_only' is True, only the Datablock name is returned as a string.
Returns the Datablock object (Mesh, Lamp, Camera, etc.) linked to this
Object. If the keyword parameter 'name_only' is True, only the Datablock
name is returned as a string. It the object is of type Mesh, then the
'mesh' keyword can also be used; the data return is a Mesh object if
True, otherwise it is an NMesh object (the default).
@type name_only: bool
@param name_only: This is a keyword parameter. if True (or nonzero), only the name of the data object is returned. The default value is False.
@param name_only: This is a keyword parameter. If True (or nonzero),
only the name of the data object is returned.
@type mesh: bool
@param mesh: This is a keyword parameter. If True (or nonzero),
a Mesh data object is returned.
@rtype: specific Object type or string
@return: Depends on the type of Datablock linked to the Object. If name_only is True, it returns a string.
"""

View File

@@ -31,7 +31,13 @@ Example::
@var NMFaceType: Blender NMFace. A mesh face, with one (a point), two (an edge),
three (a triangular face) or four (a quad face) vertices.
@var NMVertType: Blender NMVert. A mesh vertex.
@var NMColType: Blender NMCol. A mesh rgba colour.
@var NMColType: Blender NMCol. A mesh rgba color.
@var MeshType: Blender Mesh. The mesh structure.
@var MFaceType: Blender MFace. A mesh face, with
three (a triangular face) or four (a quad face) vertices.
@var MEdgeType: Blender MEdge. A mesh edge, with two vertices
@var MVertType: Blender MVert. A mesh vertex.
@var MColType: Blender MCol. A mesh rgba color.
@var ArmatureType: Blender Armature. The "skeleton", for animating and deforming
objects.
@var BoneType: Blender Bone. Bones are, obviously, the "pieces" of an Armature.
@@ -42,13 +48,17 @@ objects.
@var ImageType: Blender Image.
@var LampType: Blender Lamp.
@var TextType: Blender Text.
@var Text3dType: Blender Text3d.
@var MaterialType: Blender Material.
@var SceneType: A Blender Scene. Container of all other objects.
@var ButtonType: Blender Button. One of the Draw widgets.
@var vectorType: Blender vector. Used in NMesh.
@var vectorType: Blender vector. Used in NMesh, Mesh and elsewhere.
@var matrix_Type: Blender matrix.
@var quaternionType: Blender quaternion. Used in armatures.
@var eulerType: Blender euler.
@var bufferType: Blender buffer. A contiguous piece of storage, used in BGL.
@var constantType: Blender constant. A constant dictionary.
@var rgbTupleType: Blender rgbTuple. A (red, green, blue) triplet.
@var TextureType: Blender Texture.
@var MTexType: Blender MTex -- it links materials to a texture.
@var MTexType: Blender MTex. Links materials to a texture.
"""