visibility based on 3D mask

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  01 January 2005
Question visibility based on 3D mask

hey guys. im trying to create a script that allows me to controll the visibility of an object based on whether or not a ray that is fired from its position hits an animated mesh above it.

here is an mov demonstrating what i mean - http://www.spinifexinteractive.com..../previewmp4.mov

however when i render after the first frame i get -

>> MAXScript Script Controller Exception: -- Runtime error: Illegal self-reference in controller script <<

my scene is basicly a huge array of hexagons (copies, not instances) with this script as a controller on a visibility track -

--script

refsArray = (refs.dependents this)
scriptObj = undefined
for i in refsArray do(
if (isvalidnode i) then (
--print (i.name)
scriptObj=i
-- this is the code to create a variable that references the object running the script
)
)
d = ray scriptobj.pos [0, 0, 1]
if ((intersectray $hitobj d)!=undefined) then (

-- $hitobj can be any object by that name looming over the top (up the z axis). in this case it is a sphere.

scriptobj.wirecolor = [255,255,255]
result=1
) else (
scriptobj.wirecolor = [0,0,0]
result=0
)
result

--end script


so yeah its pretty straightforward, but i cant seem to get it to work on render or find what the illegal self refrence is.

if i get rid of that result variable at the end i get something like this -
http://www.spinifexinteractive.com....t/pre40-100.mov
which is cool for the first few frames, but then it messes up.

Does anyone know why is this occurring? is there a better way of doing this so that i dont have to have a seperate script for each object as well? it must be very inefficient.
__________________
http://www.theoriginalqueg.com

Last edited by acgraham : 01 January 2005 at 11:35 PM. Reason: forgot something
 
  01 January 2006
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:05 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.