Exemplo 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()
Exemplo 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()
Exemplo n.º 3
0
def do_render(src):
    r = Renderer(renderMode="production")
    r.load(src)

    r.useAnimatedValues = 1

    light = r.plugins['defaultLighting']
    print "light : {0}".format(light)

    settings = r.outputSettings
    print settings

    view = r.plugins['renderView']
    print view

    print "RENDER"
    r.render(sequence=[1, 10, 1], live=False, vfb=True)
    print "RENDER DONE"

    r.release()
Exemplo n.º 4
0

if __name__ == "__main__":
    do_render = False

    in_path = 'C:/work/tmp/vrscenes/root.vrconcat.vrscene'
    out_path = 'C:/work/tmp/vrscenes/test_out.vrscene'
    sn = 'orangeCst@material'
    pn = 'blues|pSphere11|pSphereShape11@node'

    sdk.enableFrameBuffer(True)

    print "CREATE"
    r = Renderer(renderMode='production')
    print "LOAD"
    r.load(in_path)

    if do_render:
        r.start()
        r.waitForImageReady()

    '''
    print "---"
    po = r.plugins[pn]
    print po.material
    print r.plugins[sn]
    po.setValueAsString('material', sn)
    print "---"
    '''

    print "SAVE"
Exemplo n.º 5
0

if __name__ == "__main__":
    if len(sys.argv) > 2:
        src = sys.argv[1]
        out_image = sys.argv[2]
    else:
        src = 'c:/work/scenes/vray/test/cubes.vrscene'
        out_image = 'c:/work/images/test.png'

    sdk.enableFrameBuffer(True)

    print "Render {0} -> {1}".format(src, out_image)

    r = Renderer(renderMode='production')
    r.load(src)

    r.setOnBucketReady(onBucketReady)
    r.setOnImageReady(onImageReady)
    r.setOnDumpMessage(onDumpMessage)

    r.outputImage = out_image

    res = r.resolution
    res[0] = int(res[0] / 10)
    res[1] = int(res[1] / 10)

    r.resolution = res

    r.start()
    r.waitForImageReady()
Exemplo n.º 6
0
    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:
        summary[name] = 0
    summary[name] += 1
Exemplo n.º 7
0
import os

import scramble  # @UnusedImport

from cgev.vray import Renderer

# path = 'C:/work/scenes/vray/test/castle.vrscene'
# path = 'C:/work/scenes/vray/test/sphere.vrscene'
path = "C:/work/scenes/vray/test/colors.vrscene"

r = Renderer()
r.load(path)

s = r.outputSettings

"""
names = r.plugNames
names.sort()

for n in names:
    print n
"""

for plugin in r.plugObjects:
    print "-" * 40
    print "{0} {1}".format(plugin.getName(), plugin.getType())
    print "-" * 40

    for prop in plugin._props:
        print prop
Exemplo n.º 8
0
def main():
    r = Renderer(renderMode='production')
    r.load('C:\\work\\vray3sdk\\scenes\\car.vrscene')
    r.outputImage = 'C:/work/test.png'
    r.resolution = [320, 200]
    r.renderSync()