def __init__(self): OpenMayaMPx.MPxNode.__init__(self) # Export attributes self.attributes = {} self.luxType = "mattetranslucent" self.attributes['Kr'] = ShaderColorAttribute('mattetranslucentKr') self.attributes['Kt'] = ShaderColorAttribute('mattetranslucentKt') self.attributes['sigma'] = ShaderFloatAttribute( 'mattetranslucentSigma')
def __init__(self): OpenMayaMPx.MPxNode.__init__(self) # Export attributes self.attributes = {} self.luxType = "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)
def __init__(self): OpenMayaMPx.MPxNode.__init__(self) # Export attributes self.attributes = {} self.luxType = "glass" self.attributes['Kr'] = ShaderColorAttribute('glassKr') self.attributes['Kt'] = ShaderColorAttribute('glassKt') self.attributes['index'] = ShaderFloatAttribute('glassIndex') self.attributes['cauchyb'] = ShaderFloatAttribute('glassCauchyB') self.attributes['architectural'] = ShaderBoolAttribute( 'glassArchitectural')
def __init__(self): OpenMayaMPx.MPxNode.__init__(self) # Export attributes self.attributes = {} self.luxType = "glossy" self.attributes['Kd'] = ShaderColorAttribute('glossyKd') self.attributes['Ks'] = ShaderColorAttribute('glossyKs') self.attributes['uroughness'] = ShaderFloatAttribute( 'glossyURoughness', reciprocal=True) self.attributes['vroughness'] = ShaderFloatAttribute( 'glossyVRoughness', reciprocal=True)
def __init__(self): OpenMayaMPx.MPxNode.__init__(self) # Export attributes self.attributes = {} self.luxType = "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')
def __init__(self): OpenMayaMPx.MPxNode.__init__(self) # Export attributes self.attributes = {} self.luxType = "matte" self.attributes['Kd'] = ShaderColorAttribute('matteKd') self.attributes['sigma'] = ShaderFloatAttribute('matteSigma')
def __init__(self): OpenMayaMPx.MPxNode.__init__(self) # mirror kr = OpenMaya.MObject() # color # Export attributes self.attributes = {} self.luxType = "mirror" self.attributes['Kr'] = ShaderColorAttribute('mirrorKr')
def __init__(self): """ lambertShader constructor. Calls the parent OpenMayaMPx.MPxNode constructor and defines the Maya attribute -> lux material parameter mapping. """ OpenMayaMPx.MPxNode.__init__(self) # translation table for shader self.attributes = {} self.luxType = "matte" self.attributes['Kd'] = ShaderColorAttribute('color') self.attributes['sigma'] = ShaderFloatAttribute('translucence')
def __init__(self): """ phongShader constructor. Calls the parent OpenMayaMPx.MPxNode constructor and defines the Maya attribute -> lux material parameter mapping. """ OpenMayaMPx.MPxNode.__init__(self) # translation table for shader self.attributes = {} self.luxType = "glossy" 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)
def getAreaLight(self, shaderNode): """ Return AreaLightSource syntax with this class' shaderNode's attributes """ from Lux.LuxNodes.LuxNode import ShaderColorAttribute colour_input = ShaderColorAttribute('arealightL') cOutStr = colour_input.getOutput('L', shaderNode, shaderNode.name()) gainPlug = shaderNode.findPlug("arealightGain") gain = gainPlug.asFloat() nsPlug = shaderNode.findPlug("arealightNumsamples") numSamples = nsPlug.asInt() lgPlug = shaderNode.findPlug("arealightGroup") lightGroup = lgPlug.asString() outStr = ( '\tLightGroup "%s"' % lightGroup ) + os.linesep outStr += ( '\tAreaLightSource "area"' ) + os.linesep outStr += ( '\t\t"integer nsamples" [%i]' % numSamples ) + os.linesep if colour_input.inputFound: outStr = '\t' + cOutStr + outStr outStr += ( '\t\t"texture L" ["%s"]' % (colour_input.exportName) ) + os.linesep else: colorPlug = shaderNode.findPlug("arealightLR") colorR = self.rgcAndClamp( colorPlug.asFloat() ) colorPlug = shaderNode.findPlug("arealightLG") colorG = self.rgcAndClamp( colorPlug.asFloat() ) colorPlug = shaderNode.findPlug("arealightLB") colorB = self.rgcAndClamp( colorPlug.asFloat() ) outStr += ('\t\t"color L" [%f %f %f]' % (colorR, colorG, colorB)) + os.linesep outStr += ( '\t\t"float gain" [%f]' % gain ) + os.linesep return outStr