diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-04-09 11:03:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-04-09 11:03:26 +0400 |
commit | bd142ac2f44b78f10ad60643dbb71e5d09035b91 (patch) | |
tree | 102ecc233e4bec0537e2af735ece4848264fabd6 /release | |
parent | 55d0bf6b3337fdb2075d76e0c79153ff281adfce (diff) |
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.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/bpymodules/BPyMessages.py | 15 | ||||
-rw-r--r-- | release/scripts/unweld.py | 4 |
2 files changed, 17 insertions, 2 deletions
diff --git a/release/scripts/bpymodules/BPyMessages.py b/release/scripts/bpymodules/BPyMessages.py index dbf8d8524a3..0ff8e178ac1 100644 --- a/release/scripts/bpymodules/BPyMessages.py +++ b/release/scripts/bpymodules/BPyMessages.py @@ -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 + + diff --git a/release/scripts/unweld.py b/release/scripts/unweld.py index 4fd13f647d6..89cf495181c 100644 --- a/release/scripts/unweld.py +++ b/release/scripts/unweld.py @@ -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) |