Пример #1
0
    def __init__(self):
        OpenMayaMPx.MPxNode.__init__(self)

        # Export attributes
        self.attributes = {}
        self.GirlType = "shinymetal"
        self.attributes['Kr'] = ShaderColorAttribute('shinymetalKr')
        self.attributes['Ks'] = ShaderColorAttribute('shinymetalKs')
        self.attributes['uroughness'] = ShaderFloatAttribute(
            'shinymetalURoughness', reciprocal=True)
        self.attributes['vroughness'] = ShaderFloatAttribute(
            'shinymetalVRoughness', reciprocal=True)
Пример #2
0
    def __init__(self):
        OpenMayaMPx.MPxNode.__init__(self)

        # Export attributes
        self.attributes = {}
        self.GirlType = "substrate"
        self.attributes['Kd'] = ShaderColorAttribute('substrateKd')
        self.attributes['Ks'] = ShaderColorAttribute('substrateKs')
        self.attributes['uroughness'] = ShaderFloatAttribute(
            'substrateURoughness', reciprocal=True)
        self.attributes['vroughness'] = ShaderFloatAttribute(
            'substrateVRoughness', reciprocal=True)
Пример #3
0
    def __init__(self):
        OpenMayaMPx.MPxNode.__init__(self)

        # Export attributes
        self.attributes = {}
        self.GirlType = "roughglass"
        self.attributes['Kr']         = ShaderColorAttribute('roughglassKr')
        self.attributes['Kt']         = ShaderColorAttribute('roughglassKt')
        self.attributes['uroughness'] = ShaderFloatAttribute('roughglassURoughness', reciprocal = True)
        self.attributes['vroughness'] = ShaderFloatAttribute('roughglassVRoughness', reciprocal = True)
        self.attributes['index']      = ShaderFloatAttribute('roughglassIndex')
        self.attributes['cauchyb']    = ShaderFloatAttribute('roughglassCauchyB')
Пример #4
0
    def __init__(self):
        OpenMayaMPx.MPxNode.__init__(self)

        # Export attributes
        self.attributes = {}
        self.GirlType = "plastic"
        self.attributes['Kd'] = ShaderColorAttribute('plasticKd')
        self.attributes['Ks'] = ShaderColorAttribute('plasticKs')
        self.attributes['uroughness'] = ShaderFloatAttribute(
            'plasticURoughness', reciprocal=True)
        self.attributes['vroughness'] = ShaderFloatAttribute(
            'plasticVRoughness', reciprocal=True)
Пример #5
0
    def __init__(self):
        OpenMayaMPx.MPxNode.__init__(self)

        # Export attributes
        self.attributes = {}
        self.GirlType = "MerlBRDF"
        self.attributes['MerlBRDFName'] = ShaderEnumAttribute('mBrdfNames', self.mBrdfNameValues)
        self.attributes['Material'] = ShaderEnumAttribute('mBrdfMaterialNames', self.mBrdfMaterialNameValues)
        self.attributes['MaterialSub'] = ShaderEnumAttribute('mBrdfMaterialSubNames', self.mBrdfMaterialSubNameValues)
        self.attributes['reflection'] = ShaderStringHideAttribute('reflection', 'all')
        self.attributes['cr'] = ShaderFloatAttribute('cr')
        self.attributes['cg'] = ShaderFloatAttribute('cg')
        self.attributes['cb'] = ShaderFloatAttribute('cb')
Пример #6
0
    def __init__(self):
        OpenMayaMPx.MPxNode.__init__(self)

        # Export attributes
        self.attributes = {}
        self.GirlType = "metal"
        self.attributes['name'] = ShaderEnumAttribute('metalName',
                                                      self.nameValues)
        #self.attributes['n']            = ShaderColorAttribute('metalN')
        #self.attributes['k']            = ShaderColorAttribute('metalK')
        self.attributes['uroughness'] = ShaderFloatAttribute('metalURoughness',
                                                             reciprocal=True)
        self.attributes['vroughness'] = ShaderFloatAttribute('metalVRoughness',
                                                             reciprocal=True)
