# Path: mayaLib/rigLib/utils/util.py
# def unlock_and_unhide_all(node):
#     """
#     unlock and unhide all transform attributes of selected node
#     :param node: node to be affected
#     """
#     nodeList = pm.ls(node)
# 
#     for node in nodeList:
#         node.tx.set(l=0, k=1, cb=0)
#         node.ty.set(l=0, k=1, cb=0)
#         node.tz.set(l=0, k=1, cb=0)
#         node.rx.set(l=0, k=1, cb=0)
#         node.ry.set(l=0, k=1, cb=0)
#         node.rz.set(l=0, k=1, cb=0)
#         node.sx.set(l=0, k=1, cb=0)
#         node.sy.set(l=0, k=1, cb=0)
#         node.sz.set(l=0, k=1, cb=0)
# 
# def getAllObjectUnderGroup(group, type='mesh'):
#     """
#     Return all object of given type under group
#     :param group: str, group name
#     :param type: str, object type
#     :return: object list
#     """
#     objList = None
# 
#     if type == 'mesh':
#         objList = [pm.listRelatives(o, p=1)[0] for o in pm.listRelatives(group, ad=1, type=type)]
# 
#     if type == 'transform':
#         geoList = [pm.listRelatives(o, p=1)[0] for o in pm.listRelatives(group, ad=1, type='mesh')]
#         objList = [o for o in pm.listRelatives(group, ad=1, type=type) if o not in geoList]
# 
#     objList = list(set(objList))
#     objList.sort()
# 
#     return objList


import maya.mel as mel
import pymel.core as pm
from mayaLib.rigLib.utils.util import unlock_and_unhide_all, getAllObjectUnderGroup
            'polyCleanupArgList 4 { "0","2","0","0","0","0","0","0","1","1e-05","0","1e-05","0","1e-05","0","-1","0","0" };'))
    else:
        return pm.ls(mel.eval(
            'polyCleanupArgList 4 { "0","1","0","0","0","0","0","0","1","1e-05","0","1e-05","0","1e-05","0","-1","0","0" };'))


def removeFacesWithZeroMapArea(geo, query=True):
    pm.select(geo)
    if query:
        return pm.ls(mel.eval(
            'polyCleanupArgList 4 { "0","2","0","0","0","0","0","0","0","1e-05","0","1e-05","1","1e-05","0","-1","0","0" };'))
    else:
        return pm.ls(mel.eval(
            'polyCleanupArgList 4 { "0","1","0","0","0","0","0","0","0","1e-05","0","1e-05","1","1e-05","0","-1","0","0" };'))


def removeInvalidComponents(geo, query=True):
    pm.select(geo)
    if query:
        return pm.ls(mel.eval(
            'polyCleanupArgList 4 { "0","2","0","0","0","0","0","0","0","1e-05","0","1e-05","0","1e-05","0","-1","0","1" };'))
    else:
        return pm.ls(mel.eval(
            'polyCleanupArgList 4 { "0","1","0","0","0","0","0","0","0","1e-05","0","1e-05","0","1e-05","0","-1","0","1" };'))


class ModelFix():
    def __init__(self, geo, check=True):
        self.geo = pm.ls(geo)[0]


# Path: mayaLib/rigLib/utils/util.py
# def unlock_and_unhide_all(node):
#     """
#     unlock and unhide all transform attributes of selected node
#     :param node: node to be affected
#     """
#     nodeList = pm.ls(node)
# 
#     for node in nodeList:
#         node.tx.set(l=0, k=1, cb=0)
#         node.ty.set(l=0, k=1, cb=0)
#         node.tz.set(l=0, k=1, cb=0)
#         node.rx.set(l=0, k=1, cb=0)
#         node.ry.set(l=0, k=1, cb=0)
#         node.rz.set(l=0, k=1, cb=0)
#         node.sx.set(l=0, k=1, cb=0)
#         node.sy.set(l=0, k=1, cb=0)
#         node.sz.set(l=0, k=1, cb=0)
# 
# def getAllObjectUnderGroup(group, type='mesh'):
#     """
#     Return all object of given type under group
#     :param group: str, group name
#     :param type: str, object type
#     :return: object list
#     """
#     objList = None
# 
#     if type == 'mesh':
#         objList = [pm.listRelatives(o, p=1)[0] for o in pm.listRelatives(group, ad=1, type=type)]
# 
#     if type == 'transform':
#         geoList = [pm.listRelatives(o, p=1)[0] for o in pm.listRelatives(group, ad=1, type='mesh')]
#         objList = [o for o in pm.listRelatives(group, ad=1, type=type) if o not in geoList]
# 
#     objList = list(set(objList))
#     objList.sort()
# 
#     return objList


# Path: mayaLib/modelLib/base/modelIssueFix.py
import maya.mel as mel
import pymel.core as pm
from mayaLib.rigLib.utils.util import unlock_and_unhide_all, getAllObjectUnderGroup

            'polyCleanupArgList 4 { "0","2","0","0","0","0","0","0","1","1e-05","0","1e-05","0","1e-05","0","-1","0","0" };'))
    else:
        return pm.ls(mel.eval(
            'polyCleanupArgList 4 { "0","1","0","0","0","0","0","0","1","1e-05","0","1e-05","0","1e-05","0","-1","0","0" };'))


def removeFacesWithZeroMapArea(geo, query=True):
    pm.select(geo)
    if query:
        return pm.ls(mel.eval(
            'polyCleanupArgList 4 { "0","2","0","0","0","0","0","0","0","1e-05","0","1e-05","1","1e-05","0","-1","0","0" };'))
    else:
        return pm.ls(mel.eval(
            'polyCleanupArgList 4 { "0","1","0","0","0","0","0","0","0","1e-05","0","1e-05","1","1e-05","0","-1","0","0" };'))


def removeInvalidComponents(geo, query=True):
    pm.select(geo)
    if query:
        return pm.ls(mel.eval(
            'polyCleanupArgList 4 { "0","2","0","0","0","0","0","0","0","1e-05","0","1e-05","0","1e-05","0","-1","0","1" };'))
    else:
        return pm.ls(mel.eval(
            'polyCleanupArgList 4 { "0","1","0","0","0","0","0","0","0","1e-05","0","1e-05","0","1e-05","0","-1","0","1" };'))


class ModelFix():
    def __init__(self, geo, check=True):
        self.geo = pm.ls(geo)[0]


        unlock_and_unhide_all(self.geo)