ZBrushCentral

[IPress,TUTORIAL VIEW] Problem..I think.

Maybe you can explain this to me:

It has been a WICKED long time since I have played/stumbled with Zscripts.

What I have found in my current situation:

There is now a press and an unpressed identifier with recorded button paths. That being said…[IPress,TUTORIAL VIEW] does not have an unpressed state and I am finding complications by not having such a function available. I am aware that I might be mistaken and there could be an easier way to ‘clean’ the interface. I just don’t know how. Any help would be greatly appreciated.

~MAH~

Hi, :slight_smile:

Some items don’t have an on/off state so you need to test in other ways. The tutorial window you can test for its height and then close it if necessary:


[If,([IHeight,1006]>0),
	[IClick,1002]
]

I’ve used the numerical IDs here, partly because the tutorial window itself doesn’t have a button path. You can find the numerical IDs for interface items by placing the cursor over the item and examining the Preferences>Utilities>View window id slider. I’ve also used ‘IClick’ rather than ‘IPress’. For some actions this is a better option - generally when what is being clicked is not an ordinary button or switch - but a bit of trial and error is necessary.

HTH,

Wow, awesome! Thank you.

Funny thing is, it causes more questions but in a good way. Is zero (0) on and therefore one (1) is off?
Next thnig I need to figure is using that same else/if expression. To find out if light box is open or close so I can do something like if lightbox is on, turn it off…lol. but with all the cool code cheese and comas and such. :laughing: I know the window id is 1004.

Oh yeah, what in the world is Iheight? I need a ZScript Dictionary.

Sorry, I’m a little delirious. Only slept 3 hours.

Thanks again Marcus, you rock!
I miss zscripts. This is wicked fun!

:+1:

~MAH~

For switches, 0 is off and 1 is on. But for the code I have written the 0 is the height of the Tutorial Window as returned by the [IHeight] command. If the Tutorial Window is completely closed then its height is 0, anything greater than this means it’s open and therefore the code closes it by ‘clicking’ on the divider.

If you want to refresh your memory on zscript there’s some info here:
http://www.pixologic.com/docs/index.php/ZScripting

Cheers,

Hi

I am trying to write a side panels toggler (both at the same time). I am curious about how you get those integer numbers that go along with the IClick command. It seems to me that interface items have internal codes, and I cannot seem to locate any info about it so I thought that gently hijacking this topic to get some info about those from marcus would not be so inappropriate.

thanks

Hi,

There’s a slider in the Preferences>Utilities menu called View Window Id (You need to mouse over it to see its title but it’s the 5th slider down, just before the ones that are all set to -8191). If you hold the cursor over an interface item then this slider will give you its ID.

For the dividers, the left is 1000 and the right is 1001. For a toggle, you don’t need to do anything in your button code other than click the dividers:

[IClick,1000]
[IClick,1001]

But if you wanted to make sure that the trays were (say) both open or closed, then you’d need to test in the same way as the ZScript Window example.

HTH,

marcus, great help. Thank you so much. How about toggleing panes like brush, alpha etc? Iclick or Ipress does not work for me.

thanks

If the palettes are in the left/right trays then you can get them to open or close but I have not found a way to move a palette into a tray. You need to add a bit of code so the ‘click’ is in the right place:

[IClick,28700,10,10]//toggle the Alpha palette