Ejemplo n.º 1
0
    def loadScene(self):
        self.progressBar.setValue(0)

        r = Renderer()
        r.setOnProgress(self.loadProgress)
        r.load("C:/work/scenes/vray/test/sphere.vrscene")
        r.save("C:/work/tmp/test/sphere.vrscene")
        r.close()
Ejemplo n.º 2
0
    def run(self):
        if True:
            r = Renderer()
            r.setOnProgress(self.loadProgress)
            r.load("C:/work/scenes/vray/test/labo.vrscene")
            r.save("C:/work/tmp/test/labo.vrscene")
            r.close()
        else:
            for i in range(1, 101):
                self.loadProgress(None, "plop", i, 100)
                time.sleep(0.1)

        print "." * 80
        print threading.current_thread()
Ejemplo n.º 3
0
def onProgress(renderer, message, progress, max_progress):
    global old_pgr

    pgr = progress * 100 / max_progress

    if abs(pgr - old_pgr) < 10:
        return

    print "{0} {1}%".format(message, pgr)
    old_pgr = pgr


renderer = Renderer(renderMode="rtCPU")
# scene_file = SCENES_PATH + '/car.vrscene'
scene_file = 'C:/work/scenes/vray/test/labo.vrscene'
renderer.setOnProgress(onProgress)
print "... loading"
renderer.load(scene_file)
renderer.resolution = [480, 300]
print "... start render"
renderer.startSync()

# renderer.waitForImageReady(3000)
# renderer.waitForImageReady(100)

plugs = pickPlugins(renderer)
summary = dict()

for p in plugs:
    name = p[3]
    if name not in summary:
Ejemplo n.º 4
0
import scramble  # @UnusedImport

from cgev.vray import sdk  # @UnusedImport
from cgev.vray import Renderer


def onProgress(renderer, message, progress, total):
    print "{0} / {1} : {2}".format(progress, total, message)
    pgr = progress * 100 / total
    if pgr > 10:
        renderer.stop()


if __name__ == "__main__":
    src = 'c:/work/scenes/vray/test/labo.vrscene'

    r = Renderer()
    r.setOnProgress(onProgress)
    r.load(src)
    r.useAnimatedValues = 1

    '''
    print "render sequence"
    r.renderSequence([1, 10, 1])
    print "wait"
    r.waitForSequenceDone()
    print "done"
    '''