ScriptSpot

Forum topic · General Scripting

SelectbyName() Multiple classes minus selection

By jeremiah_bigley · 2013-01-21

Description

Hey guys was wondering if anyone could help me with this.
I was wanting to know how to have the SelectbyName list display multiple classes (Geometry,Shapes,ect.) minus the currently selected object.

This is what I have... it is a start, but I couldn't find anything anywhere that gave me any idea how to even begin. :/

Any help would be greatly appreciated.

fn geo_filt obj = isKindOf obj geometryClass
HighpolyObjs = selectByName title:"Select Highpoly" filter:geo_filt showHidden:true single:false
Comments (3)

jeremiah_bigley · 2013-01-21

!!!!!!!!

Wow thank you so much barigazy! I had actually tried using "and" at one point instead of "or" and it was a no go (nothing shows in the list)... But I hadn't the slightest idea for taking the lowpoly out. I am really grateful for you awesome and speedy response.

Jeremiah

edit

barigazy · 2013-01-21

You can use more superclasses if you want


fn geo_filt obj = 
(
	(isKindOf obj geometryClass or \
	isKindOf obj Shape or \
	isKindOf obj Helper or \
	isKindOf obj SpacewarpObject or \
	isKindOf obj Light or \
	isKindOf obj Camera
        ) and not obj.isSelected
)

or just use


fn geo_filt obj = (not obj.isSelected)

If you are looking for more just type this in the Listener


for s in superclasses do print s

barigazy · 2013-01-21

Hey Jeremiah
Try something like this

fn geo_filt obj = (isKindOf obj geometryClass or isKindOf obj Shape) and and not obj.isSelected
HighpolyObjs = selectByName title:"Select Highpoly" filter:(geo_filt) showHidden:true single:false