If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Code Sample: Full ZScripts and other code

This thread is to share source code, be it source code for full ZScripts/ZPlugins, a [RoutineDef,...] you find useful or C/C++ code for ZBrush <> .DLL/.LIB interaction. If your code makes something easier to achieve in ZScripting or you simply want to share what you have made then please post it here. Everybody will learn from it, most likely also the author.

If you have questions about the supplied source code you should either contact the author or start a new thread. You should not post questions in this thread. If you start a new thread please supply a link to the source code posting in this thread. Do not post the source code in another thread.

Any source code posted should be followed by a terms of usage statement. Source code for scripting languages are generally not ground breaking in their implementation but their function may be. The author should reserve the right to require certain conditions be met for use of the source code (see my Tiny Tools source code entry below for an example).

The terms of usage statement is entirely up to the person who posts the source code. People who make use of said source code should respect the wishes of the author.

There should be nothing legally binding when using/examening/modifying another persons source code from this thread. But please respect the authors wishes as stated in the terms of usage. A single misuse of source code will most likely stop everyone from posting in this thread. So please, please read the terms of usage and think before you post a modified version of a ZScript/ZPlugin. Do not think afterwards "was that part of the terms of usage?". If in doubt then contact the source code author.

When posting source code you should include the following information:

1) A name for the source code.2) A brief description of the source code's function. 3)Terms of usage4) A link to the full ZScript/ZPlugin if available or a source code related topic. Any source code related link(s) is ok.5) Optional credits.6) The link to the source code or the source code itself.

I should note that I am not the first to post source code, many ZScriptors did that for a long time and I am very grateful for that. I would not have learnt ZScripting without the help of people like Digits, Cameyo, Davey, Muvlo, WingedOne, Svengali and Marcus_Civis (I am sure I have forgotten somebody, sorry)

So to conclude: This thread is aiming to create a one stop list of source code for zscriptors. Please respect each source code authors terms of usage and this thread will one day be very long.

Tiny Tools source code

Description The source code is the full version of the Tiny Tools ZPlugin pack. It is not commented but should be easy enough to follow for the seasoned ZScriptor. Knowledge of ZScripting required.

Terms of Usage The source code provided is intended for educational purposes only. Please do not post a modified version of Tiny Tools or any version based on this source code offering the same functionality as Tiny Tools. I will post changes to Tiny Tools myself. If you have a working ZPlugin of Tiny Tools that you think is better than my original then please contact me first. I will then post that version myself.

Links The full, compiled Tiny Tools package can be found here. You will need that for the interface graphics.

Credits Thanks to Marcus_Civis for helping me with the Shift+click functionality. I would never have got it working for ZPlugins without him.

360 Turntable source code

Name 360 Turntable

DescriptionThis is the ZScript code for the 360 Turntable ZScript. It shows a neat graphical interface by using a single [Image,...] and multiple [SectionBegin,...] and [SectionEnd] commands for buttons. The Zscript also shows how to update an image in the Tutorial Window by reloading the ZScript and using the Preferences > Utilities > Temp Value sliders.

The ZScript was designed for 1.55b so you should add an [IConfig, 1.5] to the start of the source code in order to make the background display correctly.

Terms of Usage There are absolutely no strings attached. If you want to modify this source code and post it then be my guest. Do whatever you want with the code but I will soon be making a new version.

ZNotePad source code

Great idea!

Name ZNotePad

DescriptionThis is the source code for my ZNotePad script. There are a number of things which may be of interest to zscripters who are prepared to wade through the 4000 lines of code. The core functionality - being able to enter text from the keyboard - is provided by using the hotkeys assigned to hidden buttons. The display is updated using the same technique outlined in Davey's thread on SectionBegin/End commands that TVeyes has mentioned above. The text-enter method could be adapted for whenever an alternative to the rather limited StrAsk command is required (although, as it's not currently possible to capture keystrokes while displaying Notes, output has to be in the ZScript window).
The script requires a number of files to run, available in the original download (link below). The ZNP_data.dat file is an ordinary text file which provides characters for the Note output which would stall the script if included in the code. The Settings.zvr is simply the color data for the saved colors.

Terms of Usage The code should not be copied in its entirety or used for a script which provides similar functionality (i.e. outputting Notes); otherwise it may be used freely for whatever project a zscripter wishes.

Credits This code is posted in the spirit of collaboration that is special to ZBC. I've learnt from looking at the code of others, in particular: Pixolator, Davey, Digits, Muvlo, Cameyo, TVeyes and Svengali.

XYZadjust source code

Name XYZadjust

Description The source code is the full version of XYZadjust. It is not commented but should be easy enough to follow for the seasoned ZScriptor. Knowledge of ZScripting required. It is not designed to be placed in the /ZStartup/ZPlugs folder but can be if needed. Includes all graphics.

Terms of Usage The source code provided is intended for all usages, learning being the intention. Originally inspired by Digits' ZifWidget.

Links The thread XYZadjust originally appeared in can be found here. Note there are some updates available further down the thread. Updates/new version will appear in seperate thread.

Credits Thanks to Digits for his multitude of ZScripts and inspiration. And of course many many thanks to everyone active at ZBrushCentral thoughout the years.