ZBrushCentral

how do you make a zplug?

the kind that you can just select from the menu. There are things on the tool menu that I use all the time and I would like to have them in a heads up display, just like i use zif edit for when manipulating the spheres.

I searched the tutorials but couldn’t find anything about actually making a plugin. Thanks for your time. and have a good day.

~~Insanity

There’s lots of information on getting started with zscripting in the ZScripting Help Forum, particularily the sticky threads.

If you simply want to create a zscript which has buttons which press interface buttons then you would use this basic form:

[IButton,"My Button","Pop up text about my button",
//commands go here, for example:
[If,[IExists,"Tool:Morph Target:Store MT"],
[IPress,"Tool:Morph Target:Store MT"]
,//else
[Note,"Button not available"]
]
//end of commands
]//end of button

In the example above, the “Tool:Morph Target:Store MT” is the button path for the interface item you want. You can find this by placing the cursor over the button while pressing Ctrl - the path is at the bottm of the popup. The [If statement is in there to check that the item exists, as many interface items are only available in certain circumstances.

Save your code as a text file (.txt) and load using the Zscript load button.

HTH,

thanks! :slight_smile: I’ll do that, I wanted make my own and didnt like having to always moving up and hitting the commands when its much easier to just have a little row of buttons on the bottom but what about sliders, like in zif edit, thats what I wanted to base it off of andto make the interface, what do I do? Its not like TVeyes left his source txt. I tried hexing the file but got gobligook.

You can do the same with sliders - there’s an [ISlider command. Check out the command reference thread for a full list (or pressing the cmd button in the ZScript palette will display them in the zscript window). Another way to find out how to use zscripting is to record a zscript and then examine the result - it’s a text file.

But, if I understand you correctly, you may be making things unnecessarily difficult for yourself. You can Ctrl+click+drag on many interface items and position them pretty much where you want. Then save the configuration (Shift+Ctrl+i) and they’ll be there next time you open ZBrush. For those buttons that you can’t drag (because they’re not on the interface at start up - Store MT is an example) you can use the Hotkey Editor to create custom buttons which can then be dragged from the ZPlugin>Custom Hotkeys subpalette to the interface.

I want to make something similar to zif edit, maybe more compact layout. Thats what I have in mind, something I can load and use whenever i need it then eventually, once the bugs are worked out I can share it. But I will take a look at the hot key editor to see if that will work.

OK, it looks like you’re going to have to learn zscripting. The Hotkey Editor won’t do anymore than create hotkeys and custom buttons but what you have in mind is more complex. Take a look at whatever zscripts you can find in uncompiled (text) format so you can examine the code. Many older posts are like that and sometimes more recent ones. It’s a lot of trial and error. Not really any shortcuts. :slight_smile:

In,

Actually, at the bottom of the post you can download the linked zif edit rev b .txt file >> HERE << which contains the source for zif edit that TVeyes kindly uploaded back when. With a little detective work you should be able to edit the file to suit.

Sven

im no alien to scripting, I do know some Ruby, so I should be able to script without much trouble. Any posts you can suggest to help me get started?

In,

The shortcut for making a ZPlug that acts as a “launcher” for existing ZScripts (like Zif Edit for instance) uses the Marcus_civis’ brilliant little utility called ZPlugMaker and the zip files include all the necessary instructions.

ZScripting Resources:
The long answer for making original ZPlugs takes a lot of digging, experimentation and examination of available ZPlug .txt files posted by other ZScripters to see what the accepted techniques are.

Some new ZScripters get it quicker than others depending on what you bring to the table from previous scripting and coding experience.

Start by checking out the ZBrush Command Reference Pages.

Also check out the ZBrush Wiki, Part 6: Zbrush Developer Corner.

  1. Details on ZScript syntax can be found inside ZBrush, itself, by pressing the Cmd button in the ZScript palette, then scrolling the alphabetized listing in the ZScript window at the bottom of the screen.

  2. A ZBCentral advanced search using the keywords ZScript Source will turn up dozens of interesting threaded discussions on ZScript topics. Mixed in with these you’ll find more than a few shared .txt files listing source code. Many are worth downloading and studying in detail.

  3. Remember too that the ZScript generator can show you how each and every button in the ZBrush interface does what it does. Many ZScripters have resolved questions of syntax by simply pressing ZScript>Record, entering a sequence of button presses and mouse clicks, then pressing ZScript>End Rec, and examining the text that was generated.

  4. ZBrush also helps you debug you code by halting the script and displaying the color-coded syntax text of your script. Many times you can pinpoint the syntax problem by scrolling to the where the listing turns black. Combine that with the error message. (Be aware though, that at times a mistake in bracket pairs will conspire to point to false debug information.)

Other ZScripters stop in regularly (Marcus and TVeyes being the most generous and helpful ones in the bunch) and willingly take time to answer basic scripting questions. Throw up a listing of the problem code and you’ll probably get an answer pretty quick.

Also, TVeyes has posted two “sticky” threads at the start of the ZScript Help forum containing good general scripting suggestions.

Here’s a link to four lessons by Davey, one of the original ZScripters. Originally, the four lessons were posted with artwork, but somehow the original artwork got lost when the format of the ZBCentral forum changed. To get the original lessons AND the illustrations, download the ZIP files found here…

Originally, ZScripting was a massive group effort - check out this list of ZScripts from way back… While they may be old, some going back to ver. 1.23, they offer lots of ideas - some outmoded, but others that are still useful today.

Sven

Nicely put together Sven :+1:

ZScripting can/does become close to second nature when the hours are put in. But as idiosyncrasies exist within the ZScripting language please do not hesitate to ask a seemingly silly question. We have all been there.

I think the greatest problem people find with ZScripting is the programflow of the script. As a script is basically executed in its entirety before being displayed on screen it is immensely important to be able to distinguish the various container commands from being either ; executed automatically (conditions may apply) or executed on activation.

In any case the entire script is executed each time it enters focus (only one script is active at any given time) and depending on the containers and code at Top Level (outside containers) certain code is executed automatically. The ZBrush Command Reference Pages does a good job of identifying the various containers, but practice makes perfect :wink:

Always great to see someone interested in the zscripting side of ZBrush. Please continue to share your thoughts and questions.

thanks everyone

TVEyes, I tried to answer your pm but you need to clear out some of your old ones to receive it.

Again, sorry about that :o

I have uploaded the XYZadjust source code in the Full ZScripts and other code thread.

I hope you know what you are getting yourself into because I cannot remember half of it :lol: Just joking, if you have any questions regarding the note interface used to display XYZadjust I will gladly answer.

To compare the Zif Edit source code (old school script) achieves much the same. Examining the two source code is difficult though as much code goes into creating the floating pop up interface of XYZadjust.