Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
appwiki:zbrush [2016/10/20 01:17]
127.0.0.1 external edit
appwiki:zbrush [2019/11/24 19:55] (current)
ying [ZScript and ZBrush Plugins]
Line 8: Line 8:
  
   * dynamesh is good at sub-div level 4   * dynamesh is good at sub-div level 4
 +
 +====== ZScript and ZBrush Plugins ======
 +
 +  * ZScript is a script language for ZBrush automation, mainly on interface setting get and set, and button/​slider based interface interaction. It is line by line action command based script, the function is limited to what ZBrush can do, like Javascript for Photoshop Actions.
 +  * Zscript is a text file ends with "​.txt",​ by running it in ZScript menu > Load, it will compile a "​.zsc"​ file, and you can put the "​.zsc"​ file in ZBrush App/​ZStartup/​ZPlugs64 folder to let it load the script by default.
 +  * zscript cmd code reference:
 +    * http://​docs.pixologic.com/​user-guide/​customizing-zbrush/​zscripting/​command-reference/​
 +    * video tutorial: ​
 +      * MadPonyInteractive:​ https://​www.youtube.com/​channel/​UC_dWlm9jz7xc4wJQp05Nrag/​videos
 +
 +
 +  * my ZScript for render current viewport and export jpg with name of current sub tool name. <code text makeSubToolJPG.txt>​
 +// 2019.11.14 - Ying - ZBrush Make subtool jpg at same folder. and pass file to bat file to handle publish process
 +// note: it create a UI button in bottom of Tool menu
 +[ISubpalette,​ "​Tool:​zAI Plugins"​]
 +[IButton,"​Tool:​zAI Plugins:​Ying_ZB_DailyBPR2","​Press to play this ZScript. ZScript can be aborted at anytime by pressing the esc key.",
 +[ISet,​Render:​BPR Shadow:​FStrength,​1]
 +[ISet,​Render:​BPR Shadow:​GStrength,​0.75]
 +[ISet,​Render:​BPR Shadow:​Rays,​12]
 +[ISet,​Render:​BPR Shadow:​Rays,​100]
 +[ISet,​Render:​BPR Shadow:​Angle,​60]
 +[ISet,​Render:​BPR Shadow:​Res,​8240]
 +[ISet,​Render:​BPR Shadow:​Blur,​1]
 +[ISet,​Render:​BPR Shadow:​VDepth,​1]
 +[ISet,​Render:​BPR Shadow:​LDepth,​-5]
 +[ISet,​Render:​BPR Shadow:Max Dist,10]
 +[ISet,​Render:​BPR Shadow:​DistFalloff,​0.1]
 +[IPress,​Material:​MatCap White Cavity]
 +
 +[VarDef,​fileName,""​]
 +[VarSet,​fileName,​[StrMerge,​[GetActiveToolPath],"​.jpg"​]]
 +[FileNameSetNext,​fileName]
 +
 +[ISet,​Render:​BPR RenderPass:​SPix,​5]
 +[IPress,​Render:​BPR RenderPass:​Render Best Preview]
 +// [IPress,​Render:​Render]
 +[IPress,​Document:​Export]
 +[Note,"​Ying.AI Has Exported the Image for you.",,​ 3 ]
 +[NoteBar, fileName]
 +
 +[VarSet,​toolFolderPath,"​R:​\Pipeline\PyZBrush\SubToolJPGDaily"​]
 +[VarSet,​folderExists,​[FileExecute,"​R:​\Pipeline\PyZBrush\SubToolJPGDaily\ZFileUtils64.dll","​FolderExists",#​toolFolderPath]]
 +[If,​folderExists, ​
 +    [Note,"​Daily Tool Folder exists.",,​3]
 +    [ShellExecute,​ [StrMerge,"​R:​\Pipeline\PyZBrush\SubToolJPGDaily\zAImakeSubToolJPGDaily_exe.bat ",​fileName]]
 +    ,
 +    [Note,"​Daily Tool Folder does not exist.",,​3] ]
 +
 +]/*End of ZScript*/
 +
 +</​code>​
 +
 +** other common useful zscript code **
 +  * get subtool name<​code>​
 +[VarDef,​subtoolName,""​]
 +[VarSet,​subtoolName,​[IGetTitle,​Tool:​ItemInfo]]
 +[VarSet,​subtoolName,​[StrExtract,​subtoolName,​0,​[StrLength,​subtoolName]-2]]
 +</​code>​
 +  * get last file browsing file name <​code>​
 +[VarDef,​lastName,""​]
 +[VarSet,​lastName,​[FileNameGetLastUsed]]
 +  * message dialog <​code>​
 +// add code above
 +[MessageOK, lastName, "Last Path"]
 +// sub tool path
 +[MessageOK, [GetActiveToolPath],​ "​Active Tool Path"]
 +</​code>​
 +  * define a path holder <​code>​
 +[VarDef,​filePath,""​]
 +[VarSet,​filePath,"​D:​\z_sys\xTool\resZBrush\"​]
 +// set full path
 +[VarSet,​fileName,​[StrMerge,​filePath,​subtoolName,"​.jpg"​]]
 +// set only name path, then it will use zscript path as parent path
 +[VarSet,​fileName,​[StrMerge,​subtoolName,"​.jpg"​]]
 +</​code>​