def main(argv):
    inputfile = ''
    outputfile = ''
    propfile = ''
    try:
        opts, args = getopt.getopt(argv, "hd:f:D:",
                                   ["ifile=", "ofile=", "dfil="])
    except getopt.GetoptError:
        print('test.py -d <inputfile> -f <outputfile> -D <propfile>')
        sys.exit(2)
    for opt, arg in opts:
        if opt == '-h':
            print('test.py -d <inputfile> -f <outputfile> -D <propfile>')
            sys.exit()
        elif opt in ("-d", "--ifile"):
            inputfile = arg
        elif opt in ("-f", "--ofile"):
            outputfile = arg
        elif opt in ("-D", "--dfile"):
            propfile = arg

    print("LuxCore %s" % pyluxcore.Version())
    pyluxcore.Init(LogHandler)
    app = QApplication.instance()
    if app is None:
        app = QApplication(sys.argv)
    window = MainWindow(inputfile, outputfile, propfile)
    if propfile == "":
        window.show()
    app.exec_()
Beispiel #2
0
def main(argv):
    pyluxcore.Init(LogHandler)
    print("LuxCore %s" % pyluxcore.Version())

    # Get the command line options
    try:
        opts, args = getopt.getopt(argv[1:], "hH:p:q",
                                   ["help", "host=", "port=", "quiet"])
    except getopt.GetoptError:
        usage()
        sys.exit(-1)

    host = "localhost"
    port = 18081
    logOutput = sys.stdout
    for opt, arg in opts:
        if opt == '-h':
            usage()
            sys.exit()
        if opt in ('-H', '--host'):
            host = arg
        if opt in ('-p', '--port'):
            port = int(arg)
        if opt in ('-q', '--quiet'):
            logOutput = None
    print("Hostname: %s Port: %d" % (host, port))

    global qapp
    qapp = QApplication(sys.argv)

    while True:
        server = LuxCoreTelnetServer(host, port, logOutput)
        server.handleConnection()

    sys.exit(app.exec_())
Beispiel #3
0
 def __init__(self):
     print("LuxCore __init__ call")
     pyluxcore.Init()
     self.imageBufferFloat = None
     self.session = None
     self.filmWidth = -1
     self.filmHeight = -1
def main():
	pyluxcore.Init(LogHandler)
	print("LuxCore %s" % pyluxcore.Version())
	
	app = QApplication(sys.argv)
	rv = RenderView("scenes/luxball/luxball-hdr.cfg")
	rv.show()
	sys.exit(app.exec_())
Beispiel #5
0
def main(argv):
	try:
		pyluxcore.Init(loghandler.LuxCoreLogHandler)
		logger.info("LuxCore %s" % pyluxcore.Version())

		LuxCoreNetNode(argv[1:])
	finally:
		pyluxcore.SetLogHandler(None)
Beispiel #6
0
def main():
	print("LuxCore %s" % pyluxcore.Version())
	pyluxcore.Init(LogHandler)
	
	app = QApplication(sys.argv)
	rv = RenderView()
	rv.show()
	app.exec_()
Beispiel #7
0
def main(argv):
	try:
		pyluxcore.Init(pyluxcoretools.utils.loghandler.LuxCoreLogHandler)
		logger.info("LuxCore %s" % pyluxcore.Version())

		LuxCoreMerge(argv[1:])
	finally:
		pyluxcore.SetLogHandler(None)
Beispiel #8
0
def main():
    pyluxcore.Init()

    print("LuxCore %s" % pyluxcore.Version())
    #print("OS:", os.name)

    SaveFilm()
    LoadFilm()
Beispiel #9
0
def main(argv):
	try:
		pyluxcore.Init(loghandler.LuxCoreLogHandlerDebug)
		logger.info("LuxCore %s" % pyluxcore.Version())

		netConsole = LuxCoreNetConsole()
		netConsole.Exec(argv[1:])
	finally:
		pyluxcore.SetLogHandler(None)
Beispiel #10
0
def main():
    pyluxcore.Init(LogHandler)

    print("LuxCore %s" % pyluxcore.Version())

    #PropertiesTest()
    #SceneTest()
    #RenderConfigTest()
    SimpleRenderTest()
Beispiel #11
0
def ui(app):
    try:
        pyluxcore.Init(loghandler.LuxCoreLogHandler)

        form = MainApp()
        form.show()

        app.exec_()
    finally:
        pyluxcore.SetLogHandler(None)
