Exemplo n.º 1
0
    def __init__(self):
        self.timeProcessing = context.TimeProcessor()

        self.reporter = validation.SkinReport()

        self.skinProcessor = None

        self.skinHandler = 'alembicIO'

        self.reportArray = []

        self.processingTime = 0
Exemplo n.º 2
0
    def __init__(self):
        self.timeProcessing = context.TimeProcessor()

        self.batchProcessing = context.TimeProcessor()

        self.processingTime = 0

        self.reportArray = []

        self.reporter = validation.SkinReport()

        self.skinNodeArray = []

        self.sceneWeights = []

        self.jsonArray = []

        self.skinMetadata = {}

        self.validationUtils = None

        self.mayaFileType = "mayaAscii"

        self.injectionSettings = settings.InjectionSettings(None, False)
Exemplo n.º 3
0
    def resetManager(self, showProgressbar, objectCount, exposeWeightDetails):
        """
            Reset Instance properties and utilities functions.

            args:
                showProgressbar(bool).

                objectCount(int): (used to defined progressbar range)

                exposeWeightDetails(bool): allows time and additional report at the and of computation.
        """
        self.batchProcessing = context.TimeProcessor()
        self.batchProcessing.displayProgressbar = showProgressbar

        self.batchProcessing.progressbarRange = objectCount
        self.batchProcessing.displayReport = exposeWeightDetails

        self.batchProcessing.report = '\n<@{0}: Batch Processing report :>'.format(
            self.__class__.__name__)

        self.sceneWeights = []

        self.skinMetadata = {}
Exemplo n.º 4
0
    def processInputSetting(self, skinSettings):
        self.isInvalid = False

        self.rebuildTime = 0

        self.skinWasrebuilt = False

        canFindShapeInScene = self.validateGeometries(skinSettings.shape)

        if canFindShapeInScene is False:
            report = 'Unable to find shape {}'.format(skinSettings.shape)
            maya.OpenMaya.MGlobal.displayWarning(report)

            self.isInvalid = True
            return

        jointReport = self.validateInfluences(skinSettings.influences)

        if jointReport.canFindAllJoints is False:
            for joint in jointReport.missingJoints:
                report = 'Unable to find Influence {}'.format(jointReport)
                maya.OpenMaya.MGlobal.displayWarning(report)

            self.isInvalid = True
            return

        isSkinClusterDeformingCurrentShape = self.validateSkin(
            skinSettings.deformerName, skinSettings.shape)

        if isSkinClusterDeformingCurrentShape is None:
            processing = context.TimeProcessor()
            processing.displayProgressbar = False
            processing.displayReport = False

            with processing:
                maya.cmds.namespace(setNamespace=self.rootNameSpace)

                skinSettings.deformerName = self.rebuildSkinCluster(
                    skinSettings)

                maya.cmds.namespace(setNamespace=self.namespacePrefix)

            self.rebuildTime = float(processing.timeRange)

            self.skinWasrebuilt = True

            return

        if isSkinClusterDeformingCurrentShape is False:
            report = 'Please insure {skin} actually deforms {shape}'

            report = report.format(skin=skinSettings.deformerName,
                                   shape=skinSettings.shape)

            maya.OpenMaya.MGlobal.displayWarning(report)

            self.isInvalid = True
            return

        needsSkinClusterRebuilding = self.synchronizeDeformer(
            skinSettings.deformerName, skinSettings.influences)

        if needsSkinClusterRebuilding is True:
            processing = context.TimeProcessor()
            processing.displayProgressbar = False
            processing.displayReport = False

            with processing:
                maya.cmds.namespace(setNamespace=self.rootNameSpace)

                skinSettings.deformerName = self.rebuildSkinCluster(
                    skinSettings)

                maya.cmds.namespace(setNamespace=self.namespacePrefix)

            self.rebuildTime = float(processing.timeRange)

            self.skinWasrebuilt = True
Exemplo n.º 5
0
 def __init__(self):
     self.timeProcessing = context.TimeProcessor()