Ejemplo n.º 1
0
    def doCreate(self):

        # create multiMatte
        multiMattes = []
        for eachInfo in self.createMatteInfo:
            for assetName in eachInfo.keys():
                eachAsset = eachInfo[assetName]

                for eachMatte in eachAsset:
                    matteName = eachMatte
                    ids = eachAsset[eachMatte]
                    enableMaterialId = True

                    if not mc.objExists(matteName):

                        multiMatteNode = vrayUtils.createMultiMatte(matteName, enableMaterialId, ids)
                        multiMattes.append(multiMatteNode)

                    else:
                        print "%s exists, skip create node" % matteName

                self.setStatus(assetName)

                # create objectMatte
        self.createObjectID()

        return multiMattes
Ejemplo n.º 2
0
    def doCreate(self):

        # create multiMatte
        multiMattes = []
        for eachInfo in self.createMatteInfo:
            for assetName in eachInfo.keys():
                eachAsset = eachInfo[assetName]

                for eachMatte in eachAsset:
                    matteName = eachMatte
                    ids = eachAsset[eachMatte]
                    enableMaterialId = True

                    if not mc.objExists(matteName):

                        multiMatteNode = vrayUtils.createMultiMatte(
                            matteName, enableMaterialId, ids)
                        multiMattes.append(multiMatteNode)

                    else:
                        print '%s exists, skip create node' % matteName

                self.setStatus(assetName)

        # create objectMatte
        self.createObjectID()

        return multiMattes
Ejemplo n.º 3
0
    def createObjectID(self):
        widget = 'id_tableWidget'
        assets = self.getAllData(self.assetColumn, widget)
        objectIds = self.getAllData(self.objectIDColumn, widget)

        i = 0
        count = 1
        multiMatte = None
        enableMaterialId = False

        for eachId in objectIds:
            if not eachId == '-':
                # channel = i%3
                channel = 0
                assetName = assets[i]

                if channel == 0:
                    # create multiMatte node
                    # TA Change this on 12-06-2015 because naming characters exceed 29 chars
                    # matteName = '%s_multiMatte' % (assetName)
                    matteName = '%s_mm' % (assetName)

                    if not mc.objExists(matteName):
                        print 'createMultiMatte objectID'
                        multiMatte = vrayUtils.createMultiMatte(
                            matteName, enableMaterialId)

                        # set id
                        redId = int(eachId)
                        mc.setAttr('%s.vray_redid_multimatte' % multiMatte,
                                   redId)

                        count += 1

                # if channel == 1 :
                # 	greenId = int(eachId)
                # 	mc.setAttr('%s.vray_greenid_multimatte' % multiMatte, greenId)

                # if channel == 2 :
                # 	blueId = int(eachId)
                # 	mc.setAttr('%s.vray_blueid_multimatte' % multiMatte, blueId)

                self.setStatus(assetName)

            i += 1
Ejemplo n.º 4
0
    def createObjectID(self):
        widget = "id_tableWidget"
        assets = self.getAllData(self.assetColumn, widget)
        objectIds = self.getAllData(self.objectIDColumn, widget)

        i = 0
        count = 1
        multiMatte = None
        enableMaterialId = False

        for eachId in objectIds:
            if not eachId == "-":
                # channel = i%3
                channel = 0
                assetName = assets[i]

                if channel == 0:
                    # create multiMatte node
                    # TA Change this on 12-06-2015 because naming characters exceed 29 chars
                    # matteName = '%s_multiMatte' % (assetName)
                    matteName = "%s_mm" % (assetName)

                    if not mc.objExists(matteName):
                        print "createMultiMatte objectID"
                        multiMatte = vrayUtils.createMultiMatte(matteName, enableMaterialId)

                        # set id
                        redId = int(eachId)
                        mc.setAttr("%s.vray_redid_multimatte" % multiMatte, redId)

                        count += 1

                        # if channel == 1 :
                        # 	greenId = int(eachId)
                        # 	mc.setAttr('%s.vray_greenid_multimatte' % multiMatte, greenId)

                        # if channel == 2 :
                        # 	blueId = int(eachId)
                        # 	mc.setAttr('%s.vray_blueid_multimatte' % multiMatte, blueId)

                self.setStatus(assetName)

            i += 1