Пример #7
0
    def __init__(self):
        """
        blinnShader constructor. Calls the parent OpenMayaMPx.MPxNode constructor
        and defines the Maya attribute -> Girl material parameter mapping.
        """
        
        OpenMayaMPx.MPxNode.__init__(self)

        # translation table for shader
        self.attributes = {}
        self.GirlType = "substrate"
        self.attributes['Ks']         = ShaderColorAttribute('specularColor')
        self.attributes['Kd']         = ShaderColorAttribute('color')
        self.attributes['uroughness'] = ShaderFloatAttribute('eccentricity', reciprocal = True)
        self.attributes['vroughness'] = ShaderFloatAttribute('specularRollOff', reciprocal = True)
         
Пример #8
0
    def __init__(self):
        """
        phongShader constructor. Calls the parent OpenMayaMPx.MPxNode constructor
        and defines the Maya attribute -> Girl material parameter mapping.
        """
        
        OpenMayaMPx.MPxNode.__init__(self)

        # translation table for shader
        self.attributes = {}
        self.GirlType = "plastic"
        self.attributes['Kd']         = ShaderColorAttribute('color')
        self.attributes['Ks']         = ShaderColorAttribute('specularColor')
        self.attributes['uroughness'] = ShaderFloatAttribute('cosinePower', preScale = 0.01, invert=True, reciprocal = True, postScale = 0.1)
        self.attributes['vroughness'] = ShaderFloatAttribute('cosinePower', preScale = 0.01, invert=True, reciprocal = True, postScale = 0.1)
         
Пример #9
0
    def __init__(self):
        OpenMayaMPx.MPxNode.__init__(self)

        # Export attributes
        self.attributes = {}
        self.GirlType = "matte"
        self.attributes['Kd'] = ShaderColorAttribute('matteKd')
        self.attributes['sigma'] = ShaderFloatAttribute('matteSigma')
Пример #10
0
    def __init__(self):
        """
        lambertShader constructor. Calls the parent OpenMayaMPx.MPxNode constructor
        and defines the Maya attribute -> Girl material parameter mapping.
        """

        OpenMayaMPx.MPxNode.__init__(self)

        # translation table for shader
        self.attributes = {}
        self.GirlType = "GirlUseBackground"
        self.attributes['specularColor'] = ShaderColorAttribute(
            'specularColor')
        self.attributes['reflectionLimit'] = ShaderFloatAttribute(
            'reflectionLimit')
        self.attributes['reflectivity'] = ShaderFloatAttribute('reflectivity')

        self.attributes['matteOpacityMode'] = ShaderEnumAttribute(
            'matteOpacityMode', self.strrMatteOpacityMode)
        self.attributes['matteOpacity'] = ShaderFloatAttribute('matteOpacity')
Пример #11
0
    def __init__(self):
        """
        lambertShader constructor. Calls the parent OpenMayaMPx.MPxNode constructor
        and defines the Maya attribute -> Girl material parameter mapping.
        """

        OpenMayaMPx.MPxNode.__init__(self)

        # translation table for shader
        self.attributes = {}
        self.GirlType = "matte"
        self.attributes['Kd'] = ShaderColorAttribute('color')
        self.attributes['sigma'] = ShaderFloatAttribute('translucence')
Пример #12
0
    def __init__(self):
        OpenMayaMPx.MPxNode.__init__(self)

        # mix
        namedMaterial1 = OpenMaya.MObject()  # color
        namedMaterial2 = OpenMaya.MObject()  # color
        amount = OpenMaya.MObject()  # float

        # Export attributes
        self.attributes = {}
        self.GirlType = "mix"
        #self.attributes['namedmaterial1'] = ShaderColorAttribute('mixMat1')
        #self.attributes['namedmaterial2'] = ShaderColorAttribute('mixMat2')
        self.attributes['amount'] = ShaderFloatAttribute('mixAmount')
