diff options
author | Joseph Gilbert <ascotan@gmail.com> | 2003-10-12 21:15:51 +0400 |
---|---|---|
committer | Joseph Gilbert <ascotan@gmail.com> | 2003-10-12 21:15:51 +0400 |
commit | e4d86c85c3d4614b3ff251cca4fcc48967b18bde (patch) | |
tree | 1507adb552d11124725c00b6f863a238325adb15 /source/blender/python/api2_2x/doc/NMesh.py | |
parent | c4d9d0dc305f3c207e7d85ebf214cafb3f0b439f (diff) |
Added updates to reflect the vertex grouping changes in NMesh.c
Diffstat (limited to 'source/blender/python/api2_2x/doc/NMesh.py')
-rw-r--r-- | source/blender/python/api2_2x/doc/NMesh.py | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/doc/NMesh.py b/source/blender/python/api2_2x/doc/NMesh.py index a07af9ae615..398f5fe0ab0 100644 --- a/source/blender/python/api2_2x/doc/NMesh.py +++ b/source/blender/python/api2_2x/doc/NMesh.py @@ -377,3 +377,84 @@ class NMesh: - "AutoSmooth" - "SubSurf" """ + + def addVertGroup(groupName): + """ + Add a named and empty vertex (deform) group to a mesh that has been linked + to an object. + @type groupName: string + """ + + def removeVertGroup(groupName): + """ + Remove a named vertex (deform)group from a mesh that has been linked to + an object. Will remove all verts assigned to group, if any. + @type groupName: string + """ + + def assignVertsToGroup(groupName, vertList, weight, assignmode): + """ + Adds an array (a python list) of vertex points to a named vertex group associated + with a mesh. The vertex list is a list of vertex indeces from the mesh. The vertex list + will have an associated wieght assigned to them. This weight represents the amount of + influence this group has over these vertex points. Weights should be in the range of + 0.0 - 1.0. The assignmode can be either 'add', 'subtract', or 'replace'. If the vertex + in the list is not assigned to the group already, 'add' creates a new association with + between this vertex and the group with the weight specified, otherwise the weight given + is added to the current weight of an existing association between the vertex and group. + 'subtract' will attempt to subtract the weight passed from a vertex already associated + with a group, else it does nothing. 'replace' attempts to replace a weight with the + new weight value for an already associated vertex/group, else it does nothing. You should + assign vertex points to groups only when the mesh has all its vertex points add to it. + @type groupName: string + @type vertList: python list (integers) + @type weight: float + @type assignmode: string + @param assignmode: Three choices: + - 'add' + - 'substract' + - 'replace' + + I{B{Example:}} + The example here adds a new set of vertex indeces to a sphere primative:: + import Blender + sphere = Blender.Object.Get('Sphere') + mesh = sphere.getData() + mesh.addVertGroup('firstGroup') + vertList = [] + for x in range(300): + if x % 3 == 0: + vertList.append(x) + mesh.assignVertsToGroup('firstGroup', vertList, 0.5, 'add') + """ + + def removeVertsFromGroup(groupName, (optional)vertList): + """ + Will remove an array (a python list) of vertex points from a named group in a mesh + that has been linked to an object. If no list is given this will remove all vertex + point associations with the group passed. + @type groupName: string + @type vertList: python list (integers) + """ + + def returnVertsFromGroup(groupName, (optional)weightsFlag, (optional)vertList): + """ + The function will return a list of vertex indeces associated with the passed group. + The weightsFlag should be either 0 or 1. The default is 0, however if 1 is passed the + weight is returned along with the index. A vertex list can also be passed as a 3rd + parameter. In this case only those vertex points that are both in the list passed and + in the group passed are returned. The method can be used to test whether a vertex index + is part of a group and if so, what it's weight is. + @type groupName: string + @type weightsFlag: int + @type vertList: python list (integers) + + I{B{Examples:}} + Here is an example:: + ...same as example in assignVertsToGroup... + returnVertList = mesh.returnVertsFromGroup('firstGroup') + or + returnVertList = mesh.returnVertsFromGroup('firstGroup',1) + or + returnVertList = mesh.returnVertsFromGroup('firstGorup',1,[1,2,3,4,5,6]) + """ |