ScriptSpot

Forum topic · Scripts Wanted

Remove object from named selection set

By jsrocha · 2023-10-03

Description

Hi guys,
is there a way to remove an object (or objects) from a named selection set using maxscript? i mean, remove from any named selection set, not an especific one.
Thanks in advance,

Jsrocha

Comments (2)

miauu · 2023-10-04


(
	objToRemoveArr = #($Sphere007, $Sphere008, $Sphere009)
	
	objsBA = #{}
	for o in objToRemoveArr do append objsBA (getHandleByAnim o)	
	for i = 1 to selectionSets.count where (objsCnt = (getNamedSelSetItemCount i)) != 0 do
	(		
		selectionSets[(getNamedSelSetName i)] = (for n = 1 to objsCnt where not objsBA[getHandleByAnim (obj = getNamedSelSetItem i n)] collect obj	)
	)
)

jsrocha · 2023-10-04

Thanks Miauu!!