forked from bartvdbraak/blender
Scripts:
- Campbell Barton updated his obj exporter and skin (bridge/skin/loft) scripts. Thanks.
This commit is contained in:
parent
e5b527c629
commit
de567cd0cc
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
Name: 'Wavefront (.obj)...'
|
Name: 'Wavefront (.obj)...'
|
||||||
Blender: 237
|
Blender: 232
|
||||||
Group: 'Export'
|
Group: 'Export'
|
||||||
Tooltip: 'Save a Wavefront OBJ File'
|
Tooltip: 'Save a Wavefront OBJ File'
|
||||||
"""
|
"""
|
||||||
@ -56,37 +56,20 @@ NULL_IMG = '(null)' # from docs at http://astronomy.swin.edu.au/~pbourke/geomfor
|
|||||||
|
|
||||||
def save_mtl(filename):
|
def save_mtl(filename):
|
||||||
file = open(filename, "w")
|
file = open(filename, "w")
|
||||||
|
file.write('# Blender MTL File: %s\n' % (Get('filename')))
|
||||||
for mat in Material.Get():
|
for mat in Material.Get():
|
||||||
|
|
||||||
file.write('newmtl %s\n' % (mat.getName())) # Define a new material
|
file.write('newmtl %s\n' % (mat.getName())) # Define a new material
|
||||||
|
file.write('Ns %s\n' % ((mat.getHardness()-1) * 1.9607843137254901 ) ) # Hardness, convert blenders 1-511 to MTL's
|
||||||
# Hardness, convert blenders 1-511 to MTL's
|
file.write('Kd %.6f %.6f %.6f\n' % tuple(mat.getRGBCol())) # Diffuse
|
||||||
file.write('Ns %s\n' % ((mat.getHardness()-1) * 1.9607843137254901 ) )
|
file.write('Ka %.6f %.6f %.6f\n' % tuple(mat.getMirCol())) # Ambient, uses mirror colour,
|
||||||
|
file.write('Ks %.6f %.6f %.6f\n' % tuple(mat.getSpecCol())) # Specular
|
||||||
col = mat.getRGBCol()
|
file.write('d %.6f\n' % mat.getAlpha()) # Alpha (obj uses 'd' for dissolve)
|
||||||
# Diffuse
|
|
||||||
file.write('Kd %s %s %s\n' % (col[0], col[1], col[2]))
|
|
||||||
|
|
||||||
col = mat.getMirCol()
|
|
||||||
# Ambient, uses mirror colour,
|
|
||||||
file.write('Ka %s %s %s\n' % (col[0], col[1], col[2]))
|
|
||||||
|
|
||||||
col = mat.getSpecCol()
|
|
||||||
# Specular
|
|
||||||
file.write('Ks %s %s %s\n' % (col[0],col[1], col[2]))
|
|
||||||
|
|
||||||
# Alpha (dissolve)
|
|
||||||
file.write('d %s\n' % (mat.getAlpha()))
|
|
||||||
|
|
||||||
# illum, 0 to disable lightng, 2 is normal.
|
# illum, 0 to disable lightng, 2 is normal.
|
||||||
if mat.getMode() & Material.Modes['SHADELESS']:
|
if mat.getMode() & Material.Modes['SHADELESS']:
|
||||||
file.write('illum 0\n') # ignore lighting
|
file.write('illum 0\n\n') # ignore lighting
|
||||||
else:
|
else:
|
||||||
file.write('illum 2\n') # light normaly
|
file.write('illum 2\n\n') # light normaly
|
||||||
|
|
||||||
# End OF Mat
|
|
||||||
file.write('\n') # new line
|
|
||||||
|
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
def save_obj(filename):
|
def save_obj(filename):
|
||||||
@ -126,24 +109,20 @@ def save_obj(filename):
|
|||||||
|
|
||||||
# Vert
|
# Vert
|
||||||
for v in m.verts:
|
for v in m.verts:
|
||||||
file.write('v %s %s %s\n' % (v.co.x, v.co.y, v.co.z))
|
file.write('v %.6f %.6f %.6f\n' % tuple(v.co))
|
||||||
|
|
||||||
# UV
|
# UV
|
||||||
for f in m.faces:
|
for f in m.faces:
|
||||||
''' # Export edges?
|
|
||||||
if len(f.v) < 3:
|
|
||||||
continue
|
|
||||||
'''
|
|
||||||
for uvIdx in range(len(f.v)):
|
for uvIdx in range(len(f.v)):
|
||||||
if f.uv:
|
if f.uv:
|
||||||
file.write('vt %s %s 0.0\n' % (f.uv[uvIdx][0], f.uv[uvIdx][1]))
|
file.write('vt %.6f %.6f 0.0\n' % f.uv[uvIdx])
|
||||||
else:
|
else:
|
||||||
file.write('vt 0.0 0.0 0.0\n')
|
file.write('vt 0.0 0.0 0.0\n')
|
||||||
|
|
||||||
# NORMAL
|
# NORMAL
|
||||||
for f1 in m.faces:
|
for f in m.faces:
|
||||||
for v in f1.v:
|
for v in f.v:
|
||||||
file.write('vn %s %s %s\n' % (v.no.x, v.no.y, v.no.z))
|
file.write('vn %.6f %.6f %.6f\n' % tuple(v.no))
|
||||||
|
|
||||||
uvIdx = 0
|
uvIdx = 0
|
||||||
for f in m.faces:
|
for f in m.faces:
|
||||||
@ -172,7 +151,7 @@ def save_obj(filename):
|
|||||||
|
|
||||||
file.write('f ')
|
file.write('f ')
|
||||||
for v in f.v:
|
for v in f.v:
|
||||||
file.write( '%s/%s/%s ' % (m.verts.index(v) + totverts+1, uvIdx+totuvco+1, uvIdx+totuvco+1))
|
file.write( '%s/%s/%s ' % (v.index + totverts+1, uvIdx+totuvco+1, uvIdx+totuvco+1))
|
||||||
|
|
||||||
uvIdx+=1
|
uvIdx+=1
|
||||||
file.write('\n')
|
file.write('\n')
|
||||||
@ -181,6 +160,6 @@ def save_obj(filename):
|
|||||||
totverts += len(m.verts)
|
totverts += len(m.verts)
|
||||||
totuvco += uvIdx
|
totuvco += uvIdx
|
||||||
file.close()
|
file.close()
|
||||||
print "obj export time: ", sys.time() - time1
|
print "obj export time: %.2f" % (sys.time() - time1)
|
||||||
|
|
||||||
Window.FileSelector(save_obj, 'Export Wavefront OBJ', newFName('obj'))
|
Window.FileSelector(save_obj, 'Export Wavefront OBJ', newFName('obj'))
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
#!BPY
|
#!BPY
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Name: 'Skin Two Vert-loops / Loft Multiple'
|
Name: 'Bridge/Skin/Loft'
|
||||||
Blender: 234
|
Blender: 234
|
||||||
Group: 'Mesh'
|
Group: 'Mesh'
|
||||||
Submenu: 'Loft-loop - shortest edge method' A1
|
|
||||||
Submenu: 'Loft-loop - even method' A2
|
|
||||||
Submenu: 'Loft-segment - shortest edge' B1
|
|
||||||
Submenu: 'Loft-segment - even method' B2
|
|
||||||
Tooltip: 'Select 2 or more vert loops, then run this script'
|
Tooltip: 'Select 2 or more vert loops, then run this script'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__author__ = "Campbell Barton"
|
__author__ = "Campbell Barton AKA Ideasman"
|
||||||
__url__ = ["blender", "elysiun"]
|
__url__ = ["http://members.iinet.net.au/~cpbarton/ideasman/", "blender", "elysiun"]
|
||||||
__version__ = "1.0 2004/04/25"
|
__version__ = "1.1 2005/06/13"
|
||||||
|
|
||||||
__bpydoc__ = """\
|
__bpydoc__ = """\
|
||||||
With this script vertex loops can be skinned: faces are created to connect the
|
With this script vertex loops can be skinned: faces are created to connect the
|
||||||
@ -23,7 +19,11 @@ Usage:
|
|||||||
|
|
||||||
In mesh Edit mode select the vertices of the loops (closed paths / curves of
|
In mesh Edit mode select the vertices of the loops (closed paths / curves of
|
||||||
vertices: circles, for example) that should be skinned, then run this script.
|
vertices: circles, for example) that should be skinned, then run this script.
|
||||||
A pop-up will provide further options, if the results of a method are not adequate try one of the others.
|
A pop-up will provide further options.
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
If the results of a method chosen from the pop-up are not adequate, undo and try one of the others.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@ -59,7 +59,23 @@ import Blender
|
|||||||
from Blender import *
|
from Blender import *
|
||||||
import math
|
import math
|
||||||
from math import *
|
from math import *
|
||||||
arg = __script__['arg']
|
|
||||||
|
|
||||||
|
choice = Draw.PupMenu(\
|
||||||
|
'Loft-loop - shortest edge method|\
|
||||||
|
Loft-loop - even method|\
|
||||||
|
Loft-segment - shortest edge|\
|
||||||
|
Loft-segment - even method')
|
||||||
|
|
||||||
|
if choice == 1:
|
||||||
|
arg='A1'
|
||||||
|
elif choice == 2:
|
||||||
|
arg='A2'
|
||||||
|
elif choice == 3:
|
||||||
|
arg='B1'
|
||||||
|
elif choice == 4:
|
||||||
|
arg='B2'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#================#
|
#================#
|
||||||
@ -80,7 +96,7 @@ def clamp(max, number):
|
|||||||
# List func that takes the last item and adds it to the front #
|
# List func that takes the last item and adds it to the front #
|
||||||
#=============================================================#
|
#=============================================================#
|
||||||
def listRotate(ls):
|
def listRotate(ls):
|
||||||
return [ls[-1]] + ls[:-1]
|
ls.append(ls.pop(0))
|
||||||
|
|
||||||
#=================================================================#
|
#=================================================================#
|
||||||
# Recieve a list of locs: [x,y,z] and return the average location #
|
# Recieve a list of locs: [x,y,z] and return the average location #
|
||||||
@ -134,22 +150,26 @@ def selVertBetween2Faces(face1, face2):
|
|||||||
# Measure the total distance between all the edges in #
|
# Measure the total distance between all the edges in #
|
||||||
# 2 vertex loops #
|
# 2 vertex loops #
|
||||||
#=======================================================#
|
#=======================================================#
|
||||||
def measureVloop(mesh, v1loop, v2loop, surplusFaces):
|
def measureVloop(mesh, v1loop, v2loop, surplusFaces, bestSoFar):
|
||||||
totalDist = 0
|
totalDist = 0
|
||||||
|
|
||||||
# Rotate the vertloops to cycle through each pair.
|
# Rotate the vertloops to cycle through each pair.
|
||||||
# of faces to compate the distance between the 2 poins
|
# of faces to compate the distance between the 2 poins
|
||||||
for ii in range(len(v1loop)):
|
for ii in range(len(v1loop)):
|
||||||
if ii not in surplusFaces:
|
if ii not in surplusFaces:
|
||||||
V1 = selVertBetween2Faces(mesh.faces[v1loop[0]], mesh.faces[v1loop[1]])
|
# Clamp
|
||||||
V2 = selVertBetween2Faces(mesh.faces[v2loop[0]], mesh.faces[v2loop[1]])
|
v2clampii = ii
|
||||||
|
while v2clampii >= len(v2loop):
|
||||||
|
v2clampii -= len(v2loop)
|
||||||
|
print v2clampii
|
||||||
|
|
||||||
P1 = (V1[0],V1[1],V1[2])
|
V1 = selVertBetween2Faces(mesh.faces[v1loop[ii-1]], mesh.faces[v1loop[ii]])
|
||||||
P2 = (V2[0],V2[1],V2[2])
|
V2 = selVertBetween2Faces(mesh.faces[v2loop[v2clampii-1]], mesh.faces[v2loop[v2clampii]])
|
||||||
|
|
||||||
totalDist += measure(P1,P2)
|
totalDist += measure(V1, V2)
|
||||||
v1loop = listRotate(v1loop)
|
# Bail out early if not an improvement on previously measured.
|
||||||
v2loop = listRotate(v2loop)
|
if bestSoFar != None and totalDist > bestSoFar:
|
||||||
|
return totalDist
|
||||||
|
|
||||||
#selVertBetween2Faces(mesh.faces[v2loop[0]], mesh.faces[v2loop[1]])
|
#selVertBetween2Faces(mesh.faces[v2loop[0]], mesh.faces[v2loop[1]])
|
||||||
return totalDist
|
return totalDist
|
||||||
@ -192,7 +212,7 @@ def skinVertLoops(mesh, v1loop, v2loop):
|
|||||||
|
|
||||||
# Work out if the vert loops are equel or not, if not remove the extra faces from the larger
|
# Work out if the vert loops are equel or not, if not remove the extra faces from the larger
|
||||||
surplusFaces = []
|
surplusFaces = []
|
||||||
tempv1loop = eval(str(v1loop)) # strip faces off this one, use it to keep track of which we have taken faces from.
|
tempv1loop = v1loop[:] # strip faces off this one, use it to keep track of which we have taken faces from.
|
||||||
if len(v1loop) > len(v2loop):
|
if len(v1loop) > len(v2loop):
|
||||||
|
|
||||||
# Even face method.
|
# Even face method.
|
||||||
@ -231,20 +251,20 @@ def skinVertLoops(mesh, v1loop, v2loop):
|
|||||||
# Copy old faces properties
|
# Copy old faces properties
|
||||||
|
|
||||||
face.v.append( selVertBetween2Faces(\
|
face.v.append( selVertBetween2Faces(\
|
||||||
mesh.faces[v1loop[clamp(lenVloop, fIdx)]],\
|
mesh.faces[v1loop[clamp(lenVloop, fIdx)]],\
|
||||||
mesh.faces[v1loop[clamp(lenVloop, fIdx+1)]]) )
|
mesh.faces[v1loop[clamp(lenVloop, fIdx+1)]]) )
|
||||||
|
|
||||||
face.v.append( selVertBetween2Faces(\
|
face.v.append( selVertBetween2Faces(\
|
||||||
mesh.faces[v1loop[clamp(lenVloop, fIdx+1)]],\
|
mesh.faces[v1loop[clamp(lenVloop, fIdx+1)]],\
|
||||||
mesh.faces[v1loop[clamp(lenVloop, fIdx+2)]]) )
|
mesh.faces[v1loop[clamp(lenVloop, fIdx+2)]]) )
|
||||||
|
|
||||||
#face.v.append( selVertBetween2Faces(\
|
#face.v.append( selVertBetween2Faces(\
|
||||||
#mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, (fIdx - offset +1 ))]],\
|
#mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, (fIdx - offset +1 ))]],\
|
||||||
#mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, (fIdx - offset + 2))]]) )
|
#mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, (fIdx - offset + 2))]]) )
|
||||||
|
|
||||||
face.v.append( selVertBetween2Faces(\
|
face.v.append( selVertBetween2Faces(\
|
||||||
mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, (fIdx - offset))]],\
|
mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, (fIdx - offset))]],\
|
||||||
mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, fIdx - offset + 1)]]) )
|
mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, fIdx - offset + 1)]]) )
|
||||||
|
|
||||||
mesh.faces.append(face)
|
mesh.faces.append(face)
|
||||||
|
|
||||||
@ -256,20 +276,20 @@ def skinVertLoops(mesh, v1loop, v2loop):
|
|||||||
# Draw a normal quad between the 2 edges/faces
|
# Draw a normal quad between the 2 edges/faces
|
||||||
|
|
||||||
face.v.append( selVertBetween2Faces(\
|
face.v.append( selVertBetween2Faces(\
|
||||||
mesh.faces[v1loop[clamp(lenVloop, fIdx)]],\
|
mesh.faces[v1loop[clamp(lenVloop, fIdx)]],\
|
||||||
mesh.faces[v1loop[clamp(lenVloop, fIdx+1)]]) )
|
mesh.faces[v1loop[clamp(lenVloop, fIdx+1)]]) )
|
||||||
|
|
||||||
face.v.append( selVertBetween2Faces(\
|
face.v.append( selVertBetween2Faces(\
|
||||||
mesh.faces[v1loop[clamp(lenVloop, fIdx+1)]],\
|
mesh.faces[v1loop[clamp(lenVloop, fIdx+1)]],\
|
||||||
mesh.faces[v1loop[clamp(lenVloop, fIdx+2)]]) )
|
mesh.faces[v1loop[clamp(lenVloop, fIdx+2)]]) )
|
||||||
|
|
||||||
face.v.append( selVertBetween2Faces(\
|
face.v.append( selVertBetween2Faces(\
|
||||||
mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, (fIdx - offset +1 ))]],\
|
mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, (fIdx - offset +1 ))]],\
|
||||||
mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, (fIdx - offset + 2))]]) )
|
mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, (fIdx - offset + 2))]]) )
|
||||||
|
|
||||||
face.v.append( selVertBetween2Faces(\
|
face.v.append( selVertBetween2Faces(\
|
||||||
mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, (fIdx - offset))]],\
|
mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, (fIdx - offset))]],\
|
||||||
mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, fIdx - offset + 1)]]) )
|
mesh.faces[v2loop[clamp(lenVloop - lenSupFaces, fIdx - offset + 1)]]) )
|
||||||
|
|
||||||
mesh.faces.append(face)
|
mesh.faces.append(face)
|
||||||
|
|
||||||
@ -348,24 +368,19 @@ def optimizeLoopOrded(mesh, v1loop, v2loop):
|
|||||||
for ii in range(len(v1loop)):
|
for ii in range(len(v1loop)):
|
||||||
|
|
||||||
# Loop twice , Once for the forward test, and another for the revearsed
|
# Loop twice , Once for the forward test, and another for the revearsed
|
||||||
for iii in [0, 0]:
|
for iii in [None, None]:
|
||||||
dist = measureVloop(mesh, v1loop, v2loop)
|
dist = measureVloop(mesh, v1loop, v2loop, bestSoFar)
|
||||||
# Initialize the Best distance recorded
|
# Initialize the Best distance recorded
|
||||||
if bestSoFar == None:
|
if bestSoFar == None or dist < bestSoFar:
|
||||||
bestSoFar = dist
|
bestSoFar = dist
|
||||||
bestv2Loop = eval(str(v2loop))
|
bestv2Loop = v2loop[:]
|
||||||
|
|
||||||
elif dist < bestSoFar: # Update the info if a better vloop rotation is found.
|
|
||||||
bestSoFar = dist
|
|
||||||
bestv2Loop = eval(str(v2loop))
|
|
||||||
|
|
||||||
# We might have got the vert loop backwards, try the other way
|
# We might have got the vert loop backwards, try the other way
|
||||||
v2loop.reverse()
|
v2loop.reverse()
|
||||||
v2loop = listRotate(v2loop)
|
listRotate(v2loop)
|
||||||
return bestv2Loop
|
return bestv2Loop
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#================================================================#
|
#================================================================#
|
||||||
# Now we work out the optimum order to 'skin' the 2 vert loops #
|
# Now we work out the optimum order to 'skin' the 2 vert loops #
|
||||||
# by measuring the total distance of all edges created, #
|
# by measuring the total distance of all edges created, #
|
||||||
@ -381,28 +396,22 @@ def optimizeLoopOrdedShortEdge(mesh, v1loop, v2loop, surplusFaces):
|
|||||||
for ii in range(len(v2loop)):
|
for ii in range(len(v2loop)):
|
||||||
|
|
||||||
# Loop twice , Once for the forward test, and another for the revearsed
|
# Loop twice , Once for the forward test, and another for the revearsed
|
||||||
for iii in [0, 0]:
|
for iii in [None, None]:
|
||||||
dist = measureVloop(mesh, v1loop, v2loop, surplusFaces)
|
dist = measureVloop(mesh, v1loop, v2loop, surplusFaces, bestSoFar)
|
||||||
print 'dist', dist
|
print 'dist', dist
|
||||||
# Initialize the Best distance recorded
|
# Initialize the Best distance recorded
|
||||||
if bestSoFar == None:
|
if bestSoFar == None or dist < bestSoFar:
|
||||||
bestSoFar = dist
|
bestSoFar = dist
|
||||||
bestv2Loop = eval(str(v2loop))
|
bestv2Loop = v2loop[:]
|
||||||
|
|
||||||
elif dist < bestSoFar: # Update the info if a better vloop rotation is found.
|
|
||||||
bestSoFar = dist
|
|
||||||
bestv2Loop = eval(str(v2loop))
|
|
||||||
|
|
||||||
# We might have got the vert loop backwards, try the other way
|
# We might have got the vert loop backwards, try the other way
|
||||||
v2loop.reverse()
|
v2loop.reverse()
|
||||||
v2loop = listRotate(v2loop)
|
#v2loop = listRotate(v2loop)
|
||||||
|
listRotate(v2loop)
|
||||||
print 'best so far ', bestSoFar
|
print 'best so far ', bestSoFar
|
||||||
return bestv2Loop
|
return bestv2Loop
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#==============================#
|
#==============================#
|
||||||
# Find our vert loop list #
|
# Find our vert loop list #
|
||||||
@ -511,12 +520,10 @@ def reorderCircularVLoops(mesh, allVLoops):
|
|||||||
bestSoFar = 0
|
bestSoFar = 0
|
||||||
while vLoopIdx < len(reorderedVLoopLocs):
|
while vLoopIdx < len(reorderedVLoopLocs):
|
||||||
|
|
||||||
|
|
||||||
# Skin back to the start if needs be, becuase this is a crcular loft
|
# Skin back to the start if needs be, becuase this is a crcular loft
|
||||||
toSkin2 = vLoopIdx + 1
|
toSkin2 = vLoopIdx + 1
|
||||||
if toSkin2 == len(reorderedVLoopLocs):
|
if toSkin2 == len(reorderedVLoopLocs):
|
||||||
toSkin2 = 0
|
toSkin2 = 0
|
||||||
|
|
||||||
|
|
||||||
newDist = measure( reorderedVLoopLocs[vLoopIdx], reorderedVLoopLocs[toSkin2] )
|
newDist = measure( reorderedVLoopLocs[vLoopIdx], reorderedVLoopLocs[toSkin2] )
|
||||||
|
|
||||||
@ -534,7 +541,9 @@ if is_editmode: Window.EditMode(0)
|
|||||||
|
|
||||||
# Get a mesh and raise errors if we cant
|
# Get a mesh and raise errors if we cant
|
||||||
mesh = None
|
mesh = None
|
||||||
if len(Object.GetSelected()) > 0:
|
if choice == -1:
|
||||||
|
pass
|
||||||
|
elif len(Object.GetSelected()) > 0:
|
||||||
if Object.GetSelected()[0].getType() == 'Mesh':
|
if Object.GetSelected()[0].getType() == 'Mesh':
|
||||||
mesh = Object.GetSelected()[0].getData()
|
mesh = Object.GetSelected()[0].getData()
|
||||||
else:
|
else:
|
||||||
@ -542,8 +551,9 @@ if len(Object.GetSelected()) > 0:
|
|||||||
else:
|
else:
|
||||||
error('no mesh object selected')
|
error('no mesh object selected')
|
||||||
|
|
||||||
|
time1 = sys.time()
|
||||||
if mesh != None:
|
if mesh != None:
|
||||||
|
Window.WaitCursor(1)
|
||||||
allVLoops = getAllVertLoops(mesh)
|
allVLoops = getAllVertLoops(mesh)
|
||||||
|
|
||||||
# Re order the vert loops
|
# Re order the vert loops
|
||||||
@ -559,7 +569,7 @@ if mesh != None:
|
|||||||
toSkin2 = vloopIdx + 1
|
toSkin2 = vloopIdx + 1
|
||||||
if toSkin2 == len(allVLoops):
|
if toSkin2 == len(allVLoops):
|
||||||
toSkin2 = 0
|
toSkin2 = 0
|
||||||
|
|
||||||
# Circular loft or not?
|
# Circular loft or not?
|
||||||
if arg[0] == 'B': # B for open
|
if arg[0] == 'B': # B for open
|
||||||
if vloopIdx != vLoopIdxNotToSkin:
|
if vloopIdx != vLoopIdxNotToSkin:
|
||||||
@ -569,6 +579,8 @@ if mesh != None:
|
|||||||
|
|
||||||
vloopIdx +=1
|
vloopIdx +=1
|
||||||
|
|
||||||
mesh.update()
|
mesh.update(1,(mesh.edges != []),0)
|
||||||
|
|
||||||
if is_editmode: Window.EditMode(1)
|
if is_editmode: Window.EditMode(1)
|
||||||
|
Window.WaitCursor(0)
|
||||||
|
print "skinning time: %.2f" % (sys.time() - time1)
|
||||||
|
Loading…
Reference in New Issue
Block a user