ZScript Note Interfaces

From ZBrush Info

Jump to: navigation, search

Note Interfaces

Note Interfaces are an excellent way of displaying images and getting user input. As images can be used for the background and buttons, Note interfaces can be made to look any way you want. Note interfaces don't exist on their own and must be called from a zscript or zplugin button.

An example of a Note interface is the Projection Master dialog:


Note Interface example


A Simple Note Interface

A simple Note interface can be used to inform the user of the current state of ZBrush so that they can decide how to proceed. For example, if there is a mesh in Edit mode and the mesh will be dropped to the canvas during the next operation:


Note Interface example

Here is the code:

[If,[IGetFlags,Transform:Edit]>=8,/*check for mesh in Edit mode*/
/*if yes, show Note interface, else do nothing:*/
[NoteIButton,"Proceed"][NoteIButton,"Cancel"]/*Option buttons*/
[VarSet,output,[Note,"\C8DCDE2\n3DTool in Edit/Transform mode. Tool will be dropped to canvas.",,0,3027773,48,400, ,1,1,0,0,]]/*the note that displays the buttons, the return response is stored in the output variable*/
[If,output=1,[IUnPress,Transform:Edit]]/*code for first button press*/
[If,output=2,[Exit]]/*code for second button press*/
]/*end if*/


Multiple Choice Note Interfaces

The Projection Master dialog is an example of a multiple choice Note interface; the user can press buttons any number of times without the interface disappearing. This is achieved by putting the Note interface code inside a loop with the repeat set to a high number so that it is effectively endless. The interface will update after each button press but only exit when the 'proceed' or 'cancel' button is pressed.


Note Interface example

The method is discussed in detail with this ZScript Example: Note interface and also ZScript Example: Material Pack 2.

Personal tools
Editing ZBrushInfo