# Path: mayaLib/shaderLib/utils/config.py

# 
# Path: mayaLib/shaderLib/utils/file.py
# class TextureFile():  # ToDo: move in util?
# class TextureFileManager():
#     def __init__(self, path, filename):
#     def _partition(self):
#     def get_channels(self):
#     def __init__(self, dirname=pm.workspace(q=True, dir=True, rd=True) + '/sourceimages/', ext='exr'):
#     def search_in_directory(self, dirname, ext):
#     def build_dict(self):
#     def get_path(self):


import pymel.core as pm
from mayaLib.shaderLib.utils import config
from mayaLib.shaderLib.utils import file
        pm.connectAttr('%s.noiseUV' % place_node, '%s.noiseUV' % file_node)
        pm.connectAttr('%s.vertexUvOne' % place_node, '%s.vertexUvOne' % file_node)
        pm.connectAttr('%s.vertexUvTwo' % place_node, '%s.vertexUvTwo' % file_node)
        pm.connectAttr('%s.vertexUvThree' % place_node, '%s.vertexUvThree' % file_node)
        pm.connectAttr('%s.vertexCameraOne' % place_node, '%s.vertexCameraOne' % file_node)
        pm.connectAttr('%s.outUV' % place_node, '%s.uv' % file_node)
        pm.connectAttr('%s.outUvFilterSize' % place_node, '%s.uvFilterSize' % file_node)

    def connect_file_node(self, path, name, single_place_node, gammaCorrect=True, alphaIsLuminance=True):
        """
        Connect place node to file node
        :param path:
        :param name:
        :param single_place_node:
        :param gammaCorrect:
        :param alphaIsLuminance:
        :return: File Node object
        """

        tex_name, texture_set, ext = name.split('.')

        # creation node
        file_node = pm.shadingNode("file", name=tex_name + '_tex', asTexture=True, isColorManaged=True)
        file_node.fileTextureName.set(path + '/' + name)

        # uvTilingMode -- UDIM -> 3
        if texture_set.isdigit():
            file_node.uvTilingMode.set(3)

        # alphaIsLuminance

# Path: mayaLib/shaderLib/utils/config.py

# 
# Path: mayaLib/shaderLib/utils/file.py
# class TextureFile():  # ToDo: move in util?
# class TextureFileManager():
#     def __init__(self, path, filename):
#     def _partition(self):
#     def get_channels(self):
#     def __init__(self, dirname=pm.workspace(q=True, dir=True, rd=True) + '/sourceimages/', ext='exr'):
#     def search_in_directory(self, dirname, ext):
#     def build_dict(self):
#     def get_path(self):


# Path: mayaLib/shaderLib/base/texture.py
import pymel.core as pm
from mayaLib.shaderLib.utils import config
from mayaLib.shaderLib.utils import file

        pm.connectAttr('%s.noiseUV' % place_node, '%s.noiseUV' % file_node)
        pm.connectAttr('%s.vertexUvOne' % place_node, '%s.vertexUvOne' % file_node)
        pm.connectAttr('%s.vertexUvTwo' % place_node, '%s.vertexUvTwo' % file_node)
        pm.connectAttr('%s.vertexUvThree' % place_node, '%s.vertexUvThree' % file_node)
        pm.connectAttr('%s.vertexCameraOne' % place_node, '%s.vertexCameraOne' % file_node)
        pm.connectAttr('%s.outUV' % place_node, '%s.uv' % file_node)
        pm.connectAttr('%s.outUvFilterSize' % place_node, '%s.uvFilterSize' % file_node)

    def connect_file_node(self, path, name, single_place_node, gammaCorrect=True, alphaIsLuminance=True):
        """
        Connect place node to file node
        :param path:
        :param name:
        :param single_place_node:
        :param gammaCorrect:
        :param alphaIsLuminance:
        :return: File Node object
        """

        tex_name, texture_set, ext = name.split('.')

        # creation node
        file_node = pm.shadingNode("file", name=tex_name + '_tex', asTexture=True, isColorManaged=True)
        file_node.fileTextureName.set(path + '/' + name)

        # uvTilingMode -- UDIM -> 3
        if texture_set.isdigit():
            file_node.uvTilingMode.set(3)

        # alphaIsLuminance

        if (self.texture_recongition.channel == config.backlight