View Full Version : quick way to find object with a CA in scene without looping

04 April 2009, 10:00 AM
hi i was wondering if is an quick way to dinf what object got a certain CA , custom attributes aplayed in scene.

I just out a few CA in the baseobject of in scene , and i was thinkingif will be a way quicker that lop true al the objects in scene and change if the got the CA in the baseobject. if an easy way to find obejct with ca in scene, i was thinkign probably reference will do.

04 April 2009, 10:20 AM
So you have some CA on an object..

myCA = attributes test (
parameters main (
test type:#float default:123
mySphere = sphere()
custAttributes.add mySphere myCA
$Sphere:Sphere01 @ [0.000000,0.000000,0.000000]

and you want to check which objects are using it? Something a la...

for n in (getClassInstances myCA) do (
format "%\n" n
for ref in (refs.dependents n) do (
format "\t%\n" ref
for ref in (refs.dependents ref) do (
format "\t\t%\n" ref
$Sphere:Sphere01 @ [0.000000,0.000000,0.000000]

04 April 2009, 12:26 PM
Funny, was just doing something similar.

fn findCANodes =
clearArray = #()
theNodes = for m in (getClassInstances emptymodifier) where == "nodeList" collect (refs.dependentNodes m)[1]
for n in theNodes do appendIfUnique clearArray n
) -- end findCANodes

This one is name based I know this, but that works in my particular case.


04 April 2009, 10:40 PM
Hmmm... Doesn't seem to work if the custom attribute is applied to an xref's "actualBaseObject". Bummer.

04 April 2009, 11:06 PM
thanks alot guys ,John , are you refering to xref scene obejcts or xref object with ca in the baseobject.???
I put alot of ca in baseobject , but i found lately the ca slow down the speed in trackview :( , but i have already report it , hopefully will get fix soon.

CGTalk Moderation
04 April 2009, 11:06 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.