Ejemplo n.º 1
0
    def export(self, inputTransform, targetDirectory, displayReport=True):
        """
            Collect skin settings form a transform name.
            (specifically from its shape).

            args:
                inputTransform(string):Name of the transform with a shape deformed by a skincluster.

                targetDirectory(string):directory path for the exported data.

            kwargs:
                displayReport(bool). print time need to evaluate this operation.

            returns:
                (SkinSettings)
        """
        self.timeProcessing.report = ''

        self.timeProcessing.processObjectCount = 0

        validationUtils = validation.SkinValidator()
        inputSkinNodes = validationUtils.getSkinHistory(inputTransform)

        if len(inputSkinNodes) == 0:
            return None

        skinSettings = None

        skinSettings = settings.SkinSettings(inputSkinNodes[0])
        skinSettings.shape = maya.cmds.listRelatives(inputTransform,
                                                     s=True,
                                                     fullPath=True)[0]

        return skinSettings
Ejemplo n.º 2
0
    def getSkinNodeArray(self, objectArray):
        """
            Validate skinclusters influencing a list of transform
            (specifically their shapes). 

            args:
                objectArray(list of transform names influenced by a skincluster).
        """
        self.skinNodeArray = []

        for inputTransform in objectArray:
            validationUtils = validation.SkinValidator()
            inputSkinNodes = validationUtils.getSkinHistory(inputTransform)

            if len(inputSkinNodes) == 0:
                continue

            self.skinNodeArray.append(inputSkinNodes[0])
Ejemplo n.º 3
0
    def processWeights(self, unpackDirectory):
        self.validationUtils = validation.SkinValidator()

        self.validationUtils.rootNameSpace = maya.cmds.namespaceInfo(
            currentNamespace=True)

        self.validationUtils.namespacePrefix = self.WEIGHT_NAMESPACE

        self.skinNodeArray = []

        for skinSettings in self.jsonArray:
            self.validationUtils.processInputSetting(skinSettings)

            if self.validationUtils.isInvalid:
                continue

            self.batchProcessing.processObjectCount += 1

            self.skinNodeArray.append(skinSettings.deformerName)