instanceof and XRefs
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/03/2008 at 09:47, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10.5
Platform: Mac OSX ;
Language(s) : C.O.F.F.E.E ;---------
Hello, I am adapting Rui Batista's script (from his book) which allows switching between different resolution objects depending on their distance from a camera. The one in the book uses instance objects which refer to objects stored in the same file. My version uses external XRefs which get pulled in as required. It's all working very well (which is kind of nice, seeing as I only started reading the book this morning) but one thing is driving me mad. In his book Mr Batista has his script check that it is indeed attached to an InstanceObject:if(!instanceof(op,InstanceObject)) return;
I'd like to update this to work with XRefs, but I can't figure this out: using getclass (on op on a script attached to an XRef) returns BaseObject. (I've got it all to work by commenting out this check, but obviously it would be nicer if it worked like it was supposed to.)
I'm confused (and still new to COFFEE.)
Regards
Charlie