1. #1

    Default Question: Launching ZBrush and running a ZScript through a batch?

    Separating complex objects and manually exporting the various pieces can become a long process to manage. I would like to automate this process on our render farm using the extra ZBrush licenses that we have. Is there a way to automatically launch ZBrush and run a ZScript through a batch command so that our render farm manager could automatically manage the export of many objects on multiple machines and be informed when the process is done so the render manager can launch the next phase of processing that exported data?

  2. #2
    Moderator User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    7,652

    Default

    ZBrush can be launched from a BAT file provided the full path is used:
    Code:
    @echo off
    start "" "C:\Program Files (x86)\Pixologic\ZBrush 4R2\ZBrush.exe"
    The DefaultZScript.txt (\Pixologic\ZBrush 4R2\ZScripts\DefaultZScript.txt) runs on startup, so you can use that either to carry out commands directly or launch another zscript (which may be easier to manage). For example, if you edit the DefaultZScript like this:
    Code:
    //startup
    [If,1,
    [FileNameSetNext,"DoItZScript.txt"]
    [IPress,ZScript:Load]
    ]
    [pd]
    it will then launch a zscript named "DoItZScript.txt" which resides in the same folder. That zscript might contain code something like this:

    Code:
    [If,1,
    [IPress,Tool:PolyMesh3D]
    [FileNameSetNext,"C:\Program Files (x86)\Pixologic\ZBrush 4R2\ZExportImport\PolyMesh.OBJ"]
    [IPress,Tool:Export]
    [IPress,CLOSE]
    ]
    which will export the PolyMesh3D Star, then close ZBrush. (Note that in the above example the code is wrapped in an [If...] statement that is always true so that second level commands can be used without the need for a button container.)

    Note also that you cannot run or set options for another plugin/zscript from within a zscript without control passing to the second plugin/zscript. In other words, you can't get your script to, for example, assign UVs using UV Master then export maps using MultiMapExporter.

    HTH,

  3. #3

    Default

    OK. Great! I think I can work with that. I'll look into it and let you guys know if I have any other questions/blocking. Thank you for the information. Much appreciated.

    -Mathieu

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •