Beispiel #1
0
def get_grouped_aovs():
    """
    Get the available mtoa aovs grouped under their catergories setup for mtoa

    :return: a dictionary where keys are aov category and values a list of aovs
    """

    aov_groups = sorted(set(aovs.getNodeTypesWithAOVs()))

    aovs_dict = dict()

    for aovGrp in aov_groups:
        group_list = []

        aov_list = [x for x in aovs.getRegisteredAOVs(nodeType=aovGrp) if x]

        for aov in aov_list:
            aov_data = {"ui_Name": aov,
                        "aov_Name": "aiAOV_%s" % aov,
                        "type": aovGrp}

            group_list.append(aov_data)

        aovs_dict[aovGrp] = group_list

    return aovs_dict
Beispiel #2
0
    def updateActiveAOVs(self):
        '''
        fill the active and inactive columns based on the nodeType/group selected
        '''
        if _updating:
            return
        
        if not self.doGroups or (not self.doAOVGroups and len(self.nodeTypes) == 1):
            groups = self.nodeTypes
        else:
            groups = pm.textScrollList(self.groupLst, query=True, selectItem=True)

        # first, find out what's selected, so we can reselect any persistent items
        availableSel = pm.textScrollList(self.availableLst, query=True, selectItem=True)
        activeSel = pm.textScrollList(self.activeLst, query=True, selectItem=True)
        availableList = []
        activeList = []

        # update the available list
        pm.textScrollList(self.availableLst, edit=True, removeAll=True)
        pm.textScrollList(self.activeLst, edit=True, removeAll=True)
        try:
            activeAOVs = self.renderOptions.getAOVs()
        except pm.MayaNodeError:
            activeAOVs = []
        self.allAOVs = set([])
        for group in groups:
            if group.startswith('<'):
                # it's an AOV group
                aovList = aovs.getGroupAOVs(group)
            else:
                aovList = [x for x in aovs.getRegisteredAOVs(nodeType=group) if x]
            self.allAOVs.update(aovList)
            for aovName in aovList:
                if aovName not in activeAOVs:
                    if aovName not in availableList:
                        availableList.append(aovName)
                else:
                    if aovName not in activeList:
                        activeList.append(aovName)
        # update sorted and not duplicated available AOVs
        availableList.sort()
        for aovName in availableList:
            pm.textScrollList(self.availableLst, edit=True, append=aovName)
            if aovName in availableSel:
                pm.textScrollList(self.availableLst, edit=True, selectItem=aovName)
        # update sorted and not duplicated active AOVs
        activeList.sort()
        for aovName in activeList:
            pm.textScrollList(self.activeLst, edit=True, append=aovName)
            if aovName in activeSel:
                pm.textScrollList(self.activeLst, edit=True, selectItem=aovName)
Beispiel #3
0
def allAovs():
	"""return all the aovs available to be created"""
	aovList = list(set(aovs.getRegisteredAOVs(builtin = True)))
	return aovList
Beispiel #4
0
    def updateActiveAOVs(self):
        '''
        fill the active and inactive columns based on the nodeType/group selected
        '''
        if _updating:
            return

        if not self.doGroups or (not self.doAOVGroups
                                 and len(self.nodeTypes) == 1):
            groups = self.nodeTypes
        else:
            groups = pm.textScrollList(self.groupLst,
                                       query=True,
                                       selectItem=True)

        # first, find out what's selected, so we can reselect any persistent items
        availableSel = pm.textScrollList(self.availableLst,
                                         query=True,
                                         selectItem=True)
        activeSel = pm.textScrollList(self.activeLst,
                                      query=True,
                                      selectItem=True)
        availableList = []
        activeList = []

        # update the available list
        pm.textScrollList(self.availableLst, edit=True, removeAll=True)
        pm.textScrollList(self.activeLst, edit=True, removeAll=True)
        try:
            activeAOVs = self.renderOptions.getAOVs()
        except pm.MayaNodeError:
            activeAOVs = []
        self.allAOVs = set([])
        for group in groups:
            if group.startswith('<'):
                # it's an AOV group
                aovList = aovs.getGroupAOVs(group)
            else:
                aovList = [
                    x for x in aovs.getRegisteredAOVs(nodeType=group) if x
                ]
            self.allAOVs.update(aovList)
            for aovName in aovList:
                if aovName not in activeAOVs:
                    if aovName not in availableList:
                        availableList.append(aovName)
                else:
                    if aovName not in activeList:
                        activeList.append(aovName)
        # update sorted and not duplicated available AOVs
        availableList.sort()
        for aovName in availableList:
            pm.textScrollList(self.availableLst, edit=True, append=aovName)
            if aovName in availableSel:
                pm.textScrollList(self.availableLst,
                                  edit=True,
                                  selectItem=aovName)
        # update sorted and not duplicated active AOVs
        activeList.sort()
        for aovName in activeList:
            pm.textScrollList(self.activeLst, edit=True, append=aovName)
            if aovName in activeSel:
                pm.textScrollList(self.activeLst,
                                  edit=True,
                                  selectItem=aovName)