Пример #1
0
def PtBegin(verbose=0):
    # initialize world
    PtWorld.initialize()
    io.initialize()
    PtWorld.getOptions().verbose.setValue(verbose)

    # Welcome msg
    msg ="Pytrace Rendering API\n"
    msg+="by Rudy Cortes - [email protected]\n\n"
    io.oInfo(msg,0,label=False)

    # Load Plugins
    corePlugins = ['camera','driver','shape']
     
    io.oInfo("Loading Plugins:\n",1)
    for dir in corePlugins:
        pdir = os.path.join(PtCommon.rootDir,dir)
        if os.path.exists(pdir):
            io.oInfo("\t%s\n"%os.path.basename(pdir).capitalize(),
                     2,
                     label=False)
            PtPluginManager.loadPlugins(pdir,core=True)    

    PtWorld.driver = PtNode("display_driver")
Пример #2
0
def PtBegin(verbose=0):
    # initialize world
    PtWorld.initialize()
    io.initialize()
    PtWorld.getOptions().verbose.setValue(verbose)

    # Welcome msg
    msg = "Pytrace Rendering API\n"
    msg += "by Rudy Cortes - [email protected]\n\n"
    io.oInfo(msg, 0, label=False)

    # Load Plugins
    corePlugins = ['camera', 'driver', 'shape']

    io.oInfo("Loading Plugins:\n", 1)
    for dir in corePlugins:
        pdir = os.path.join(PtCommon.rootDir, dir)
        if os.path.exists(pdir):
            io.oInfo("\t%s\n" % os.path.basename(pdir).capitalize(),
                     2,
                     label=False)
            PtPluginManager.loadPlugins(pdir, core=True)

    PtWorld.driver = PtNode("display_driver")
Пример #3
0
def oInfo(msg,loglevel,preStr="",postStr="",label=True):
    global verbosity
    verbosity = PtWorld.getOptions().verbose.value
    #if rt.OsTag() == "windows":
    #    set_color(FOREGROUND_GREEN)
    #    if label:
    #        sys.stdout.write("%s"%_mkMsg(msg,preStr,"INFO"))
    #    else:
    #        sys.stdout.write("%s"%_mkMsg(msg,preStr))
    #    set_color(FOREGROUND_GREY)
    #    sys.stdout.write("%s\n"%postStr)
    #else:
    if loglevel <= verbosity:
        if label:
            sys.stdout.write("%s%s%s%s"%(GREEN,_mkMsg(msg,preStr,"INFO"),ENDC,postStr))
        else:
            sys.stdout.write("%s%s%s%s"%(GREEN,_mkMsg(msg,preStr),ENDC,postStr))
Пример #4
0
def initialize():
    global verbosity
    verbosity = PtWorld.getOptions().verbose.value