ZBrushCentral

Cancelling a Save Dialog

I’m setting up a batch exporter, and I realized that if a user cancels the save in the save dialog, my script enters the loop anyway (but doesn’t actually export anything).

What command can I use to stop from entering the execution loop if the user cancels the save dialog?

Thanks!

Brad

http://www.zbrushcentral.com/showthread.php?179839-Do-Nothing-in-an-IF-Statement&p=1036585#post1036585 and http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/technical/ HTH

The Save dialog will return a file name. If the user cancels then that will be an empty string, so you can test like this (where fileName is the variable containing the result of FileNameAsk or whatever):


[If, [StrLength,fileName],
      //do stuff - your loop goes here
, //else no file
      //do nothing 
]

ah, the empty string! Didn’t even think about that… I was thinking there must be a command or integer returned somewhere that I could use / check. Thanks again Marcus!