Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillian Padovani Germano <wpgermano@gmail.com>2005-02-09 08:19:24 +0300
committerWillian Padovani Germano <wpgermano@gmail.com>2005-02-09 08:19:24 +0300
commit05bf482f6a50bd711fc6bb7ad986919741d478ae (patch)
tree92954a8c8840ff02afec41a7b728f549dc5de6a6 /source/blender/python/api2_2x/doc/NMesh.py
parent955d5aa6eb1a2d3763fd6e3d98e10357cf58fd03 (diff)
BPython:
- NMesh: made nmesh.update accept an optional 'vertex_shade' param to init vcols with shading info, like when you enter vpaint mode or press the relevant "make" button for a mesh without vcols. This is still a test, the functionality was requested by Manuel Bastioni for the SSS script they are working on: http://www.dedalo-3d.com/index.php?filename=SXCOL/makehuman/articles/subsurface_scattering_in_python.html - sys: made makename() accept files with max FILE_MAXDIR+FILE_MAXFILE name length, should fix #2192. Was only FILE_MAXFILE, a mistake; - Image: added .setFilename(), contributed by Campbell Barton; - Camera: added camera.get/setScale for the new param added by Ton for ortho cameras. Requested by Jean-Michel Soler for the Texture Baker script; - related doc updates.
Diffstat (limited to 'source/blender/python/api2_2x/doc/NMesh.py')
-rw-r--r--source/blender/python/api2_2x/doc/NMesh.py36
1 files changed, 27 insertions, 9 deletions
diff --git a/source/blender/python/api2_2x/doc/NMesh.py b/source/blender/python/api2_2x/doc/NMesh.py
index fbfa745229c..4683efe1e67 100644
--- a/source/blender/python/api2_2x/doc/NMesh.py
+++ b/source/blender/python/api2_2x/doc/NMesh.py
@@ -3,7 +3,8 @@
"""
The Blender.NMesh submodule.
-B{New}: L{NMesh.getMaterials}, L{NMesh.setMaterials}.
+B{New}: edges class (L{NMEdge}) and nmesh methods (L{NMesh.addEdge},
+L{NMesh.addEdgesData}, etc.); new optional arguments to L{NMesh.update}.
Mesh Data
=========
@@ -13,8 +14,11 @@ This module provides access to B{Mesh Data} objects in Blender.
Example::
import Blender
- from Blender import NMesh, Material
- #
+ from Blender import NMesh, Material, Window
+
+ editmode = Window.EditMode() # are we in edit mode? If so ...
+ if editmode: Window.EditMode(0) # leave edit mode before getting the mesh
+
me = NMesh.GetRaw("Plane") # get the mesh data called "Plane"
if not me.materials: # if there are no materials ...
@@ -30,6 +34,8 @@ Example::
v.co[2] *= 2.5
me.update() # update the real mesh in Blender
+ if editmode: Window.EditMode(1) # optional, just being nice
+
@type Modes: readonly dictionary
@type FaceFlags: readonly dictionary
@type FaceModes: readonly dictionary
@@ -532,16 +538,28 @@ class NMesh:
add them.
"""
- def update(recalc_normals = 0, store_edges = 0):
+ def update(recalc_normals = 0, store_edges = 0, vertex_shade = 0):
"""
Update the mesh in Blender. The changes made are put back to the mesh in
Blender, if available, or put in a newly created mesh object if this NMesh
wasn't already linked to one.
- @type recalc_normals: int
- @param recalc_normals: If given and equal to 1, the vertex normals are
- recalculated.
- @type store_edges: int
- @param store_edges: if not 0, then edge data are stored.
+ @type recalc_normals: int (bool)
+ @param recalc_normals: if nonzero the vertex normals are recalculated.
+ @type store_edges: int (bool)
+ @param store_edges: if nonzero, then edge data is stored.
+ @type vertex_shade: int (bool)
+ @param vertex_shade: if nonzero vertices are colored based on the
+ current lighting setup. To use it, be out of edit mode or else
+ an error will be returned.
+ @warn: edit mesh and normal mesh are two different structures in Blender,
+ synchronized upon leaving or entering edit mode. Always remember to
+ leave edit mode (L{Window.EditMode}) before calling this update
+ method, or your changes will be lost. Even better: for the same reason
+ programmers should leave EditMode B{before} getting a mesh, or changes
+ made to the editmesh in Blender may not be visible to your script
+ (check the example at the top of NMesh module doc).
+ @note: this method also redraws the 3d view and -- if 'vertex_shade' is
+ nonzero -- the edit buttons window.
@note: if your mesh disappears after it's updated, try
L{Object.Object.makeDisplayList}. 'Subsurf' meshes (see L{getMode},
L{setMode}) need their display lists updated, too.