Are there any command line arguments I can pass to zbrush.exe that will allow me to run an arbitrary script at startup?
I’m able to launch ZBrush from the following simple C# application, but I’m unable to have my script run on startup. I’m trying to deploy this C# application and zscript (myscript.zsc) to other people on my team, and I don’t want to have to change everyone’s “startup script” on their local install of ZBrush. I’d like to launch Zbrush and have it execute the script I specify on startup.
In the following code, scriptPath is used as an argument for System.Diagnostics.Process.Start().
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
namespace CreateHeadAssets
{
class Program
{
static void Main(string[] args)
{
string zbrushFolder = @"C:\Program Files (x86)\Pixologic\ZBrush 4R4";
string zbrushExe = "zbrush.exe";
string scriptPath = @"C:\Users\dauclair\Desktop\myscript.zsc";
FileInfo script = new FileInfo(scriptPath);
if (!script.Exists)
{
System.Console.Out.WriteLine(string.Format("{0} does not exist
", scriptPath));
}
Process.Start(zbrushFolder + @"\" + zbrushExe, scriptPath);
}
}
}
I’ve seen some ShellExecute examples from some other posts, but I really need to deploy this as a C# application, as it will be integrated into a much larger C# application that does a bunch of other things in our pipeline.
Example ShellExecute command from another post:
#include <windows.h>
static const char *zbrushFolder = "C:\\Program Files (x86)\\Pixologic\\ZBrush 4R3";
static const char *zbrushExe = "zbrush.exe";
static const char *scriptPath = "C:\\Users\\Mark\\Desktop\\TestZScript.zsc";//if just a file name then ZBrush will look in the default location 'ZScripts'
int WINAPI
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
ShellExecute(NULL, "open", zbrushExe, scriptPath, zbrushFolder, SW_SHOWNORMAL);
return 0;
}
Any help would be most appreciated!