Beispiel #12
0
def main(argv):
    try:
        pyluxcore.Init(pyluxcoretools.utils.loghandler.LuxCoreLogHandler)
        logger.info("LuxCore %s" % pyluxcore.Version())

        pyluxcore.AddFileNameResolverPath(".")

        LuxCoreConsole(argv[1:])
    finally:
        pyluxcore.SetLogHandler(None)
Beispiel #13
0
def main():
	pyluxcore.Init()

	print("LuxCore %s" % pyluxcore.Version())
	#print("OS:", os.name)
	
	#PropertiesTests()
	#LuxRaysDeviceTests()
	#SimpleRender()
	#GetOutputTest()
	#ExtractConfiguration()
	StrandsRender()
Beispiel #14
0
def main():
    pyluxcore.Init()

    print("LuxCore %s" % pyluxcore.Version())
    #print("OS:", os.name)

    PropertiesTests()
    LuxRaysDeviceTests()
    SimpleRender()
    GetOutputTest()
    ExtractConfiguration()
    StrandsRender()
    ImagePipelineEdit()
    SaveResumeRenderingM()
    SaveResumeRenderingS()
Beispiel #15
0
def main():
    print(sys.argv)
    mesh_id = int(sys.argv[1])
    render_time = int(sys.argv[2])
    # You have to init pyluxcore before you call anything else

    pyluxcore.Init()
        
    fluid_mesh = mesh_directory + "mesh_%07d.ply" % mesh_id
        
    if Path(fluid_mesh).is_file() is not True: # max number for testing
        print("Mesh file " + fluid_mesh + " not found. Rendering finished")
    else:
        print("Rendering mesh " + fluid_mesh)
            
        scene = build_scene(fluid_mesh)
        output_name = output_dir + "frame_%07d" % mesh_id
        session = build_session(scene, output_name)
        session.Start()
        sleep(render_time)
        session.GetFilm().SaveOutputs()
        session.Stop()
Beispiel #16
0
def main():
    logger.info("LuxCore Unit tests")

    try:
        pyluxcore.Init(LuxCoreLogHandler)
        logger.info("LuxCore %s" % pyluxcore.Version())
        logger.info("LuxCore has OpenCL: %r" %
                    pyluxcoreunittests.tests.utils.LuxCoreHasOpenCL())

        # Parse command line options

        parser = argparse.ArgumentParser(
            description='Runs LuxCore test suite.')
        parser.add_argument(
            '--config',
            help='custom configuration properties for the unit tests')
        parser.add_argument(
            '--resume',
            action='store_true',
            help='resume a previously interrupted test session')
        parser.add_argument(
            '--filter',
            help=
            'select only the tests matching the specified regular expression')
        parser.add_argument('--list',
                            action='store_true',
                            help='list all available tests')
        parser.add_argument('--subset',
                            action='store_true',
                            help='list all tests available tests')
        parser.add_argument('--verbose',
                            default=2,
                            help='set the verbosity level (i.e 0, 1, 2 or 3)')
        args = parser.parse_args()

        global printLuxCoreLog
        if int(args.verbose) >= 3:
            printLuxCoreLog = True

        if not args.resume:
            # Delete all images in the images directory
            logger.info("Deleting all images...")
            folder = "images"
            for f in [
                    png for png in os.listdir(folder) if png.endswith(".png")
            ]:
                filePath = os.path.join(folder, f)
                os.unlink(filePath)
            logger.info("ok")

        # Read the custom configuration file
        if args.config:
            LuxCoreTest.customConfigProps.SetFromFile(args.config)

        # Mostly used to save time (to not hit the cap) on Travis CI
        pyluxcoreunittests.tests.utils.USE_SUBSET = args.subset

        # Discover all tests

        propertiesSuite = unittest.TestLoader().discover(
            "pyluxcoreunittests.tests.properties", top_level_dir=".")
        basicSuite = unittest.TestLoader().discover(
            "pyluxcoreunittests.tests.basic", top_level_dir=".")
        lightSuite = unittest.TestLoader().discover(
            "pyluxcoreunittests.tests.lights", top_level_dir=".")
        materialSuite = unittest.TestLoader().discover(
            "pyluxcoreunittests.tests.materials", top_level_dir=".")
        textureSuite = unittest.TestLoader().discover(
            "pyluxcoreunittests.tests.textures", top_level_dir=".")
        sceneSuite = unittest.TestLoader().discover(
            "pyluxcoreunittests.tests.scene", top_level_dir=".")
        haltSuite = unittest.TestLoader().discover(
            "pyluxcoreunittests.tests.halt", top_level_dir=".")
        serializationSuite = unittest.TestLoader().discover(
            "pyluxcoreunittests.tests.serialization", top_level_dir=".")

        allTests = unittest.TestSuite([
            propertiesSuite, basicSuite, lightSuite, materialSuite,
            textureSuite, sceneSuite, haltSuite, serializationSuite
        ])

        # List the tests if required

        if args.list:
            logger.info("All tests available:")
            l = ListAllTests(allTests)
            count = 0
            for t in l:
                logger.info("#%d  %s" % (count, t))
                count += 1
            logger.info("%d test(s) listed" % count)
            return

        # Filter the tests if required

        if args.filter:
            logger.info("Filtering tests by: %s" % args.filter)
            allTests = unittest.TestSuite(FilterTests(args.filter, allTests))

        # Skips the already done tests if required

        doneCount = 0
        if args.resume:
            with open("totaltestsdone.txt", "r") as f:
                doneCount = int(f.readlines()[0])
            logger.info("Tests already done: %d" % doneCount)

            TailTestsImpl_index = 0
            allTests = unittest.TestSuite(TailTests(doneCount, allTests))

        # To catch Ctrl-C
        unittest.installHandler()

        results = unittest.TextTestRunner(resultclass=TimeLoggingTestResult,
                                          stream=StreamToLogger(),
                                          verbosity=int(
                                              args.verbose)).run(allTests)

        # Print 10 slower tests (a tool to keep the total execution time in check)
        logger.info("20 slower tests execution times:")
        testTimes = results.getTestTimes()
        for t in sorted(testTimes, key=testTimes.get, reverse=True)[:20]:
            logger.info(" %s => %f secs", t, testTimes[t])

        # Save the number of tests run for a potential later resume
        with open("totaltestsdone.txt", "w") as f:
            f.write(str(results.testsRun + doneCount) + "\n")

        sys.exit(not results.wasSuccessful())
    finally:
        pyluxcore.SetLogHandler(None)
