// 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*/
other common useful zscript code
[VarDef,subtoolName,""] [VarSet,subtoolName,[IGetTitle,Tool:ItemInfo]] [VarSet,subtoolName,[StrExtract,subtoolName,0,[StrLength,subtoolName]-2]]
[VarDef,lastName,""] [VarSet,lastName,[FileNameGetLastUsed]] * message dialog <code> // add code above [MessageOK, lastName, "Last Path"] // sub tool path [MessageOK, [GetActiveToolPath], "Active Tool Path"]
[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"]]