#NEWLINE# def createSurfaceShader( shadertype , name = None ) : #NEWLINE# #INDENT# '\n    create a shader and shading group\n\n\n    ' #NEWLINE# classification = _general . getClassification ( shadertype ) #NEWLINE# newShader = None #NEWLINE# import nodetypes #NEWLINE# if ( 'rendernode/mentalray/material' in classification ) : #NEWLINE# #INDENT# newShader = nodetypes . DependNode ( _language . mel . mrCreateCustomNode ( '-asShader' , '' , newShader ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# newShader = nodetypes . DependNode ( _language . mel . renderCreateNode ( '-asShader' , 'surfaceShader' , shadertype , '' , 0 , 0 , 0 , 1 , 0 , '' ) ) #NEWLINE# #UNINDENT# sg = newShader . shadingGroups ( ) [ 0 ] #NEWLINE# if name : #NEWLINE# #INDENT# newShader = newShader . rename ( name ) #NEWLINE# sg = sg . rename ( ( name + 'SG' ) ) #NEWLINE# #UNINDENT# return ( newShader , sg )