예제 #1
0
for k in range(dataset.testSet().numLights()):
    xmlAddGradientSliceRendering(testset.gradientRenderables[k],
                                 slices=len(testset.parameterList()))

for i in range(dataset.testSet().numBSDFIterations()):
    if options.iteration is not None and i != options.iteration:
        continue

    gsubdir = gdirpath + "/" + format(options.superiteration).zfill(2)

    if not os.path.exists(gsubdir):
        os.mkdir(gsubdir)

    if options.superiteration >= 1:
        meshfile = dataset.meshfileAt(iteration=0,
                                      superiteration=options.superiteration -
                                      1)
    else:
        meshfile = dataset.testset.initialMeshPath()

    if meshfile is None:
        print("Couldn't find mesh for ", options.superiteration, "-", i)
        break

    paramlist = testset.parameterList()
    bsdf = toMap(
        paramlist,
        dataset.BSDFAt(iteration=i, superiteration=options.superiteration))
    if options.adaptiveMode is None:
        bsdfSamples = toMap(
            dataset.bsdfAdaptiveSamplingParameterList,
    if i >= dataset.testSet().numIterations():
        ii = 0
        bi = i - dataset.testSet().numIterations()
    else:
        ii = i
        bi = -1

    isubdir = idirpath + "/" + format(options.superiteration).zfill(2)

    if not os.path.exists(isubdir):
        os.mkdir(isubdir)

    if options.iteration is not None and i != options.iteration:
        continue

    if dataset.meshfileAt(iteration=ii, superiteration=options.superiteration
                          ) is None and dataset.testSet().numIterations() != 0:
        print("Couldn't find ", options.superiteration, "-", i)
        break

    if dataset.testSet().numIterations() == 0:
        meshfile = dataset.testSet().initialMeshPath()
    else:
        meshfile = dataset.meshfileAt(iteration=ii,
                                      superiteration=options.superiteration)

    paramlist = testset.parameterList()
    bsdf = toMap(
        paramlist,
        dataset.BSDFAt(iteration=bi, superiteration=options.superiteration))

    for k in range(dataset.testSet().numLights()):
    if not os.path.exists(isubdir):
        os.mkdir(isubdir)
    if not os.path.exists(gisubdir):
        os.mkdir(gisubdir)

    if options.iteration is not None and i != options.iteration:
        continue

    if dataset.testSet().numIterations() > i:
        ii = i
        bi = -1
    else:
        ii = 0
        bi = i - dataset.testSet().numIterations()

    if dataset.meshfileAt(iteration=ii, superiteration=options.superiteration) is None and ii != 0:
        print("Couldn't find ", options.superiteration, "-", ii)
        break

    if ii != 0:
        meshfile = dataset.meshfileAt(iteration=ii, superiteration=options.superiteration)
    else:
        meshfile = dataset.testSet().initialMeshPath()

    paramlist = testset.parameterList()
    bsdf = toMap(paramlist, dataset.BSDFAt(iteration=bi, superiteration=options.superiteration))

    for k in range(dataset.testSet().numLights()):
        print "Iteration ", i, "/", testset.numIterations(), ", Light ", k, "/", dataset.testSet().numLights(), "",
        sys.stdout.flush()