ZBrushCentral

How to allow opening only certain file types on the PC?

On my Mac, the following line allows the user to choose only files with a .ZBR suffix:

[VarSet, file, [FileNameAsk, ".ZBR", , "Choose a .ZBR file"]]

From my understanding of the docs on FileNameAsk, this is the expected behavior; choosing other file types is disallowed by the file chooser.

However, on the PC, the dialog that comes up as a result of that line allows me to choose other file types. (.ZTL files at least). If I do choose a non-ZBR file, then the program crashes and shuts down.

Is there a way to enforce these types of restrictions on the PC? Or do I need to check the file name within my own code, to make sure the appropriate type has been chosen?

Thanks,
Ken

I effectively answered this in another thread.

Also, if you press the Cmd button in the ZScript palette you’ll see that all the ZScript commands are given with examples. This is a very useful resource.

Ah, how interesting about the ‘Cmd’ control. I had used the ‘export’ button in the ZScript menu to export the list of commands to a text file, and then printed that out. It had never occurred to me that the text printout would be different from the online list, but in fact the text version contains no examples.

This should make things much easier in the future.

Thanks,
Ken

Ken,
It is useful, though one or two things don’t work as advertised.

On FileNameAsk, use this form:

[FileNameAsk,“photoshop(.psd)|.psd|jpg(.jpg)|.jpg|tif(.tif)|.tif||”,“Please select an image file…”]

for both Open and Saves (inserting a default filename for the saves) and you should be all right. The “” around the initial filenames, and the | and ending || seem to do the trick.