##James Parks 06/09/04 ##jpmFilterList.mel ##Given an array of objects (such as resulting from `ls -sl`) and a string ##will return only the objects that are both in that list and whose names ##contain the given string import maya.cmds as cmds def jpmFilterList(selected, filter): filterSelected = cmds.ls( filter, r=1, tr=1 ) bothSelected = [] for obj in selected: for filteredObj in filterSelected: if obj == filteredObj: bothSelected.append(obj) return bothSelected