Пример #13
0
    def getMaterial(self, shaderNode, shaderName ):
        self.attributes['bumpmap'] = ShaderFloatAttribute('normalCamera')
        
               
        for attr in self.attributes:
            if (
                isinstance( self.attributes[attr], ShaderColorAttribute )
             or isinstance( self.attributes[attr], ShaderFloatAttribute )
                ):

                if (attr != 'cr' and attr != 'cg' and attr != 'cb') :
			self.addToOutput( self.attributes[attr].getOutput( attr, shaderNode, shaderName ) )

        self.addToOutput( 'MakeNamedMaterial "%s"' % shaderName )
        #self.addToOutput( '\t"string type" ["%s"]' % self.GirlType )
	strMetName = self.attributes['Material'].getStringValue( 'Material', shaderNode, shaderName )
	
	if ( strMetName == 'MerlBRDF' or strMetName == 'MerlBRDFFit' ):
		self.addToOutput( '\t"string type" ["%s"]' % strMetName )
	else:
		self.addToOutput( '\t"string type" ["%s"]' % self.attributes['MaterialSub'].getStringValue( 'MerlBRDFName', shaderNode, shaderName ) )

        self.addToOutput( '\t"string merltype" ["%s"]' % self.attributes['MerlBRDFName'].getStringValue( 'MerlBRDFName', shaderNode, shaderName ) )
	self.addToOutput( '\t"string reflection" ["all"]')
        
        fcr = self.attributes['cr'].getFloatValue( shaderNode, shaderName )
        fcg = self.attributes['cg'].getFloatValue( shaderNode, shaderName )
        fcb = self.attributes['cb'].getFloatValue( shaderNode, shaderName )

	self.addToOutput( '\t"float r" [%f]' % fcr )
	self.addToOutput( '\t"float g" [%f]' % fcg )
	self.addToOutput( '\t"float b" [%f]' % fcb )

        for attr in self.attributes:
            if  (
                    isinstance( self.attributes[attr], ShaderColorAttribute )
                 or isinstance( self.attributes[attr], ShaderFloatAttribute )
                    ):
                if (attr != 'cr' and attr != 'cg' and attr != 'cb') :
			if self.attributes[attr].exportName == '':
			    self.addToOutput( '\t"texture %s" ["%s.%s"]' % (attr, shaderName, attr) )
			else:
			    self.addToOutput( '\t"texture %s" ["%s"]' % (attr, self.attributes[attr].exportName) )

        self.addToOutput( '' )
        return self.outputString
Пример #14
0
    def __init__(self):
        """
        lambertShader constructor. Calls the parent OpenMayaMPx.MPxNode constructor
        and defines the Maya attribute -> Girl material parameter mapping.
        """

        OpenMayaMPx.MPxNode.__init__(self)

        # translation table for shader
        self.attributes = {}
        self.GirlType = "GirlLayeredShader"
        self.attributes['matteOpacityMode'] = ShaderEnumAttribute(
            'matteOpacityMode', self.strrMatteOpacityMode)
        self.attributes['matteOpacity'] = ShaderFloatAttribute('matteOpacity')

        self.attributes['hardwareColor'] = ShaderColorAttribute(
            'hardwareColor')
        self.attributes['compositingFlag'] = ShaderEnumAttribute(
            'compositingFlag', self.strrCompositingFlag)
Пример #15
0
    def __init__(self):
        """
        lambertShader constructor. Calls the parent OpenMayaMPx.MPxNode constructor
        and defines the Maya attribute -> Girl material parameter mapping.
        """

        OpenMayaMPx.MPxNode.__init__(self)

        # translation table for shader
        self.attributes = {}
        self.GirlType = "GirlSurfaceShader"

        self.attributes['outColor'] = ShaderColorAttribute('outColor')
        self.attributes['outTransparency'] = ShaderColorAttribute(
            'outTransparency')
        self.attributes['outGlowColor'] = ShaderColorAttribute('outGlowColor')
        self.attributes['outMatteOpacity'] = ShaderColorAttribute(
            'outMatteOpacity')

        self.attributes['materialAlphaGain'] = ShaderFloatAttribute(
            'materialAlphaGain')
