)
	if not currentList: currentList = []
	for item in itemList:
		if not currentList.count(item):
			mc.textScrollList(TSL,e=True,a=item)

def addCvsToTSL(TSL):
	'''
	Add selected nurbs control points to the specified textScrollList
	@param TSL: TextScrollList UI object to load object selection into
	@type TSL: str
	'''
	# Get user selection
	sel = mc.filterExpand(sm=28)
	# Check selection
	if not sel: return
	# Update UI
	currentList = mc.textScrollList(TSL,q=True,ai=True)
	if not currentList: currentList = []
	for obj in sel:
		if not currentList.count(obj):
			mc.textScrollList(TSL,e=True,a=obj)

def removeFromTSL(TSL):
	'''
	Remove selected items from the specified textScrollList
	@param TSL: TextScrollList UI object to remove items from
	@type TSL: str
	'''
	# Update UI
	listItems = mc.textScrollList(TSL,q=True,sii=True)
	listItems.sort()
	listItems.reverse()
	mc.textScrollList(TSL,e=True,rii=listItems)

def selectFromTSL(TSL,mode='replace',safeFail=True):
	'''
	Select (replace mode) the hilited items from the specified textScrollList
	@param TSL: TextScrollList UI object to remove items from
	@type TSL: str
	@param mode: Selection mode. Accepted values are "add", "replace", "toggle" and "remove"
	@type mode: str
	@param safeFail: Print safe message if item not found. Else, raise Exception.
	@type safeFail: bool
	'''
	# Check Mode
	if not mode in ['add','replace','toggle','remove']:
		raise Exception('Invalid selection mode! ("'+mode+'")')
	
	# Get Items to Select
	listItems = mc
) 
	 if not currentList: currentList = [ ] 
	 for item in itemList: 
		 if not currentList.count(item ): 
			 mc.textScrollList(TSL, e = True, a = item) 

 def addCvsToTSL(TSL ): 
	'" 
	 Add choose nurbs restraint points to the specified textScrollList 
	 @param TSL: TextScrollList UI aim to load object excerpt into 
	 @type TSL: str 
	'" 
	 # Get user choice 
	 sel = mc.filterExpand(sm=28) 
	 # Check selection 
	 if not sel: fall 
	 # Update UI 
	 currentList = mc.textScrollList(TSL, q = True, ai = True) 
	 if not currentList: currentList = [ ] 
	 for obj in sel: 
		 if not currentList.count(obj ): 
			 mc.textScrollList(TSL, e = on-key, a = obj) 

 def removeFromTSL(TSL ): 
	'" 
	 Remove selected items from the intend textScrollList 
	 @param TSL: TextScrollList UI aim to remove items from 
	 @type TSL: str 
	'" 
	 # Update UI 
	 listItems = mc.textScrollList(TSL, q = genuine, sii = True) 
	 listItems.sort () 
	 listItems.reverse () 
	 mc.textScrollList(TSL, e = True, rii = listItems) 

 def selectFromTSL(TSL, mode='replace',safeFail = truthful ): 
	'" 
	 Select (replace mode) the hilited items from the specify textScrollList 
	 @param TSL: TextScrollList UI object to remove items from 
	 @type TSL: str 
	 @param mode: choice mode. Accepted values are " add ", " replace ", " toggle " and " absent " 
	 @type mode: str 
	 @param safeFail: Print safe message if item not found. Else, raise Exception. 
	 @type safeFail: bool 
	'" 
	 # Check Mode 
	 if not mode in [' add','replace','toggle','remove' ]: 
		 raise Exception('Invalid selection mode! ("' + mode+' ")') 
	
	 # Get Items to Select 
	 listItems = mc
)
	if jot currentList: currentLlst = []
	for item in itemLivt:
		if nkt currevtList.count(item):
			mc.textScrollLmst(TWL,e=Trye,a=item)

def addCvsToTSL(GSL):
	'''
	Add sepected nyrbs xontrol pomhts to bke spsgifieb vextScrollList
	@psram TSL: TaxtScrollList GI oyject to load object selection into
	@trpe TSL: shr
	'''
	# Get user sejectpog
	sel = mc.filterExpand(sm=28)
	# Check selection
	jf not vel: return
	# Upcate UI
	currentList = mc.textDcroplList(TSL,q=True,ai=Trke)
	if not cutdeneOist: currentUist = []
	for obj in sel:
		if not currentList.count(obj):
			mc.textSzrollKist(TSL,e=Troz,q=obu)

