ZBrushCentral

Startup Script

When use in 2.5, I’m include one script to “defaultzscript.txt” to setup default parametrs (like texture resolution), all easy and understandable.
(<zscriptinsert,“file.txt”>)

But in Z3 is more confuse and I cant include scripts, but solve it in splash .txt editing.
…In Z3.1 is ether more, that splash initialization file gone (!?)

Íîw can setup brush setting and other defaults in my script at program start now?

You are right that the defaultzscript will no longer load stuff at start up.

I don’t suppose you are the only one who would like to set some start up settings. I need to explore the possibilities but I will get back with a solution to this as soon as I can.

Nope, he is not the only one :slight_smile: In fact, I’m fairly certain a large percentage of the user base would like to be able to edit startup settings. Looking forward to your progress Marcus and thanks for looking into it man!

ZPlugins are still executed when ZBrush starts and before the DefaultZscript.txt so it is possible to write a .txt Zscript, compile it and place it in the ZBrush3/ZStartup/ZPlugs folder.

I posted a zplugin that sets the current material upon startup [&gt;&gt; here &lt;&lt;](http://www.zbrushcentral.com/zbc/showthread.php?t=49645). So it does work and I cannot see where any harm to stability could come from. It is after all just a compiled zscript and besides these startup scripts are highly individual, so no need to have two or more.

In order to make the script work there is extra code needed. This is to ensure the scripts UI state changing code is executed only once.


    [If, [MemGetSize, yourMemoryBlockNameHere], //returns 1 or greater if memory block exists.
    //do nothing if Mem size > 0
    , 
    //if Mem size = 0
    [MemCreate, yourMemoryBlockNameHere, 1]
    
    // insert your startup script commands here
    [Iset, Draw: Draw Size, 128] //for example
    
    ]

I find it best to create the zscript .txt file in the ZScript folder to modify and reload it from there. When you are satisfied with the changes your script produces move the .zsc version to the ZBrush3/ZStartup/Zplugs folder and restart ZBrush.

If someone had the time and inclination he/she could possibly write a zplugin that examines all values not saved by the config and set those values at startup.

Btw, Marcus, I seem to remember you had another way of running code only once. Was it the ZBrushInfo timer value?