[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57079] trunk/blender/doc/python_api/rst/ info_gotcha.rst: rename references to faces in docs.
Campbell Barton
ideasman42 at gmail.com
Tue May 28 15:58:56 CEST 2013
Revision: 57079
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57079
Author: campbellbarton
Date: 2013-05-28 13:58:56 +0000 (Tue, 28 May 2013)
Log Message:
-----------
rename references to faces in docs.
Modified Paths:
--------------
trunk/blender/doc/python_api/rst/info_gotcha.rst
Modified: trunk/blender/doc/python_api/rst/info_gotcha.rst
===================================================================
--- trunk/blender/doc/python_api/rst/info_gotcha.rst 2013-05-28 13:37:47 UTC (rev 57078)
+++ trunk/blender/doc/python_api/rst/info_gotcha.rst 2013-05-28 13:58:56 UTC (rev 57079)
@@ -585,19 +585,19 @@
Edit Mode / Memory Access
-------------------------
-Switching edit-mode ``bpy.ops.object.mode_set(mode='EDIT')`` / ``bpy.ops.object.mode_set(mode='OBJECT')`` will re-allocate objects data, any references to a meshes vertices/faces/uvs, armatures bones, curves points etc cannot be accessed after switching edit-mode.
+Switching edit-mode ``bpy.ops.object.mode_set(mode='EDIT')`` / ``bpy.ops.object.mode_set(mode='OBJECT')`` will re-allocate objects data, any references to a meshes vertices/polygons/uvs, armatures bones, curves points etc cannot be accessed after switching edit-mode.
Only the reference to the data its self can be re-accessed, the following example will crash.
.. code-block:: python
mesh = bpy.context.active_object.data
- faces = mesh.faces
+ polygons = mesh.polygons
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.object.mode_set(mode='OBJECT')
# this will crash
- print(faces)
+ print(polygons)
So after switching edit-mode you need to re-access any object data variables, the following example shows how to avoid the crash above.
@@ -605,13 +605,13 @@
.. code-block:: python
mesh = bpy.context.active_object.data
- faces = mesh.faces
+ polygons = mesh.polygons
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.object.mode_set(mode='OBJECT')
- # faces have been re-allocated
- faces = mesh.faces
- print(faces)
+ # polygons have been re-allocated
+ polygons = mesh.polygons
+ print(polygons)
These kinds of problems can happen for any functions which re-allocate the object data but are most common when switching edit-mode.
@@ -620,7 +620,7 @@
Array Re-Allocation
-------------------
-When adding new points to a curve or vertices's/edges/faces to a mesh, internally the array which stores this data is re-allocated.
+When adding new points to a curve or vertices's/edges/polygons to a mesh, internally the array which stores this data is re-allocated.
.. code-block:: python
More information about the Bf-blender-cvs
mailing list