Annotations is a property, not an X3DObject. FindChildren
finds X3DObjects.
Use the approach documented on this wiki
page:
From: owner-xsi(at)Softimage.COM
[mailto:owner-xsi(at)Softimage.COM] On Behalf Of Dan Yargici
Sent:
Wed 02 May 2007 11:03 AM
To: xsi(at)Softimage.COM
Subject:
[Scripting] FindChildren with Annotations....
I'm attempting to write a little script which will create an
Annotation on the scene root, however i'd like to check if this rather
uniquely-named Annotation already exists so I can zap it and re-make
it.... I've tried:
//------------------------------
myScnroot =
ActiveProject.ActiveScene.Root;
myAnotnName = "DansData";
var myAnotn
= AddProp( "Annotation", myScnroot, siDefaultPropagation, myAnotnName );
myTrash = myScnroot.FindChildren (myAnotnName);
logmessage
(myTrash.Name);
//-----------------------------
and it
outputs:
//INFO :
Nothing, basically..... I notice in the SDK
(under FindChildren) that there doesn't appear to be a Type for annotations - is
this why?
Also, what's the best way to check it exists or not? Would my
example (if it worked) return an error if it found nothing? or just keep
going?
Thanks,
DAN