def getFilteredRelatives(sel, objectType, asType=True):
	newList = []
	for obj in sel:
		relatives = cmds.listRelatives(obj)
		for relative in relatives:
			if cmds.objectType(relative, isType=objectType):
				if asType:
					newList.append(relative)
				else:
					newList.append(obj)
					break
	return newList
Return a new selection list containing only specific types of relatives or objects containing specific types of relatives.
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/amTools/utilities/dg.py/getFilteredRelatives