ZBrushCentral

How to save Focal length settings?

Hello,

I have tried to save as start up document, store config, save UI but no matter what I do my perspective focal length settings keep resetting?

Can someone please tell me how to save them permanently?

Thank you!

Hello @Samsam2020

You can record a Macro of changes and then get it to run automatically every time you start ZBrush.

Recording your Macro

  1. Record the Macro with all your settings.
  2. Save the macro to the ZStartup\Macros\Misc folder and name the file StartupMacro.txt. You should now have a new button called StartupMacro in the Misc submenu of the Macro menu. Press the ‘Reload All Macros’ button if you don’t see it.

Getting the Macro to run automatically when you start ZBrush

In the ZBrush 2021.6.1/ZScripts folder you’ll see a file called DefaultZScript.txt . Open the file with Notepad and add the following line.

[If,1,[IPress,Macro:Macros:Misc:StartupMacro]]

Save the file. Restart ZBrush.
It is important that the code for the DefaultZScript.txt file is correct and that you have named and saved your Macro in the proper folder as I indicated above. If you get an ‘Interface item can not be found’ error when you start ZBrush, then you have made a mistake somewhere.

1 Like

@zber2 I had bad border effects when using [If, 1,… ], because 1 is always True so the cmds will always be executed, like when you press init Zbrush.

So the best way to edit the DefaultZscript.txt is described [here]
(Getting Started with ZScripting)

so what your edited DefaultZscript.txt should look like that, just change the 50 with the value of you choice :

//startup

[If,[MemGetSize,startup_mem],

    [IPress,"Zplugin:Misc Utilities:Home Page"]

    ,//else
    [IPress, "Tool:Polymesh3D"]
    [ISet, "Draw:Focal Length(mm)", 50]

    [IPress,"Zplugin:Misc Utilities:Home Page"]

    [MVarDef,startup_mem,1,0]    

]

Hope it helps!
Nicolas

2 Likes

@facelessmindz

Thanks for that Nicolas, but the problem is that a parametric primitive has to be selected first before the subpalette that contains the Focal Length slider becomes active. otherwise it can’t be changed. That’s why I thought a Macro would be the way to go. If you can do a script for the DefaultZScript file that would compensate for that, it would be great.

Here’s a little plugin that will allow you to set a startup project. The Perspective Focal Length setting will save with the project. For example, I have used the plugin to set my startup project as the “DefaultProject.zpr”.

StartupProject.zip (2.5 KB)

To install:

  1. Download the file and unzip to your Desktop.
  2. Copy the StartupProject.zsc file to the ZBrush 2021\ZStartup\ZPlugs64 folder.
  3. Restart ZBrush.

To use:
The plugin adds a new button called “Set Startup Project” to the Zplugin>Misc Utilities sub-palette. Press the button and you will get a file dialog to select the file you want to use.
Important If you cancel the file dialog without selecting a file, and you had previously set a startup project, this will no longer be loaded when ZBrush starts - in other words startup is reset to the factory default.

HTH,
Marcus

1 Like

actually even if the focal length is disabled (greyed) it will change the value to the one defined in the script :smiley:

but to be honest i do prefer the Marcus’s approach, make a plugin with no UI and put it into Zplugs64 directory then load it from ZBrush zscript load button, then it should always run at startup if the zscript compile well.

Yes, it works much better now that you added the “[IPress, “Tool:Polymesh3D”]” statement. :wink:

Thank you!

Thank you for the script!

1 Like