Beispiel #1
0
  def compileShader ( self, compileDir = '' ) :
    #
    from meShaderEd import app_renderer
  
    compiler =  app_global_vars [ 'ShaderCompiler' ]
    defines_str = app_global_vars [ 'ShaderDefines' ]
    includes_str = app_global_vars [ 'IncludePath' ]

    shaderCmd = [ compiler ]

    if includes_str != '' :
      includes_lst = includes_str.split ( ',' )
      for include in includes_lst :
        shaderCmd.append ( '-I' + include.strip () )

    if defines_str != '' :
      defines_lst = defines_str.split( ',' )
      for define in defines_lst :
        shaderCmd.append ( '-D' + define.strip () )
  
    shaderCmd.append ( self.shaderName )

    if compileDir == '' : compileDir = app_global_vars[ 'ProjectShaders' ]
    os.chdir ( compileDir )

    print '>> RSLNode shaderCmd = %s' %  ' '.join ( shaderCmd )
    print '>> compileDir = %s' % compileDir

    from core.meCommon import launchProcess

    launchProcess ( shaderCmd )
Beispiel #2
0
    def compileShader(self, compileDir=''):
        #
        #from meShaderEd import app_renderer

        compiler = app_global_vars['ShaderCompiler']
        defines_str = app_global_vars['ShaderDefines']
        includes_str = app_global_vars['IncludePath']

        shaderCmd = [compiler]

        if includes_str != '':
            includes_lst = includes_str.split(',')
            for include in includes_lst:
                shaderCmd.append('-I' + include.strip())

        if defines_str != '':
            defines_lst = defines_str.split(',')
            for define in defines_lst:
                shaderCmd.append('-D' + define.strip())

        shaderCmd.append(self.shaderName)

        if compileDir == '': compileDir = app_global_vars['ProjectShaders']
        import os
        os.chdir(compileDir)

        print '>> RSLNode shaderCmd = %s' % ' '.join(shaderCmd)
        print '>> compileDir = %s' % compileDir

        from core.meCommon import launchProcess

        launchProcess(shaderCmd)
Beispiel #3
0
	def renderRIB ( self ) :
		#
		#from meShaderEd import app_renderer
	
		renderer = app_global_vars [ 'RendererName' ]
		flags = app_global_vars [ 'RendererFlags' ]
		renderCmd = [ renderer ]
		if  flags != '' :  renderCmd.append ( flags )
		renderCmd.append ( self.ribName )

		print '>> RIBNode renderCmd = %s' %  ' '.join ( renderCmd )

		# call the process
		from core.meCommon import launchProcess

		launchProcess ( renderCmd )
Beispiel #4
0
	def renderRIB ( self ) :
		#
		#from meShaderEd import app_renderer
	
		renderer = app_global_vars [ 'RendererName' ]
		flags = app_global_vars [ 'RendererFlags' ]
		renderCmd = [ renderer ]
		if  flags != '' :  renderCmd.append ( flags )
		renderCmd.append ( self.ribName )

		print '>> RIBNode renderCmd = %s' %  ' '.join ( renderCmd )

		# call the process
		from core.meCommon import launchProcess

		launchProcess ( renderCmd )
Beispiel #5
0
    def getShaderInfo(self, methods=False):
        #
        inputLines = []
        if DEBUG_MODE:
            print('>> ShaderInfo.get ( %s ) by "%s"' %
                  (self.fileName, app_global_vars['ShaderInfo']))
        from core.meCommon import launchProcess
        import os
        curDir = os.getcwd()

        cmdList = []
        cmdList.append(app_global_vars['ShaderInfo'])
        if methods:
            cmdList.append('--methods')
        if self.renderer == 'renderdc':
            dirName = os.path.dirname(self.fileName)
            fileName = os.path.basename(self.fileName)
            (fileName, ext) = os.path.splitext(fileName)
            cmdList.append(fileName)
            os.chdir(dirName)
        else:
            cmdList.append(self.fileName)

        tmpDir = app_global_vars['TempPath']

        stdoutLog = os.path.join(
            tmpDir, 'stdout-%s.log' % os.path.basename(self.fileName))
        stderrLog = os.path.join(
            tmpDir, 'stderr-%s.log' % os.path.basename(self.fileName))

        launchProcess(cmdList, stdoutLog, stderrLog)

        stdout = file(stdoutLog, 'r')
        stderr = file(stderrLog, 'r')

        inputLines = stdout.read().split('\n')

        stdout.close()
        stderr.close()
        if self.renderer == 'renderdc': os.chdir(curDir)
        return inputLines
Beispiel #6
0
    def getShaderInfo(self, methods=False):
        #
        inputLines = []
        if DEBUG_MODE:
            print ('>> ShaderInfo.get ( %s ) by "%s"' % (self.fileName, app_global_vars["ShaderInfo"]))
        from core.meCommon import launchProcess
        import os

        curDir = os.getcwd()

        cmdList = []
        cmdList.append(app_global_vars["ShaderInfo"])
        if methods:
            cmdList.append("--methods")
        if self.renderer == "renderdc":
            dirName = os.path.dirname(self.fileName)
            fileName = os.path.basename(self.fileName)
            (fileName, ext) = os.path.splitext(fileName)
            cmdList.append(fileName)
            os.chdir(dirName)
        else:
            cmdList.append(self.fileName)

        tmpDir = app_global_vars["TempPath"]

        stdoutLog = os.path.join(tmpDir, "stdout-%s.log" % os.path.basename(self.fileName))
        stderrLog = os.path.join(tmpDir, "stderr-%s.log" % os.path.basename(self.fileName))

        launchProcess(cmdList, stdoutLog, stderrLog)

        stdout = file(stdoutLog, "r")
        stderr = file(stderrLog, "r")

        inputLines = stdout.read().split("\n")

        stdout.close()
        stderr.close()
        if self.renderer == "renderdc":
            os.chdir(curDir)
        return inputLines
Beispiel #7
0
  def getShaderInfo ( self, methods = False ) :
    #
    inputLines = []
    if DEBUG_MODE : print '>> ShaderInfo.get ( %s ) by "%s"' % ( self.fileName, app_global_vars [ 'ShaderInfo' ] )
    # app_global_vars [ 'ShaderCompiler' ]
    # app_global_vars [ 'SLO' ]
    from core.meCommon import launchProcess
    curDir =  os.getcwd ()
    
    cmdList = []
    cmdList.append ( app_global_vars [ 'ShaderInfo' ] )
    if methods :
      cmdList.append ( '--methods' )
    if self.renderer == 'renderdc' :
      dirName = os.path.dirname ( self.fileName )
      fileName = os.path.basename ( self.fileName )
      ( fileName, ext ) = os.path.splitext ( fileName )
      cmdList.append ( fileName )
      os.chdir ( dirName )
    else :
      cmdList.append ( self.fileName )

    tmpDir = app_global_vars [ 'TempPath' ]

    stdoutLog = os.path.join ( tmpDir, 'stdout-%s.log' % os.path.basename ( self.fileName ) )
    stderrLog = os.path.join ( tmpDir, 'stderr-%s.log' % os.path.basename ( self.fileName ) )

    launchProcess ( cmdList, stdoutLog, stderrLog )

    stdout = file ( stdoutLog, 'r' )
    stderr = file ( stderrLog, 'r' )

    inputLines = stdout.read ().split ( '\n' )

    stdout.close ()
    stderr.close ()
    if self.renderer == 'renderdc' : os.chdir ( curDir )
    return  inputLines