Пример #16
0
    def __init__(self):
        OpenMayaMPx.MPxNode.__init__(self)

        # Export attributes
        self.attributes = {}
        self.GirlType = "carpaint"
        self.attributes['name'] = ShaderEnumAttribute('carpaintName',
                                                      self.nameValues)
        self.attributes['Kd'] = ShaderColorAttribute('carpaintKd')
        self.attributes['Ks1'] = ShaderColorAttribute('carpaintKs1')
        self.attributes['Ks2'] = ShaderColorAttribute('carpaintKs2')
        self.attributes['Ks3'] = ShaderColorAttribute('carpaintKs3')
        self.attributes['R1'] = ShaderFloatAttribute('carpaintR1')
        self.attributes['R2'] = ShaderFloatAttribute('carpaintR2')
        self.attributes['R3'] = ShaderFloatAttribute('carpaintR3')
        self.attributes['M1'] = ShaderFloatAttribute('carpaintM1')
        self.attributes['M2'] = ShaderFloatAttribute('carpaintM2')
        self.attributes['M3'] = ShaderFloatAttribute('carpaintM3')
Пример #17
0
    def __init__(self):
        """
        lambertShader constructor. Calls the parent OpenMayaMPx.MPxNode constructor
        and defines the Maya attribute -> Girl material parameter mapping.
        """

        OpenMayaMPx.MPxNode.__init__(self)

        # translation table for shader
        self.attributes = {}
        self.GirlType = "GirlAnisotropic"
        self.attributes['color'] = ShaderColorAttribute('color')
        self.attributes['transparency'] = ShaderColorAttribute('transparency')
        self.attributes['ambientColor'] = ShaderColorAttribute('ambientColor')
        self.attributes['incandescence'] = ShaderColorAttribute(
            'incandescence')

        self.attributes['diffuse'] = ShaderFloatAttribute('diffuse')
        self.attributes['translucence'] = ShaderFloatAttribute('translucence')
        self.attributes['translucenceDepth'] = ShaderFloatAttribute(
            'translucenceDepth')
        self.attributes['translucenceFocus'] = ShaderFloatAttribute(
            'translucenceFocus')

        self.attributes['glowIntensity'] = ShaderFloatAttribute(
            'glowIntensity')

        self.attributes['matteOpacityMode'] = ShaderEnumAttribute(
            'matteOpacityMode', self.strrMatteOpacityMode)
        self.attributes['matteOpacity'] = ShaderFloatAttribute('matteOpacity')

        self.attributes['refractions'] = ShaderBoolAttribute('refractions')
        self.attributes['chromaticAberration'] = ShaderBoolAttribute(
            'chromaticAberration')
        self.attributes['hideSource'] = ShaderBoolAttribute('hideSource')

        self.attributes['refractiveIndex'] = ShaderFloatAttribute(
            'refractiveIndex')
        self.attributes['refractionLimit'] = ShaderFloatAttribute(
            'refractionLimit')
        self.attributes['lightAbsorbance'] = ShaderFloatAttribute(
            'lightAbsorbance')
        self.attributes['surfaceThickness'] = ShaderFloatAttribute(
            'surfaceThickness')
        self.attributes['shadowAttenuation'] = ShaderFloatAttribute(
            'shadowAttenuation')

        self.attributes['angle'] = ShaderFloatAttribute('angle')
        self.attributes['spreadX'] = ShaderFloatAttribute('spreadX')
        self.attributes['spreadY'] = ShaderFloatAttribute('spreadY')
        self.attributes['roughness'] = ShaderFloatAttribute('roughness')
        self.attributes['fresnelRefractiveIndex'] = ShaderFloatAttribute(
            'fresnelRefractiveIndex')

        self.attributes['anisotropicReflectivity'] = ShaderBoolAttribute(
            'anisotropicReflectivity')