Beispiel #17
0
def main():
    print("LuxCore Unit tests")
    print("LuxCore %s" % pyluxcore.Version())

    # Delete all images in the images directory
    print("Deleting all images...", end="")
    folder = 'images'
    for f in [png for png in os.listdir(folder) if png.endswith(".png")]:
        filePath = os.path.join(folder, f)
        os.unlink(filePath)
    print("ok")

    pyluxcore.Init(LuxCoreLogHandler)

    # Parse command line options

    parser = argparse.ArgumentParser(description='Runs LuxCore test suite.')
    parser.add_argument(
        '--config',
        dest='config',
        help='custom configuration properties for the unit tests')
    parser.add_argument(
        '--filter',
        dest='filter',
        help='select only the tests matching the specified regular expression')
    parser.add_argument('--list',
                        dest='list',
                        action='store_true',
                        help='list all tests available tests')
    parser.add_argument('--verbose',
                        dest='verbose',
                        default=2,
                        help='set the verbosity level (i.e 0, 1, 2 or 3)')
    args = parser.parse_args()

    global printLuxCoreLog
    if int(args.verbose) >= 3:
        printLuxCoreLog = True

    # Read the custom configuration file
    if args.config:
        LuxCoreTest.customConfigProps.SetFromFile(args.config)

    # Discover all tests

    propertiesSuite = unittest.TestLoader().discover(
        "pyluxcoreunittests.tests.properties", top_level_dir=".")
    basicSuite = unittest.TestLoader().discover(
        "pyluxcoreunittests.tests.basic", top_level_dir=".")
    lightSuite = unittest.TestLoader().discover(
        "pyluxcoreunittests.tests.lights", top_level_dir=".")
    textureSuite = unittest.TestLoader().discover(
        "pyluxcoreunittests.tests.textures", top_level_dir=".")

    allTests = unittest.TestSuite(
        [propertiesSuite, basicSuite, lightSuite, textureSuite])

    # List the tests if required

    if args.list:
        print("All tests available:")
        l = ListAllTests(allTests)
        count = 0
        for t in l:
            print("  %s" % t)
            count += 1
        print("%d test(s) listed" % count)
        return

    # Filter the tests if required

    if args.filter:
        print("Filtering tests by: %s" % args.filter)
        allTests = unittest.TestSuite(FilterTests(args.filter, allTests))

    unittest.TextTestRunner(verbosity=int(args.verbose)).run(allTests)