ZBrushCentral

Q: note menu with next and back buttons

Hi

I know there are examples but have trouble understanding them and also the documentation.

Any chance someone in the community can give me an example with explanations on how note (interactive) ones work by any chance.

Like the scale master asking input and then showing a tutorial on how things work and explanations etc.

Thanks in advance

Here’s an example for you. I’ve commented the code so that you should be able to see how it works but let me know if there’s anything that puzzles you.

The interface runs inside a loop so that the forward and back buttons can be pressed and the interface remain visible. If there’s a button which will result in the interface being closed (such as the Exit button) then the loop is exited.

The first NoteIButton is the background image. The other buttons are positioned relative to this. The grid on the background is 50 pixels so you can easily see how the positioning works.

Otherwise it’s simply a matter of checking which button the user presses and then making sure it does what you want. The NoteIButtons are counted in sequence, even if they are disabled, and the final Note that makes the whole thing run returns the number of the NoteIButton that is pressed.

Load the zscript through the ZScript>Load button. It’s not a plugin so the button will appear at the bottom of the interface in the ZScript Window. Press ‘H’ to show the window.

HTH,

Attachments

note-example.jpg

Hi Marcus

I somehow new you would be the person to answer or help out, you truly are a great person! This is exactly what I was looking for to completely understand the whole note/window look people are doing.

Thank you so much for doing this and giving me your time! Will ask questions if I don’t understand something but I see that there are quite a few loops to get it to work :slight_smile:

You’re welcome. :slight_smile:

Yes, the main loop is the important one. It makes sure the interface doesn’t disappear after the user presses a button. The single-iteration loops are just a way of making sure only some lines of code run. They’re not really necessary here but I put them in to show what could be done.

Hi Marcus

A few questions if don’t mind:

line 28:
has “#backimage” with a # sign. Not sure why though?

[NoteIButton,/text/ , #backimage /image/ , /pressed?/ ,1 /disabled?/,1 /HPos/, 1 /VPos/ , 600 /HSize/ , 800 /VSize/ , /color/ , /text color/ , 0 /opacity/, /text opacity/ ,1 /image opacity/ ]

line 43:
setting the variable to a empty Note message, confuses me a little, even with the comment :confused:

[VarSet,result,[Note,""]]

Sorry if these are dumb questions, and possible already answered, probably have answered them.

Thanks

For the #backimage:
the hash sign # just indicates a variable. ZBrush ignores the # but it can be useful in making the code more readable. I’m afraid I tend to just add in the # when I feel like it. :slight_smile:

For the empty note [VarSet,result,[Note,""]] :
The NoteIButtons have to have a Note so that they are displayed. In this case the Note doesn’t need any text or a duration because that’s handled by the NoteIButtons and the loop. But the Note returns a number indicating which NoteIButton has been pressed by the user which is why it’s used to set the “result” variable.

http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/command-reference/#Note

Thanks Marcus, I think I understand most of it :wink: