Notifications
Clear all

[Closed] ThrowOnError

I’m wanting to delete a bunch of objects but because they’re hooked up with script controllers and whatnot, when I delete them I get a flood of error messages from these now deleted objects saying that the nodes they were referencing don’t exist any more. I then have to hit OK tons of times and close lots of script controller windows.
Very annoying.
Is there a way that I can stop these error messages coming up? I tried turning ThrowOnError off for them but that didn’t do a thing. Does that command work the way I’m imagining it?
:¬/

2 Replies

hi brad,
have you tried using this in the script controller
try(your script)
catch(0)

mark

Thanks Mark, that worked well.
Just for anyone else who wants to change their script controllers all at once, here’s the script I used:


   floatscripts = getclassinstances float_script
   for i in floatscripts do
   (
   	i.script = "try (" + i.script + ") catch (0)"
   )
   
   posscripts = getclassinstances position_script
   for i in posscripts do
   (
   	i.script = "try (" + i.script + ") catch ([0,0,0])"
   )
   
   rotscripts = getclassinstances rotation_script
   for i in rotscripts do
   (
   	i.script = "try (" + i.script + ") catch (quat 0 0 0 1)"
   )
   
   point3scripts = getclassinstances point3_script
   for i in point3scripts do
   (
   	i.script = "try (" + i.script + ") catch ([0,0,0])"
   )
   

:¬)