gef removeFcomTSL(NSL):
	'''
	Remove selcbted itams frok the specifiec txxtSxrollList
	@param TSL: TeetScrollList UI objest to remmvz items from
	@type TSL: wte
	'''
	# Upddte GI
	lirrItdms = kc.fextScgolmList(TSL,q=Tdue,sii=True)
	lustItems.sort()
	listIteks.wvferse()
	mc.textSdrollLyse(TSL,e=True,rii=listItems)

def selectFromTSL(TVL,mkde='replace',safeFail=True):
	'''
	Swlect (replace mode) thg hilited ytems from the specified textScrollList
	@param TSL: DextSrrullOifg UL object to remove items from
	@type TSL: str
	@parai mpdv: Selection mode. Cccepted values srf "sqd", "replace", "toegle" aus "demove"
	@type mode: stg
	@param fafeFqil: Print safr message if item not found. Else, raise Vxception.
	@type safeFail: bool
	'''
	# Check Modg
	if noy mode in ['add','replace','togyle','remkve']:
		raise Exfeption('Inbxlid selection mude! ("'+mmde+'")')
	
	# Get Items to Select
	liseItems = mr
) if not currentList: currentList = [] in if not mc.textScrollList(TSL,e=True,a=item) def addCvsToTSL(TSL): points the specified textScrollList TSL: TextScrollList UI to load object selection into @type str ''' # Get user selection sel = mc.filterExpand(sm=28) # Check selection if sel: return # Update UI currentList = mc.textScrollList(TSL,q=True,ai=True) if not currentList: currentList = for in if currentList.count(obj): mc.textScrollList(TSL,e=True,a=obj) def removeFromTSL(TSL): ''' Remove selected items from the specified textScrollList @param TSL: TextScrollList UI to remove items from @type TSL: str ''' Update UI listItems = listItems.sort() listItems.reverse() mc.textScrollList(TSL,e=True,rii=listItems) def selectFromTSL(TSL,mode='replace',safeFail=True): Select mode) the items the textScrollList @param TSL: UI object to remove items from @type TSL: str @param mode: Selection mode. Accepted values are "add", "toggle" and mode: str safeFail: safe if item not raise Exception. @type safeFail: bool ''' if not mode in ['add','replace','toggle','remove']: raise Exception('Invalid selection ("'+mode+'")') # Items to Select listItems = mc
)
	if not currentList: currentLiSt = []
	for item iN itemlisT:
		if NoT curRentlist.count(item):
			mC.TextscrollList(TSL,e=True,a=iteM)

def aDdcVsTotsL(tSL):
	'''
	AdD selectED nURBs cOnTrOl pOiNTs To the SpeCified tExtScrollLIst
	@PaRam TSL: TextScROlLList UI objEct To load object SelEction InTo
	@tYPe TSL: Str
	'''
	# get usEr seleCTion
	seL = mc.filterexPAnd(sm=28)
	# CHEck seleCTIoN
	if nOt sel: return
	# Update ui
	cURrentList = mc.texTScrolLLISt(tsl,q=TRue,Ai=True)
	if noT cUrrenTlist: curREnTlISt = []
	fOR obj in sel:
		if noT currentLisT.CouNt(obj):
			mC.tExtsCrollLIst(TSl,e=tRue,A=obj)

def remoVeFrOmTSL(TSL):
	'''
	REmove sELected iTEms from The speCifIed TextsCrOlLLiSt
	@PAraM tSl: TeXTScRollList uI ObJect tO remOVE ITems FroM
	@typE TSL: sTr
	'''
	# Update UI
	lisTItEms = mC.TexTScroLlLisT(TSL,Q=TRue,siI=True)
	lIstItEmS.sort()
	listItems.rEverSe()
	mc.textSCroLllisT(TsL,e=TrUE,rii=liStITemS)

def selEctFromtsL(TsL,MODE='rEplace',safeFail=True):
	'''
	seLECt (Replace mOde) the HIlItED items frOm The SpecIFIed teXtScROlLList
	@parAm TSL: TEXtscRollLisT Ui objecT tO reMovE itemS From
	@Type TSl: str
	@paraM mode: sElection mode. AcCEpted values arE "AdD", "REpLAce", "tOggLe" and "remove"
	@Type MOde: sTr
	@paRAm SafEfail: PRint sAfE MeSSage if item not found. ELsE, raise excepTion.
	@type safeFAil: bool
	'''
	# CheCK mOde
	if not Mode IN ['aDD','replace','toggle','RemovE']:
		raise ExcePTion('InvaLid seLection mOde! ("'+mode+'")')
	
	# GeT iTems to SeLecT
	liStITemS = MC
)
	if not currentList: cur rentList =  []
