ZBrushCentral

Customized curve and other settings don't load at startup

After getting the ZBrush interface set up the way I want, saving it as a startup document, and using CNTRL+ SHIFT+ I to save my layout… I find that some of my settings still don’t load automatically at startup. These are:

  • a customized transform curve
  • Accurate Curve Mode to on
  • Mouse Average set to 4

As it is right now, I have to manually set these atributes each time I launch ZBrush. Any help in resolving this would be greatly appreciated!

As you have found out those settings are not saved in the Zbrush Config. Individual and global tool settings are reset to default upon loading Zbrush. But by modifying the DefaultZscript.txt located in the /Zscript directory, you can accomplish what you want.

For the Transform > Modifiers > Smoothing Curve you should save your desired curve with the save button below it and place the file in the /Zcurve directory. Open the DefaultZscript.txt file in a text editor and add the following lines to the start of the file: [FileNameSetNext, "ZBRUSH_Zcurves/yourzcurvefilename.zcv"] [ISet, Transform:Modifiers:Smoothing Curve, 1] [ISet, Transform:Modifiers:Smoothing Curve:Load, 1] For the Transform > Modifiers > Accurate Curve Mode add the following: [ISet, Transform:Modifiers:Accurate Curve Mode, 1] For the Stroke > Mouse Input Average Count add the following : [ISet, Stroke:Mouse Avg, 4] Just make sure the last last line of the DefaultZscript.txt file is [pd], for future compatibility.

This might seem a long winded approach and to a degree it is. But this action only needs to be taken once and if you examine the code you can see it is pretty simple. With some further zscripting you can create buttons that set up all kinds of Zbrush environments which you can flick through by clicking a button or pressing a key. However this is still very much a user option and you are bound to encounter a couple of zscripting problems on the way.

Make use of the zscripting forum to post questions or PM somebody for answers. You are sure to understand zscripting in the end.

On a related note: Materials, lighting, render settings and document size can be stored by saving the document as “StartupDocument” and placing it in the /Zstartup directory. (Note: Materials are only saved with a document if they exist on the canvas). The next time Zbrush loads it will use this document and its settings.

Edit: I can’t read apparently, you knew about the StartupDocument.

TVeyes,
Thanks so much for the fast reply! I added the script to the defaultzscript.TXT and got some partial success. The Accurate Curve Mode on and Mouse Average 4 work fine, but the curve won’t load. When I start up ZBrush I get an error message that reads:

ZScript Note: Insufficient inputs.
[ISet, Transform:Modifiers:Smoothing Curve:Load]

So I’m assuming it doesn’t like this line for some reason…

Any ideas?

Great tips TV!

Booska, try this…

Instead of the command line:
[ISet, Transform:Modifiers:Smoothing Curve, 1]

substitute:

[IClick,1070]

This should give focus to the curve (whose WindowID is 1070)

Also, I think the line that follows needs to read:

[IPress, Transform:Modifiers:SmoothingCurve:Load]

Sven

Still not loading…

I notice that the script is trying to call up the Startupcurve.zcv file into the Smoothing Curve attribute. I actually want to load it into the Edit Curve attribute, so I made that change to the script. But I’m now wondering if these are even the right names. When I hold the mouse over the curve windows they change to read “Edit Fade-Off Curve” and “Smoothing Fade-Off Curve” respectively. Which name should be used for the script?

Also, shouldn’t the path,
[FileNameSetNext,“ZBRUSH_Zcurves/Startupcurve.zcv”]
instead read,
[FileNameSetNext, "ZBRUSH2_Zcurves/Startupcurve.zcv"] ?
I’m looking at the ZScripting Forum for more info and am trying a few different things. If you have any more ideas, I’d appreciate anything you can pass along…

Sorry booska,

I did test it and it works but I did not edit my post properly. Insert the code from my original post and it willl work (I have edited it). Sorry again:o.

I missed a slight ",1" in the third line. Means all the difference. Hi Sven,

I recentlly discovered that iset commands are not picked up by the ShowActions setting. [ISet,…] has other advantages in that it can be used outside of containers which is especially useful in the DefaultZscript.txt as it can get crowded with [If,…] statements rather quickly.

The code from my first post works. The [ISet, Transform:Modifiers:Smoothing Curve, 1] is needed to activate the transform smooth curve. The buttons below curves are the same across all curves in Zbrush, but none of them exist before a curve is selected and then only the buttons beneath the curve that was selected exists.

I am not sure if [ISet,…] can be used as a complete replacement for [Ipress,…] but it seems like it.

Thanks, TVeyes. That works perfectly!

So for anyone who wants to load these settings at startup:

  • a customized transform curve (in my case, into the Edit Curve window)
  • Accurate Curve Mode to “on”
  • Mouse Average set to 4

This is the script for you:

[FileNameSetNext, “ZBRUSH_Zcurves/yourzcurvefilename.zcv”]
[ISet, Transform:Edit Curve, 1]
[ISet, Transform:Edit Curve:Load,1]

[ISet, Transform:Modifiers:Accurate Curve Mode, 1]
[ISet, Stroke:Mouse Avg, 4]

[pd]//ZBrush default ZScript

I’ll go ahead and post this to the Scripting Forum as well…

Thanks again!

TV,

I should start using the ISet command everywhere then, I guess. :slight_smile: Should take a look at old scripts as well…

If there is any downside to using it, I’ll find it, guaranteed!

The [IClick,…] command was what I used with the curves in the Adjustments menu, but there too, I suppose the ISet command will do. Good to know.

thanks, Sven

Booska,

FYI:

To find the correct path to any interface element, hold cursor over the element (button, curve window, slider, whatever) and press the Ctrl key. You’ll find the proper button path syntax at the bottom of the popup Help window.

You can also use the interface element’s WindowID, instead of the path, in a command (however ID numbers make your script a bit more opaque - i.e. harder to understand a week later.)

You can find the ID for any interface element by looking at the readout in the Preferences:Utilities:ViewWindowID slider. Drag a copy of the the slider out onto your interface, then move your cursor over any element in the interface to affect the slider readout.

As to the ZBRUSH_ vs ZBRUSH2_ path question, to work, it must be ZBRUSH_. It seems to me to be an undocumented feature from previous versions that Davey shared in another thread.

Sven

Sven, I said that [Iset,…] is not picked up by ShowActions. I was wrong. Not sure how I got to that conclusion. I think someone borrowed my other brain cell yesterday.:slight_smile: