stop loop or script
Hi Everyone this is my script and what i cant seem to figure out is how to stop the script right after it gives the messagebox "please Redo Balls" so it doesn't play to SPH2
(
)
obj = $SPH1
if obj == undefined then messagebox "please Redo Balls"
else
(
selectmore $SPH1
)
obj = $SPH2
if obj == undefined then messagebox "please Redo Balls"
else
(
selectmore $SPH2
)
thanks in advance.
Comments
thanks everyone!!!!
thanks everyone!!!!
`
if you use loop "for ... do...." you can use just "exit"
it can look like this:
cheers,
Pixamoon
.
Regarding maxscript reference file using the EXIT command must be avoided as much as possible, so you can use:
Tools and Scripts for Autodesk 3dsMax
`
good to know :)
I checked maxscript help and found only that "exit" can be extremely slow, but didn't find any info to avoid it "as much as possible". Can you post a link to that ?
best,
Pixamoon
.
The exact words in maxscript reference are "Do not use return, break, exit or continue."
Here is the link.
Tools and Scripts for Autodesk 3dsMax
`
ah, that's true
This is in chapter "How To Make It Faster" - how to make scripts faster
There is also "Disable Undo system when possible" and more...
But sometimes is good to use undo :)
Of course is good to know those functions can make scripts slower.
Thanks,
Pixamoon