ZBrushCentral

Curve Update Script

Hi all,

I have never scripted before but I wanted to give it a try, I was hoping to create a curve update button script (Hopefully quite a simple script to start). When you draw out curves on a surface in zbrush you have to click them to update things like imbed value or brush size, etc. Basically what I am wondering is if there is a way to update the curve through script. That way I could trigger updates to the curve as the values are changed.

The other question I have about curves is… Is there a way to copy a curve from current subtool then paste that curve onto a new subtool through script. Or Create a new subtool from that copied curve?

I had a look at these commands http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/command-reference/#Curves but not sure if these are going to help.

Any help would be greatly appreciated,
Thanks
Chris

Hi,

Welcome to the zscripting forum. A world of joy and frustration await you. :slight_smile:

Unfortunately it’s not possible to get the current curve using zscript. So you can’t create an update script, or copy the curve for use elsewhere.

The zcript Curve commands provide for creating curves from scratch. One way you could allow the user to create curves is by using zspheres, and I used this idea in the Curves Helper script here:
http://www.zbrushcentral.com/showthread.php?208308-Useful-small-ZScripts-and-Macros-for-ZBrush-4R8&p=1222584&viewfull=1#post1222584. Perhaps that will give you some ideas.

If you’ve any other questions, let me know.

Hi Marcus,

Thank you very much for the reply and your generous work with all the scripts you release!!

When you say “So you can create an update script, or copy the curve for use elsewhere.” did you mean can’t? sorry I assume you did but thought I would just check to be sure.

Is there anyway inside Zbrush to access curves through code? (not sure if scripting is the only option) If not, I wondered if there was maybe a way to make use of the frame mesh function and get a list of curve points that way? I am sorry if this is totally not how scripting in zbrush works.

Thank you for the link to the curves helper, when I started searching to see if creating scripts to do with curves was possible this was pretty much the only script I could find. Really cool script it gave me hope that a update/copy curve script might have been possible.

Basically, I had an idea for a tool/script that I think could be really useful for hard-surface designs in zbrush, So I thought I would see how difficult it would be to do a simple update/copy script, then if I managed that I would progress onto trying to create the large script/tool.

I originally planned to do a zbrush post about the process showing the steps as a tutorial style thing, but the more i did the process the more I realised it was a bit cumbersome and would really benefit from a script. (I will post some images explaining the idea, as soon as I get a chance.)

Thanks again,
Chris

Hi Chris,

Yes, a typo I’m afraid. :frowning:

There’s no way to get the ZBrush curve points through code. ZScript is all there is and that can’t do it. That’s why in my Helper script I use zspheres - you can get there positions and use those to generate a curve.

Unfortunately the only other way to get mesh point positions is to export an OBJ file and examine it in a custom DLL or some other way. Not impossible but it involves a bit of work!

HTH,