diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-27 14:30:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-27 14:30:10 +0400 |
commit | 7f1e9b8c4116915d1a7073f712f62f234454c323 (patch) | |
tree | 9839437ad783acad3cdcda27b4fd6d93dbeced10 /doc | |
parent | 1e7bcece44a1fc149add915e812cd7f9027832c8 (diff) |
bmesh py api:
added access to deform weights, access to weights acts like a python dict so you can do...
print(group in dvert)
dvert[group] = 0.5
print(dvert[group])
del dvert[group]
print(dvert.items())
Diffstat (limited to 'doc')
-rw-r--r-- | doc/python_api/rst/include__bmesh.rst | 19 | ||||
-rw-r--r-- | doc/python_api/sphinx_doc_gen.py | 3 |
2 files changed, 21 insertions, 1 deletions
diff --git a/doc/python_api/rst/include__bmesh.rst b/doc/python_api/rst/include__bmesh.rst index a8d299a5894..82cc525ecb7 100644 --- a/doc/python_api/rst/include__bmesh.rst +++ b/doc/python_api/rst/include__bmesh.rst @@ -104,6 +104,25 @@ Here are some examples ... print("Vert Shape: %f, %f, %f" % (shape.x, shape.y, shape.z)) +.. code-block:: python + + # in this example the active vertex group index is used, + # this is stored in the object, not the BMesh + group_index = obj.vertex_groups.active_index + + # only ever one deform weight layer + dvert_lay = bm.verts.layers.deform.active + + for vert in bm.verts: + dvert = vert[dvert_lay] + + if group_index in dvert: + print("Weight %f" % dvert[group_index]) + else: + print("Setting Weight") + dvert[group_index] = 0.5 + + Keeping a Correct State ----------------------- diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 60ec027a8c7..cb03907c194 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -342,7 +342,8 @@ MODULE_GROUPING = { "BMLayerCollection", "BMLayerItem", ("Custom-Data Layer Types", '-'), - "BMLoopUV" + "BMLoopUV", + "BMDeformVert" ) } |