creating zplugins

i was wondering if there was any specific way to make zplugins (not zscripts, as in something like zketchpad or zmapper)

do you need to program these in C++ or can you use the same language as zscript. either way can someone point me to a tutorial that explains what exactly you need to do if you do it in C++ (yes i can code in C++) or how you can make them using the zscript language

thx for any help ~knightmare[img]http://www.moviesonline.ca/forum/images/smilies/shuriken.gif[/img]

edit- also can someone tell me how to compile a txt file into a zsc file

Zketchpad was created with the ZScript language. You’ll find plenty of info in the ZScripting Help forum covering what you need to know to convert your script to a plugin.

ZMapper was created using DLL’s, so would have been programmed with a form of C. It is still partially written with the ZScript language, though, which then calls the DLL at the appropriate time.

As for how to get the .zsc, it’s easy – just load the .txt version into the ZScript palette. ZBrush then automatically creates a .zsc version in the same folder.

ahhh ok.

now i have one last question.

can you use zscripts (you should consider calling the language Z++:cool:) to do basicly anything, just like in C++ .

i mean, are there conditionals, variables and ways to add an entire pallete and create buttons in palletes and use image files and create entire functions that can do completely new things, or are you limited to making them press buttons, add notes, and configuring the UI?

check out this thread and the link as well as this whole forum…most of your questions are answered here.

that answered just about everything except, can you create your own functions and can you create entire palletes?

You can create new subpalettes, even of the interface itself. Check out this thread for some interesting information on that. As to creating your own functions, that is possible to a degree but is restricted by the data available to zscripts. In other words, you can get data by querying interface items or from specific zscript commands but if the information you need is not available that way then that’s pretty much it. So, for example, it is not possible to manipulate the individual points of a model in edit mode.

well im about to write my own function. i was looking through all the zscript tutorials all last night and its actually extremely easy.

after examining the zanimator plugin i noticed that sometimes you need refrence library files like in c++ (dll files), so that gave me the idea of writing a dll in C++ that adds the [include] function to Z++ and then ill write a .zll compiler (using the same encryption as a dll just with Z++ scripts in it rather than C++)

tell me what you think of that idea, if noone wants it i wont release it, but im definately using it for the animation plugin im gonna write.

If you are referring to the <zscriptinsert> command then what you suggest is not necessary. ZBrush is not using a reference library file. The command simply inserts any zscript .txt file at that point. Some zscripters use it as a way of keeping things organized but the end result is no different from cutting and pasting the code there. Once compiled there is only one .zsc file and you don’t need any of the inserted .txt files after compiling.

Certainly writing dlls for calling from zscripts can increase their functionality, although without an SDK it’s not possible to write something like ZMapper.

I’m sure many people would be interested in seeing what you come up with. Several of the zscripters here have played with ZB animation ideas, including myself.

I think you should apply for that SDK Job Pixologic has on their Website.



I agree with lemonado, marcus has the pixologic esprit.
Lets poke him and see. jab jab jab

:eek: :eek: :eek: :smiley:

Actually, I did write and ask about it some time ago. I was told the post had been filled (I suspect by the person who wrote the excellent ZMapper manual). I don’t think that means there’ll be an SDK any time soon as that’s not likely to be high priority… I guess the sit vac web page just got forgotten about - I think it’s been there about 2 years. Or Pixologic are keeping their options open. :slight_smile:

Bah, I’m sad now, in the 30 minutes I had to imagine the scenario, I’d given you the job, flown you out to San Fran, Set you up in a nice house like Tom Cruise in “The Firm” and was about to “Show you round the Lab” at Pixol HQ. And that’s when cold reality set in. Ah well.

(Wonders how to set about making an Ofer action figure.) :smiley:


One command you might want to look at:

[FileExecute, File name including the extension (such as plugin.dll), Routine to Call, Optional text input, Optional number input, Optional memory block input, Optional memory block output ]

example from theZScript/Cmd listing in ZBrush2

[FileExecute, PluginTest.dll, ShowMsg, "Hi There" ]  

This would execute the ShowMsg routine of the PluginTest.dll plugin.

Several people (Not Me) have experimented with creating and executing .dlls from within ZScripts with some success. If any of those scripters read this thread, maybe they’ll add their own comments…

Actually, the information about implementing the FileExecute command is kinda skimpy but you should be able to solve the passing of data through some simple tests. Oh, and please post any info and/or code you discover that you’d be willing to share? :slight_smile:


sure no problem. and im not just going to limit this programs functionality to compileing .zll (thats what i will be naming them) files. It will also be able to write and preview zscripts, but unfortunately not be able to compile them to .zsc files (unless pixolator is ok with me reverse engineering zbrush), and if i can make this work i have proved that zscript functions can be written in C++ and compiled into a dll file that a zscript using the function can rely on, which would then lead me to have the ability to write your own functions with this compiler.

as for the encryption on zscript library files, i would make it a very similar encryption as a dll file except that it would compile with zscript data.

this is all an idea as of now so no promises, im only 15 after all (but i still managed to learn C++ over the last 2 and a half years :slight_smile: ).

after looking into this i discovered that what i am really going to make is an ide for zscripts that wil just be able to check the script for errors. there is no need for zll files or new functions, if you would want to do something outside of zbrushes boundries you would need to write it as a dll file. also the whole preview thing (and the compiling zsc files) wouldnt work unless i got a few of my reverse engineering buddys to help me find out how the zscript files run through zbrush, or just use the sdk which is available to developers only.

so all you guys will be getting is an ide which can check errors and my animtion plugin that i am making.