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.
This commit is contained in:
Campbell Barton 2007-11-22 16:30:14 +00:00
parent 0d6d89a27b
commit a038363124
4 changed files with 23 additions and 14 deletions

@ -11,6 +11,8 @@ def Error_NoMeshUvActive():
Draw.PupMenu('Error%t|Active object is not a mesh with texface')
def Error_NoMeshMultiresEdit():
Draw.PupMenu('Error%t|Unable to complete action with multires enabled')
def Error_NoMeshFaces():
Draw.PupMenu('Error%t|Mesh has no faces')
# File I/O messages
def Error_NoFile(path):

@ -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()
main()

@ -183,7 +183,9 @@ class tree:
bb = curve.bevob.boundingBox
# self.limbScale = (bb[0] - bb[7]).length / 2.825 # THIS IS GOOD WHEN NON SUBSURRFED
self.limbScale = (bb[0] - bb[7]).length / 1.8
elif curve.ext2 != 0.0:
self.limbScale = curve.ext2 * 1.5
# forward_diff_bezier will fill in the blanks
# nice we can reuse these for every curve segment :)
pointlist = [[None, None, None] for i in xrange(steps+1)]

@ -115,9 +115,9 @@ class Curve:
@type resolv: int
@ivar width: The Curve Data width [0 - 2].
@type width: float
@ivar ext1: The Curve Data extent1 (for bevels).
@ivar ext1: The Curve Data extent1 Called "Extrude" in the user interface (for bevels only).
@type ext1: float
@ivar ext2: The Curve Data extent2 (for bevels).
@ivar ext2: The Curve Data extent2 - Called "Bevel Depth" in the user interface (for bevels only).
@type ext2: float
@ivar loc: The Curve Data location(from the center).
@type loc: list of 3 floats