Notifications
Clear all

[Closed] Pull names from getClassInstances

I’m trying to pull the names of Multiscatter objects in my scene. If I do:
sel = getClassInstances Multiscatter ,
sel[1].name property does not exist. However if I select one of the Multiscatters, and type in
print $.name
It will return the name. Does anyone have any idea how to return a name after using getClassInstances?

3 Replies

You can use dependent refs…

(refs.dependents (getclassinstances Multiscatter)[1])[1].name

Or another way to do it would be do…

for o in objects where classof o == Multiscatter do print o.name

Thanks Dave, the second solution is simple and straightforward. I have never heard of dependent refs, so I’ll look into them.