Beispiel #1
0
    def setWeightsForLattice(self, influence, weightList):
        '''
        method for setting skinWeight value for lattice points
        input MDagPath (influence)
        input python float list (weightList) 
        '''

        latticePntSelection = GenAPI.getLatticePoints(self.shapePath)
        selectionItr = om.MItSelectionList(latticePntSelection)

        index = self.skinclusterFn.indexForInfluenceObject(influence)

        oldValues = om.MFloatArray()

        mdagPath = om.MDagPath()
        component = om.MObject()

        itrIndex = 0

        while not selectionItr.isDone():

            selectionItr.getDagPath(mdagPath, component)

            self.skinclusterFn.setWeights(self.shapePath, component, index,
                                          weightList[itrIndex], True,
                                          oldValues)

            itrIndex += 1
            selectionItr.next()
Beispiel #2
0
    def setWeightsForLattice(self,influence,weightList):
        
        '''
        method for setting skinWeight value for lattice points
        input MDagPath (influence)
        input python float list (weightList) 
        '''

        latticePntSelection = GenAPI.getLatticePoints(self.shapePath)
        selectionItr = om.MItSelectionList(latticePntSelection) 
        
        index = self.skinclusterFn.indexForInfluenceObject(influence)
        
        oldValues = om.MFloatArray()
        
        mdagPath = om.MDagPath()
        component = om.MObject()
        
        itrIndex = 0
        
        while not selectionItr.isDone():
            
            selectionItr.getDagPath(mdagPath,component)

            self.skinclusterFn.setWeights(self.shapePath,component,index,weightList[itrIndex],True,oldValues)
            
            itrIndex += 1 
            selectionItr.next()
Beispiel #3
0
    def getWeightsFromLattice(self, influence):
        '''
        method for returning weightlist of given influence from a lattice
        input MDagPath (influence) 
        output python list (weights)  
        '''

        weightList = []

        latticePntSelection = GenAPI.getLatticePoints(self.shapePath)
        selectionItr = om.MItSelectionList(latticePntSelection)

        index = self.skinclusterFn.indexForInfluenceObject(influence)
        weights = om.MFloatArray()

        intArray = om.MIntArray()
        intArray.append(index)

        mdagPath = om.MDagPath()
        component = om.MObject()

        while not selectionItr.isDone():

            selectionItr.getDagPath(mdagPath, component)

            self.skinclusterFn.getWeights(self.shapePath, component, index,
                                          weights)

            weightList.append(weights[0])
            selectionItr.next()

        return weightList
Beispiel #4
0
 def getWeightsFromLattice(self,influence):
     
     '''
     method for returning weightlist of given influence from a lattice
     input MDagPath (influence) 
     output python list (weights)  
     '''
     
     weightList = []
     
     latticePntSelection = GenAPI.getLatticePoints(self.shapePath)
     selectionItr = om.MItSelectionList(latticePntSelection) 
     
     index = self.skinclusterFn.indexForInfluenceObject(influence)
     weights = om.MFloatArray()
     
     intArray = om.MIntArray()
     intArray.append(index)
     
     mdagPath = om.MDagPath()
     component = om.MObject()
         
     
     while not selectionItr.isDone():
         
         selectionItr.getDagPath(mdagPath,component)
         
         self.skinclusterFn.getWeights(self.shapePath,component,index,weights)
         
         weightList.append(weights[0])
         selectionItr.next()
     
     return weightList