def __init__(self): self.timeProcessing = context.TimeProcessor() self.reporter = validation.SkinReport() self.skinProcessor = None self.skinHandler = 'alembicIO' self.reportArray = [] self.processingTime = 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)
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 = {}
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
def __init__(self): self.timeProcessing = context.TimeProcessor()