Notifications
Clear all
[Closed] Pull names from getClassInstances
Oct 31, 2012 2:42 pm
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
Oct 31, 2012 2:42 pm
You can use dependent refs…
(refs.dependents (getclassinstances Multiscatter)[1])[1].name
Oct 31, 2012 2:42 pm
Or another way to do it would be do…
for o in objects where classof o == Multiscatter do print o.name
Oct 31, 2012 2:42 pm
Thanks Dave, the second solution is simple and straightforward. I have never heard of dependent refs, so I’ll look into them.