Anti - NMesh commit.

unweld - warn that this tool destroys MultiUV/Col's (because of NMesh)
API_intro and NMesh - note that NMesh is maintained but deprecated.
This commit is contained in:
Campbell Barton 2007-04-09 07:03:26 +00:00
parent 55d0bf6b33
commit bd142ac2f4
4 changed files with 27 additions and 12 deletions

@ -12,7 +12,6 @@ def Error_NoMeshUvActive():
def Error_NoMeshMultiresEdit():
Draw.PupMenu('Error%t|Unable to complete action with multires enabled')
# File I/O messages
def Error_NoFile(path):
'''True if file missing, False if files there
@ -36,6 +35,18 @@ def Error_NoDir(path):
return True
return False
def Warning_MeshDistroyLayers(mesh):
'''Returns true if we can continue to edit the mesh, warn when using NMesh'''
if len(mesh.getUVLayerNames()) >1 and len(mesh.getColorLayerNames()) >1:
return True
ret = Draw.PupMenu('Warning%t|This script will distroy inactive UV and Color layers, OK?')
if ret == -1:
return False
return True
def Warning_SaveOver(path):
'''Returns - True to save, False dont save'''
if sys.exists(sys.expandpath(path)):
@ -44,3 +55,5 @@ def Warning_SaveOver(path):
return False
return True

@ -215,9 +215,11 @@ def collecte_edge(listf2v,me,thegood):
OBJECT=Blender.Scene.GetCurrent().getActiveObject()
if OBJECT and OBJECT.getType()=='Mesh':
if OBJECT and OBJECT.type=='Mesh':
if OBJECT.getData(mesh=1).multires:
BPyMessages.Error_NoMeshMultiresEdit()
elif not BPyMessages.Warning_MeshDistroyLayers(OBJECT.getData(mesh=1)):
pass
else:
EDITMODE=Blender.Window.EditMode()
Blender.Window.EditMode(0)

@ -12,7 +12,7 @@ The Blender Python API Reference
-----------
- L{Blender}
- L{bpy<Bpy>}
- L{bpy<Bpy>} (experemantal)
Submodules:
-----------
@ -39,7 +39,7 @@ The Blender Python API Reference
- L{Mesh} (*)
- L{MeshPrimitives} (*)
- L{Metaball} (*)
- L{NMesh} (*)
- L{NMesh} (deprecated)
- L{Noise}
- L{Object} (*)
- L{Modifier} (*)
@ -235,8 +235,6 @@ A note to newbie script writers:
@see: U{www.python.org<http://www.python.org>}
@see: U{www.python.org/doc<http://www.python.org/doc>}
@see: U{Blending into Python<en.wikibooks.org/wiki/Blender_3D:_Blending_Into_Python>}: User contributed documentation, featuring a blender/python cookbook with many examples.
@note: this documentation was generated by epydoc, which can output html and
pdf. For pdf it requires a working LaTeX environment.
@note: the official version of this reference guide is only updated for each
new Blender release. But you can build the current CVS

@ -3,12 +3,14 @@
"""
The Blender.NMesh submodule.
B{New}:
- edges class (L{NMEdge}) and nmesh methods (L{NMesh.NMesh.addEdge}, etc.);
- new optional arguments to L{NMesh.NMesh.update};
- L{NMesh.NMesh.transform};
- L{GetNames};
- L{GetRawFromObject} supports Surface/Curve/Text/Meta objects
B{Deprecated}:
This module is now maintained but not actively developed.
Access to data such as properties, library, UVLayers and ColorLayers is not available
further more, a mesh modified with NMesh will destroy inactive UV and Color layers
so writing tools that use NMesh is discouraged.
Use L{Mesh} instead.
Mesh Data
=========