ZBrushCentral

Extending Note Interfaces

This will probably only be of interest to those zscripters who tinker with code for pleasure and can stand a degree of hair loss but I thought I would share my recent experiments into Note interfaces.

Post.jpg

Note interfaces are very useful because you can pretty much design an interface how you want. The major drawback is that you’re limited with what type of widgets you can use - buttons or switches, and that’s it.

For a Note interface to work, the Note that displays the buttons has its duration set to 0 which is the equivalent of ‘wait for user action’. When the Note is wrapped in a loop, the interface can be made to update after a button press rather than exit, and so more complex functionality is possible. Unfortunately, the button press is necessary - the interface won’t update without it.

However, if the Note duration is changed - the optimum value appears to be 0.001 - then the interface will update without any button presses. This is all very exciting until you discover that the buttons don’t work any more. So some way has to be found to either get back to the 0 duration, or to capture the button presses in some other way.

This is my attempt. There are two variations here:

  1. The Slider interface sets the duration to 0.001 when you click on the slider. The interface will then update as you drag the mouse, so the slider value changes and the color swatch varies in color. The drawback here is that the slider doesn’t work exactly as a normal slider: you click to start and click to stop (or move off the slider) but you don’t drag - when active the slider simply follows the mouse. The advantage of this implementation is that any noteibuttons work as normal.

  2. The MouseOver button interface has the duration set to 0.001 from the start. This means that mousing over the picture will change it. Clicking on the picture will exit the interface. If you mouse over the orange bar it will be picked up by the mouse and dragged around. Clicking it will return it to its starting position. The button actions here are got by using the mouse state, which registers while a note is displayed, so the buttons used are all disabled as the duration is never at 0 and they don’t work.

I find both these methods reliable enough to be useful but they may not be so for others, so please post your impressions if you’re interested. The code and button images are in the zip. If you come up with alternatives or improvements please post them in this thread.

[Edit: Well, I’ve just discovered that having the left tray open throws things out, so that will need solving.]

[Edit2: Doh! Typo in the code, IHPos when it should be IVPos… code adjusted]

Enjoy,

Thanks for all the work that you do. This gives me the perfect excuse to ask you this question.

I like to store poses for my model in layers. I make a layer and store a pose for each Subtool base mesh that I have. To turn a pose on I have to go to each sub tool and go to the base mesh and turn the layer slider value all the way to 1. It takes some time to do this and it takes more time for the amount of subtools that you have.

What I would love is this, 1 slider that controls a pose. Slider all the way to the left then your model is in it’s default pose, mover the slider all the way to the right and your model is in a pre defined pose.

In Maya I would set this up with a “Set driven key.” This makes a relationship between two values and allows you to key different states for those values. So in this case you could use your slider to “drive” the value of your blendshape/morph target/layer value. You would put your slider to the 0 value and set a key for every subtool in the default pose state. Then you would move your slider to the 1 value and then key all your sub tool layer values to drive the pose. Now that that relationship has been set up you can then use the ONE slider to drive the pose of many objects.

If this functionality was built into ZBrush it would open up many, many possibilities .

Thanks again bud!

You’re the man!

Hi Nick,

That’s an interesting idea. I think that it may be possible but I’ll need to think about it. A good time to ask, as I’m working on a subtools utility. :slight_smile:

Thanks,

Thank you very much Marcus, I think this will do the trick for most of my note window interfaces.