Example #1
0
 def valueFromStr(self, strValue):
     #
     if not self.isArray():
         value = parseGlobalVars(strValue)
     else:
         value = []
         strValue = strValue.strip('[]')
         s = strValue.split(',')
         for i in range(len(s)):
             value.append(parseGlobalVars(s[i].strip("\" ")))
     return value
Example #2
0
 def valueFromStr(self, strValue):
     #
     if not self.isArray():
         value = parseGlobalVars(strValue)
     else:
         value = []
         strValue = strValue.strip("[]")
         s = strValue.split(",")
         for i in range(len(s)):
             value.append(parseGlobalVars(s[i].strip('" ')))
     return value
Example #3
0
	def getRangeValues ( self ) :
		#
		rangeList = []

		if self.range != '' : # and self.subtype == 'selector':
			tmp_list = str ( self.range ).split ( ':' )
			for s in tmp_list :
				pair = s.split ( '=' )
				if len ( pair ) > 1 :
					label = pair [0]
					value = pair [1]
				else :
					label = s
					value = s
				rangeList.append ( ( parseGlobalVars ( label ), parseGlobalVars ( value ) ) )
		return rangeList
Example #4
0
    def getRangeValues(self):
        #
        rangeList = []
        i = 0
        if self.range != "":
            #
            # get range for selector
            #
            if self.subtype == "selector":
                tmp_list = str(self.range).split(":")
                for s in tmp_list:
                    pair = s.split("=")
                    if len(pair) > 1:
                        label = pair[0]
                        value = int(pair[1])
                    else:
                        label = s
                        value = int(i)
                    i += 1
                    rangeList.append((parseGlobalVars(label), value))
                    #
                    # get range for slider
                    #
            elif self.subtype == "slider" or self.subtype == "vslider":
                tmp_list = str(self.range).split()
                for i in range(0, 3):
                    value = 0
                    if i < len(tmp_list):
                        value = int(tmp_list[i])
                    rangeList.append(value)

        return rangeList
Example #5
0
	def getRangeValues ( self ) :
		#
		rangeList = []
		i = 0
		if self.range != '' :
			#
			# get range for selector
			#
			if self.subtype == 'selector' :
				tmp_list = str ( self.range ).split ( ':' )
				for s in tmp_list :
					pair = s.split ( '=' )
					if len ( pair ) > 1 :
						label = pair [0]
						value = int ( pair [1] )
					else :
						label = s
						value = int ( i )
					i += 1
					rangeList.append ( ( parseGlobalVars ( label ), value ) )
			#
			# get range for slider
			#
			elif self.subtype == 'slider' or self.subtype == 'vslider' :
				tmp_list = str ( self.range ).split ()
				for i in range ( 0, 3 ) :
					value = 0
					if i < len ( tmp_list ) :
						value = int ( tmp_list [ i ] )
					rangeList.append ( value )

		return rangeList
Example #6
0
    def getRangeValues(self):
        #
        rangeList = []

        if self.range != '':  # and self.subtype == 'selector':
            tmp_list = str(self.range).split(':')
            for s in tmp_list:
                pair = s.split('=')
                if len(pair) > 1:
                    label = pair[0]
                    value = pair[1]
                else:
                    label = s
                    value = s
                rangeList.append(
                    (parseGlobalVars(label), parseGlobalVars(value)))
        return rangeList
Example #7
0
 def valueToStr(self, value):
     #
     if not self.isArray():
         strValue = parseGlobalVars(value)
         if not self.isRibParam:
             strValue = str('"' + value + '"')
     else:
         strValue = "{" + "".join('"%s"' % f + "," for f in value[:-1]) + '"%s"' % value[-1] + "}"
     return strValue
Example #8
0
 def valueToStr(self, value):
     #
     if not self.isArray():
         strValue = parseGlobalVars(value)
         if not self.isRibParam:
             strValue = str("\"" + value + "\"")
     else:
         strValue = '{' + ''.join(
             '"%s"' % f + ','
             for f in value[:-1]) + '"%s"' % value[-1] + '}'
     return strValue
