@classmethod
    def create_eye_shader_and_controls(cls):
        eyes = pm.ls(sl=1)
        if not eyes:
            return

        char = eyes[0].getAllParents()[-1]
        place = pm.shadingNode('place2dTexture', asUtility=1)
        emission_image = pm.shadingNode('aiImage', asTexture=1)
        ks_image = pm.shadingNode('aiImage', asTexture=1)

        texture_paths = {
            'emission': '$REPO1977/KKS/Assets/Characters/Body_Parts/Textures/'
                'char_eyeInner_light_v001.png',
            'Ks': '$REPO1977/KKS/Assets/Characters/Body_Parts/Textures/'
                'char_eyeInner_spec_v002.png',
        }

        emission_image.setAttr('filename', texture_paths['emission'])
        ks_image.setAttr('filename', texture_paths['Ks'])

        place.outUV >> emission_image.attr('uvcoords')

        if not char.hasAttr('eyeLightStrength'):
            char.addAttr('eyeLightStrength', at='double', min=0, dv=0.0, k=1)
        else:
            # set the default
            char.attr('eyeLightStrength').set(0)

        if not char.hasAttr('eyeLightAngle'):
            char.addAttr("eyeLightAngle", at='double', dv=0, k=1)

        if not char.hasAttr('eyeDiffuseWeight'):
            char.addAttr(
                "eyeDiffuseWeight", at='double', dv=0.15, k=1, min=0, max=1
            )

        if not char.hasAttr('eyeSpecularWeight'):
            char.addAttr(
                'eyeSpecularWeight', at='double', dv=1.0, k=1, min=0, max=1
            )

        if not char.hasAttr('eyeSSSWeight'):
            char.addAttr(
                'eyeSSSWeight', at='double', dv=0.5, k=1, min=0, max=1
            )

        # connect eye light strength
        char.eyeLightStrength >> emission_image.attr('multiplyR')
        char.eyeLightStrength >> emission_image.attr('multiplyG')
        char.eyeLightStrength >> emission_image.attr('multiplyB')

        # connect eye light angle
        char.eyeLightAngle >> place.attr('rotateFrame')

        # connect specular weight
        char.eyeSpecularWeight >> ks_image.attr('multiplyR')
        char.eyeSpecularWeight >> ks_image.attr('multiplyG')
        char.eyeSpecularWeight >> ks_image.attr('multiplyB')

        for eye in eyes:
            shading_engine = eye.getShape().outputs()[0]
            shader = pm.ls(shading_engine.inputs(), mat=1)[0]

            # connect the diffuse shader input to the emissionColor
            diffuse_texture = shader.attr('color').inputs(p=1, s=1)[0]
            diffuse_texture >> shader.attr('emissionColor')
            emission_image.outColorR >> shader.attr('emission')

            # also connect it to specular color
            diffuse_texture >> shader.attr('KsColor')
            # connect the Ks image to the specular weight
            ks_image.outColorR >> shader.attr('Ks')

            # also connect it to sss color
            diffuse_texture >> shader.attr('KsssColor')

            char.eyeDiffuseWeight >> shader.attr('Kd')
            char.eyeSSSWeight >> shader.attr('Ksss')

            # set some default values
            shader.attr('diffuseRoughness').set(0)
            shader.attr('Kb').set(0)
            shader.attr('directDiffuse').set(1)
            shader.attr('indirectDiffuse').set(1)
            shader.attr('specularRoughness').set(0.4)
            shader.attr('specularAnisotropy').set(0.5)
            shader.attr('specularRotation').set(0)
            shader.attr('specularFresnel').set(0)
            shader.attr('Kr').set(0)
            shader.attr('enableInternalReflections').set(0)
            shader.attr('Kt').set(0)
            shader.attr('transmittance').set([1, 1, 1])
            shader.attr('opacity').set([1, 1, 1])
            shader.attr('sssRadius').set([1, 1, 1])

        pm.select(eyes)
This is pretty much specific to the way we are creating eye shaders
dataset/ETHPy150Open eoyilmaz/anima/anima/env/mayaEnv/toolbox.py/Render.create_eye_shader_and_controls