Ejemplo n.º 1
0
configFile = wrap.openFileDialog("Select config file",
                                 filter="Text Files (*.txt)")
print "Config file is '%s'" % configFile

tasks = ParseConfig.parseConfig(configFile, 'DefaultSettings_2_Wrapping.txt')

tasksCount = len(tasks)
for taskNum, task in enumerate(tasks):

    print "Task %d of %d" % (taskNum + 1, tasksCount)
    print "Loading scan '%s'..." % task['scanFileName']
    scan = wrap.Geom(task['scanFileName'], fitToView=False)
    scan.wireframe = False
    scaleFactor = 100.0 / scan.boundingBoxSize[0]
    scan.scale(scaleFactor)
    wrap.fitToView()
    print "OK"

    if 'textureFileName' in task:
        print "Loading texture '%s'" % task['textureFileName']
        scan.texture = wrap.Image(task['textureFileName'])
        print "OK"
    else:
        print "No texture found"

    print "Loading basemesh '%s'..." % task['basemeshFileName']
    basemesh = wrap.Geom(task['basemeshFileName'], fitToView=False)
    print "OK"

    print "Rigid alignment..."
    basemeshPoints = wrap.loadPoints(task['basemeshPointsFileName'])
print "Config file is '%s'" %  configFile

tasks = ParseConfig.parseConfig(configFile, "DefaultSettings_3_PostProcessing.txt")

for taskNum, task in enumerate(tasks):

    if 'wrapped' in locals(): del wrapped
    if 'scan' in locals(): del scan

    print "Task %d of %d" % (taskNum + 1, len(tasks))
    print "Loading scan '%s'..." % task['scanFileName']
    scan = wrap.Geom(task['scanFileName'], fitToView = False)
    scan.wireframe = False
    scaleFactor = 100.0 / scan.boundingBoxSize[0]
    scan.scale(scaleFactor)
    wrap.fitToView()
    print "OK"

    if 'textureFileName' in task:
        print "Loading texture '%s'" % task['textureFileName']
        scan.texture = wrap.Image(task['textureFileName'])
        print "OK"
    else:
        print "No texture found"

    print "Loading wrapped basemesh '%s'..." % task['wrappedResultFileName']
    wrapped = wrap.Geom(task['wrappedResultFileName'], scaleFactor = scaleFactor, fitToView = False)
    print "OK"

    if task['useMethods']['subdivide']:
        print "Subdivision..."