Example #9
0
    def __init__(self, shaderFileName=None):
        #
        self.fileName = parseGlobalVars(shaderFileName)
        self.name = None
        self.type = None
        self.inputParams = []
        self.outputParams = []

        self.parseParamLineProc = self.parseParamLine
        self.parseValueLineProc = self.parseValueLine_prman

        parseParamLineProcTable = {
            "prman": self.parseParamLine,
            "renderdl": self.parseParamLine,
            "air": self.parseParamLine_air,
            "aqsis": self.parseParamLine,
            "rndr": self.parseParamLine_pixie,
            "renderdc": self.parseParamLine_pixie,
        }

        parseValueLineProcTable = {
            "prman": self.parseValueLine_prman,
            "renderdl": self.parseValueLine_delight,
            "air": self.parseValueLine_air,
            "aqsis": self.parseValueLine_aqsis,
            "rndr": self.parseValueLine_pixie,
            "renderdc": self.parseValueLine_prman,
        }

        self.renderer = app_global_vars["RendererName"]

        if self.renderer in parseParamLineProcTable.keys():
            self.parseParamLineProc = parseParamLineProcTable[self.renderer]
        if self.renderer in parseValueLineProcTable.keys():
            self.parseValueLineProc = parseValueLineProcTable[self.renderer]

        if self.fileName is not None:
            self.parseParamsInfo(self.getShaderInfo())
            if self.renderer == "rndr":
                # Pixie's sdrinfo outputs parameters in reverse order.
                # Hence, lets reverse them again
                self.inputParams.reverse()
                self.outputParams.reverse()
Example #10
0
    def __init__(self, shaderFileName=None):
        #
        self.fileName = parseGlobalVars(shaderFileName)
        self.name = None
        self.type = None
        self.inputParams = []
        self.outputParams = []

        self.parseParamLineProc = self.parseParamLine
        self.parseValueLineProc = self.parseValueLine_prman

        parseParamLineProcTable = {
            'prman': self.parseParamLine,
            'renderdl': self.parseParamLine,
            'air': self.parseParamLine_air,
            'aqsis': self.parseParamLine,
            'rndr': self.parseParamLine_pixie,
            'renderdc': self.parseParamLine_pixie
        }

        parseValueLineProcTable = {
            'prman': self.parseValueLine_prman,
            'renderdl': self.parseValueLine_delight,
            'air': self.parseValueLine_air,
            'aqsis': self.parseValueLine_aqsis,
            'rndr': self.parseValueLine_pixie,
            'renderdc': self.parseValueLine_prman
        }

        self.renderer = app_global_vars['RendererName']

        if self.renderer in parseParamLineProcTable.keys():
            self.parseParamLineProc = parseParamLineProcTable[self.renderer]
        if self.renderer in parseValueLineProcTable.keys():
            self.parseValueLineProc = parseValueLineProcTable[self.renderer]

        if self.fileName is not None:
            self.parseParamsInfo(self.getShaderInfo())
            if self.renderer == 'rndr':
                # Pixie's sdrinfo outputs parameters in reverse order.
                # Hence, lets reverse them again
                self.inputParams.reverse()
                self.outputParams.reverse()
