diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-11-22 19:30:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-11-22 19:30:14 +0300 |
commit | a03836312463813e366f1043093625dafd3ebd2b (patch) | |
tree | 15b296c2cd0a9e3cc363da3e571b497bf5922c6f /release/scripts/mesh_wire.py | |
parent | 0d6d89a27bba554409fd26253a99487558daf80d (diff) |
mesh_wire.py - gave an error with no faces,
wizard_curve2tree.py - didnt work with no bevel object
Curve.py - ext1, ext2 didnt reference the interface names.
Diffstat (limited to 'release/scripts/mesh_wire.py')
-rw-r--r-- | release/scripts/mesh_wire.py | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/release/scripts/mesh_wire.py b/release/scripts/mesh_wire.py index 35cfa325497..bd38c47a9b9 100644 --- a/release/scripts/mesh_wire.py +++ b/release/scripts/mesh_wire.py @@ -44,6 +44,7 @@ from BPyMathutils import angleToLength import mesh_solidify import BPyMessages +reload(BPyMessages) import bpy @@ -219,9 +220,7 @@ def solid_wire(ob_orig, me_orig, sce, PREF_THICKNESS, PREF_SOLID, PREF_SHARP, PR for ii in vusers: co += me.verts[ii].co co /= len(vusers) - - - + me.faces.delete(1, range(len(me.faces))) me.faces.extend(new_faces) @@ -245,6 +244,18 @@ def main(): BPyMessages.Error_NoMeshActive() return + # Saves the editmode state and go's out of + # editmode if its enabled, we cant make + # changes to the mesh data while in editmode. + is_editmode = Window.EditMode() + Window.EditMode(0) + + me = ob_act.getData(mesh=1) # old NMesh api is default + if len(me.faces)==0: + BPyMessages.Error_NoMeshFaces() + if is_editmode: Window.EditMode(1) + return + # Create the variables. PREF_THICK = Blender.Draw.Create(0.005) PREF_SOLID = Blender.Draw.Create(1) @@ -259,16 +270,10 @@ def main(): ] if not Blender.Draw.PupBlock('Solid Wireframe', pup_block): + if is_editmode: Window.EditMode(1) return - # Saves the editmode state and go's out of - # editmode if its enabled, we cant make - # changes to the mesh data while in editmode. - is_editmode = Window.EditMode() - Window.EditMode(0) - Window.WaitCursor(1) - me = ob_act.getData(mesh=1) # old NMesh api is default t = sys.time() # Run the mesh editing function @@ -282,4 +287,4 @@ def main(): # This lets you can import the script without running it if __name__ == '__main__': - main()
\ No newline at end of file + main() |