|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
|
what kind of error handling can I use in max script?
Suppose I am moving merrily slong exporting some material data, and I come to a where I get whether or not ambient is mapped, get a textureMap, check if it is a bitmap, and find out it isn’t. Well, my code doesn’t handle that case, so I’d like to alert the user and bail out.
I know there is a messagebox function. Is there some kind of exit function?
what about other kinds of error handling?
exceptions?
|
|
|
|
try () catch() ???
i am Chinese, my English is very poor,thank you for talk
MSN:sitt#live.cn
|
|
|
|
SITT is correct. Try/catch is slow in MAXScript, however, so if you can try checking specifically for the property it will be faster: something like if isProperty foo #propname then ...
David “Stokes” Stokes
Senior Technical Artist, Blue Fang Games
|
|
|
brekehan 04 May 2009 05:31 AM
… Is there some kind of exit function
My question is along these lines. Look at this code:
try (FinalString = substring TempoString (intStartIndex + 5) -1) catch
(
MessageBox "The file path must contain the \"Data\" folder." Title: myTitle
--Stop executing the script now
)
What command stops execution of the script in an expression, such as the END or EXIT SUB commands in VB?
~Dave
http://www.max-realms.com - 3ds Max models, tutorials and forums
Max3-2010
|
|
|
IonDave 11 December 2009 12:26 AM
What command stops execution ?
exit
Max 9 through 2009, XP-Pro x64 SP2
ASUS EAH3450 Series (Driver 8.470).
Core 2 Duo E8400 3GHz, 4Gb Ram, DX9.0c.
|
|
|
Anubis 11 December 2009 01:25 AM
IonDave 11 December 2009 12:26 AM
What command stops execution ?
exit
Exit only works in loops
|
|
|
|
Fn Test = (
try (box > class) catch
(
MessageBox "Functions Error" Title: "Error"
return undefined
)
MessageBox "Test" )
Test()
i am Chinese, my English is very poor,thank you for talk
MSN:sitt#live.cn
|
|
|
|
Thanks, SITT
~Dave
http://www.max-realms.com - 3ds Max models, tutorials and forums
Max3-2010
|
|
|
|
|
|