Example #11
0
  def __init__ ( self, shaderFileName = None ) :
    #
    self.fileName = parseGlobalVars ( shaderFileName )
    self.name = None
    self.type = None
    self.inputParams = []
    self.outputParams = []

    self.parseParamLineProc = self.parseParamLine
    self.parseValueLineProc = self.parseValueLine_prman

    parseParamLineProcTable = {
       'prman'    : self.parseParamLine
      ,'renderdl' : self.parseParamLine
      ,'air'      : self.parseParamLine_air
      ,'aqsis'    : self.parseParamLine
      ,'rndr'     : self.parseParamLine_pixie
      ,'renderdc' : self.parseParamLine_pixie
    }
    
    parseValueLineProcTable = {
       'prman'    : self.parseValueLine_prman
      ,'renderdl' : self.parseValueLine_delight
      ,'air'      : self.parseValueLine_air
      ,'aqsis'    : self.parseValueLine_aqsis
      ,'rndr'     : self.parseValueLine_pixie
      ,'renderdc' : self.parseValueLine_prman
    }

    self.renderer = app_global_vars [ 'RendererName' ]
    
    if self.renderer in parseParamLineProcTable.keys () : self.parseParamLineProc = parseParamLineProcTable [ self.renderer ]
    if self.renderer in parseValueLineProcTable.keys () : self.parseValueLineProc = parseValueLineProcTable [ self.renderer ]

    if self.fileName is not None :
      self.parseParamsInfo ( self.getShaderInfo () )
      if self.renderer == 'rndr' :
        # Pixie's sdrinfo outputs parameters in reverse order.
        # Hence, lets reverse them again
        self.inputParams.reverse ()
        self.outputParams.reverse ()
Example #12
0
	def getRangeValues ( self ) :
		# if subtype == selector then return list of (label,value) pairs
		# It's supposed, that range is defined as "value1:value2:value3"
		# or "label1=value1:label2=value2:label3=value3:"
		#
		# if subtype == slider then return list [min, max, step] from
		# space separated string range="min max step"
		#
		rangeList = []
		i = 0
		if self.range != '' :
			#
			# get range for selector
			#
			if self.subtype == 'selector' :
				tmp_list = str ( self.range ).split ( ':' )
				for s in tmp_list :
					pair = s.split ( '=' )
					if len ( pair ) > 1 :
						label = pair [0]
						value = float ( pair [1] )
					else :
						label = s
						value = float ( i )
					i += 1
					rangeList.append ( ( parseGlobalVars ( label ), value ) )
			#
			# get range for slider
			#
			elif self.subtype == 'slider' or self.subtype == 'vslider' :
				tmp_list = str ( self.range ).split ()
				for i in range ( 0, 3 ) :
					value = 0.0
					if i < len ( tmp_list ) :
						value = float ( tmp_list[ i ] )
					rangeList.append ( value )

		return rangeList
Example #13
0
    def getRangeValues(self):
        # if subtype == selector then return list of (label,value) pairs
        # It's supposed, that range is defined as "value1:value2:value3"
        # or "label1=value1:label2=value2:label3=value3:"
        #
        # if subtype == slider then return list [min, max, step] from
        # space separated string range="min max step"
        #
        rangeList = []
        i = 0
        if self.range != '':
            #
            # get range for selector
            #
            if self.subtype == 'selector':
                tmp_list = str(self.range).split(':')
                for s in tmp_list:
                    pair = s.split('=')
                    if len(pair) > 1:
                        label = pair[0]
                        value = float(pair[1])
                    else:
                        label = s
                        value = float(i)
                    i += 1
                    rangeList.append((parseGlobalVars(label), value))
            #
            # get range for slider
            #
            elif self.subtype == 'slider' or self.subtype == 'vslider':
                tmp_list = str(self.range).split()
                for i in range(0, 3):
                    value = 0.0
                    if i < len(tmp_list):
                        value = float(tmp_list[i])
                    rangeList.append(value)

        return rangeList
Example #14
0
 def valueFromStr(self, strInput):
     return parseGlobalVars(strInput)
Example #15
0
 def valueToStr(self, value):
     #
     ret_str = parseGlobalVars(value)
     if not self.isRibParam:
         ret_str = str("\"" + value + "\"")
     return ret_str
Example #16
0
	def valueToStr ( self, value ) :
		#
		ret_str = parseGlobalVars ( value )
		if not self.isRibParam : 
			ret_str = str ( "\"" + value + "\"" )
		return ret_str
Example #17
0
	def valueFromStr ( self, strInput ) : return parseGlobalVars ( strInput )
	#
	# valueToStr
	#
	def valueToStr ( self, value ) :