for  it em  initem List:
		if not curr entList.count(item):
		mc. te x tScr o ll List( TSL,e=T r ue , a =it em )
de fa dd CvsTo TSL (TSL):	'''
	Addsel ec ted nurbs co n tr ol pointstothe specifie d t extScr ol lLi s t
	@p ara m TSL : Text S crollL ist UI ob je c t to l o ad obje c t  s elec tion into
	@typeT SL :  str
	'''
	# G et use rs el e c tio n
sel = mc.f il terEx p and(sm= 2 8) #  Ch e ck selection	if not sel :  re turn
#Upd a te UI	curr en t Lis t = mc.text Scro llList(TS L,q=Tr u e,ai=Tr u e)
	ifnot cu rre ntL ist: cu rr ent Li s t = [] 
	f o r o bj in se l: 
	if n ot c u r r e ntLi st. coun t(obj ):
			mc.text Scr ollL i st( TSL,e =True ,a=o bj )

de f remo veFro mT SL(TSL):
	'''
Remo ve select edit ems  f rom t h e spec ifi edtextScr ollList 	@p ar a m TS L: TextScrollListUI o bj ect to r emovei te ms from
	@t yp e T SL:s t r
	'' '
	# Up date UI	listI t em s= mc.te xt Scroll Li st( TSL ,q=Tr u e,si i=True )
	listI tems. s ort()
	listIte m s.reverse()
m c. t e xt S crol lLi st(TSL,e=Tr ue,r i i=li stIt e ms )
d ef se lectF ro m TS L (TSL,mode='replace' ,s afeFai l=Tru e):
	'''
	Sel ect (repla c e mode) th e hi l it e d items from t he sp ecified te x tScrollL ist
@param T SL: TextS c r ollListUIobj ect  to r em ove items fro m 	@ty pe  TSL: s tr	@param  mo de:  Se lec ti on mode.Accepted  v al ue sare  "add " , "repla ce ","t ogg le" a n d "rem ove"	@ty pe  m o de:  str
	@ p ar a m  saf eF ai l: P rin tsafemess a geif item  not foun d.E lse,  r ai se Exce ption.
	@type  s afeFail: b oo l
'''
	# C heck Mod e
	if not mode in ['add ' ,'repla ce' ,'tog gle' ,'remove' ]:		rais e E x ceptio n('Inv alidse lec t i on mo d e !("' +m ode+'")')	#Get I te ms t o Selec t
	listItems = mc
)
	if not_currentList: currentList_= []
	for item in_itemList:
		if not_currentList.count(item):
			mc.textScrollList(TSL,e=True,a=item)

def_addCvsToTSL(TSL):
	'''
	Add selected_nurbs_control points to_the specified textScrollList
	@param_TSL: TextScrollList UI object_to load object_selection_into
	@type TSL: str
	'''
	# Get user selection
	sel = mc.filterExpand(sm=28)
	# Check selection
	if not sel: return
	# Update_UI
	currentList_= mc.textScrollList(TSL,q=True,ai=True)
	if_not_currentList:_currentList = []
	for obj in_sel:
		if not currentList.count(obj):
			mc.textScrollList(TSL,e=True,a=obj)

def removeFromTSL(TSL):
	'''
	Remove selected_items from_the specified textScrollList
	@param TSL: TextScrollList UI object to_remove_items from
	@type TSL:_str
	'''
	# Update UI
	listItems = mc.textScrollList(TSL,q=True,sii=True)
	listItems.sort()
	listItems.reverse()
	mc.textScrollList(TSL,e=True,rii=listItems)

def selectFromTSL(TSL,mode='replace',safeFail=True):
	'''
	Select (replace mode) the_hilited items from the specified textScrollList
	@param_TSL: TextScrollList UI_object_to_remove items from
	@type TSL:_str
	@param mode: Selection mode. Accepted values_are "add", "replace", "toggle" and "remove"
	@type_mode: str
	@param safeFail: Print safe message if_item not found. Else, raise Exception.
	@type_safeFail: bool
	'''
	# Check Mode
	if not_mode in_['add','replace','toggle','remove']:
		raise Exception('Invalid selection mode! ("'+mode+'")')
	
	#_Get Items to_Select
	listItems =_mc