ZBrushCentral

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 usage
  4. 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.

Name :small_orange_diamond: Tiny Tools

    <b>Description</b> :small_orange_diamond: 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.
    
    <b>Terms of Usage</b> :small_orange_diamond: 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.
    
    <b>Links</b> :small_orange_diamond: The full, compiled Tiny Tools package can be found [here](http://www.zbrushcentral.com/zbc/showthread.php?t=025301). You will need that for the interface graphics.

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

    <b>Source Code :small_orange_diamond: 
 </b>

Name :small_orange_diamond: 360 Turntable

       <b>Description</b> :small_orange_diamond:This 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 <b>Preferences &gt; Utilities &gt; Temp Value</b> 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.

       <b>Terms of Usage</b> :small_orange_diamond: 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.

       <b>Links</b> :small_orange_diamond: You can find the original 360 Turntable thread [here](http://www.zbrushcentral.com/zbc/showthread.php?t=15877). 

 <b>Credits :small_orange_diamond: </b>Thanks goes to Davey for explaining the [[SectionBegin/End]](http://www.zbrushcentral.com/zbc/showthread.php?t=6144) commands.
       
       <b>Source Code :small_orange_diamond: </b>

Thanks for sharing all this! I am sure it makes it less difficult to find a start and make ones own tools. Which then, can be shared!
:+1:small_orange_diamond:+1:small_orange_diamond:+1:small_orange_diamond:+1:
LemonNado

:+1:
Pilou

Great idea! :+1:

Name :small_orange_diamond: ZNotePad

       <b>Description</b> :small_orange_diamond:This 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 <b>SectionBegin/End</b> 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 <b>ZNP_data.dat</b> file is an ordinary text file which provides characters for the Note output which would stall the script if included in the code. The <b>Settings.zvr</b> is simply the color data for the saved colors.

       <b>Terms of Usage</b> :small_orange_diamond: 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.

       <b>Links</b> :small_orange_diamond: You can download ZNotePad [here](http://www.zbrushcentral.com/zbc/showthread.php?t=25155). 

 <b>Credits :small_orange_diamond: </b>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.
       
       <b>Source Code :small_orange_diamond: </b>

this author was not credited or respected
that came up with the basic idea of the ZSC file formatt to hide source codes

http://cust13.mn1.fasturl.net/zbc/s…ead.php?t=14473

Name :small_orange_diamond: XYZadjust

       <b>Description</b> :small_orange_diamond: 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 <b>/ZStartup/ZPlugs</b> folder but can be if needed. Includes all graphics.
       
       <b>Terms of Usage</b> :small_orange_diamond: The source code provided is intended for all usages, learning being the intention. Originally inspired by [Digits' ZifWidget](http://www.zbrushcentral.com/zbc/showthread.php?t=1465).
       
       <b>Links</b> :small_orange_diamond: The thread XYZadjust originally appeared in can be found [here](http://www.zbrushcentral.com/zbc/showthread.php?t=3405). Note there are some updates available further down the thread. Updates/new version will appear in seperate thread.

 <b>Credits :small_orange_diamond: </b>Thanks to Digits for his multitude of ZScripts and inspiration. And of course many many thanks to everyone active at ZBrushCentral thoughout the years.
       
       <b>Source Code :small_orange_diamond: 

this is interesting stuff

Thank you for posting these gems. They’ll definately clear up a lot of my own confusion with zscripting. (Also, thanks for not keeping these scripts “proprietary.”)

Thank you! This is incredibly helpful.

I was busy lately and missed this. Another great idea from TVeyes.