User brush scripting?

Looooong shot probably, but the thread on the new flatten tool options got me thinking.

Stephane mentioned just exposing the flatten brush options to users to let them figure out what they wanted to use, rather than trying to find a perfect formula himself.

I wonder how possible it would be for Stephane to make a brush that would allow users to write their own functions for vertex manipulation. Maybe in Lua or javascript, or something. Looking at the tool code from SculptGL, the tools (for SculptGL, at least) seem pretty straightforward, implementation-wise.

Especially if the scripts could be stored in the tool JSON, I feel like there’s a decent amount of potential for experimentation and community-made tools.

Again, I’m very aware of the fact that this isn’t a small request. In my mind, even a very basic implementation of this, with vertices and weight being passed in, and vertex positions being passed back out, could theoretically let us experiment with tool functionality and save Stephane some time doing so.

Now, whether that would ever save more time than it took to implement/maintain … I have no idea. Probably not, tbh. It does seem like it would open up a lot of flexibility for users, though.

Longer-term, the ability for user tool scripts to add UI options/checkboxes for their tools could be really useful as well.

I saw this request and Stephane’s reply that plug-ins aren’t currently planned, but figured that user tool scripting might be a smaller project that could still give a lot of benefit.

Anyway, just daydreaming.


Good idea Justin - almost needs a big red tick box with a “danger” tool tag. Click it and it exposes the back end of brushes (and maybe other functions) that can then be experimented with, all whilst knowing that crashing could be imminent and there are no guarantees that your device won’t meltdown :wink:
Maybe if we find some gems whilst experimenting then we can save the brush to the tool palette and share with others. There seems to be a fair bit of this happening at the moment as people find new ways to customize within the allowed limits…maybe taking the training wheels off would produce awesome things.


Oh for sure. It would definitely need to be one of the “Debug” options for a long time, I suspect. :slight_smile:

Giving access to the existing tools’ functions would be a nice addition, too. Like, leave the base tools as they are, but if a user copies one, put the code for it (or at least, the script that gives the same results) into the copy for reference/tweaking.

I could also see users writing custom tools and selling them.

It’s too bad there isn’t (to my knowledge) some kind of tool scripting standard. Being able to make a tool that works similarly in zBrush, Blender, and even Nomad would be interesting. Of course, that’s the kind of project that’s sort of pointless to work on unless some big-name software is on board, but nobody would implement it in their software until it’s actually useful. :frowning:

(And, of course, developers like Pixologic don’t want you to be able to port their proprietary brushes over to other software)