Hi Marcus,
Thank you! I have been browsing this forum for a while and have seen you are the one that can answer all questions.
Unfortunately, im not allowed to share any of the code as i am under NDA. If i can just get the functions working in a separate script, then im sure with my technical skills i can extrapolate the right approach for my NDA script.
Basically, what i did was the following:
- I copied and pasted the ‘setting up the dll’ code into a new script.
- I tested it out
- It gave me the error
This is my new not NDA code:
[RoutineDef, CheckSystem,
//check ZBrush version
[VarSet,Zvers,[ZBrushInfo,0]]
[If,[Val,Zvers] >= 2021.0,
[Note,"\Cff9923This zscript\Cffffff is not designed for this version of
\Cff9923ZBrush\Cffffff.",3,4737096,300]
[Exit]
]
[VarSet,isMac, [ZBrushInfo,6]] //check Mac or PC
// Make sure we have the dll and set its path
[If,[ZBrushInfo,16]==64,//64 bit
[If,isMac,
//use the path below for testing only
[VarSet,dllPath,“MyPluginData/ZFileUtils.lib”]
//use the path below for installed plugins
//[VarSet,dllPath,“ZBRUSH_ZSTARTUP/ZPlugs64/MyPluginData/ZFileUtils.lib”]
,
//use the path below for testing only
[VarSet,dllPath,“MyPluginData\ZFileUtils64.dll”]
//use the path below for installed plugins
//[VarSet,dllPath,“ZBRUSH_ZSTARTUP\ZPlugs64\MyPluginData\ZFileUtils64.dll”]
]
,//else 32 bit - no longer supported
[Note,"\Cff9923This zscript\Cffffff is not designed for this version of
\Cff9923ZBrush\Cffffff.",3,4737096,300]
[Exit]
]
[If, [FileExists, [Var,dllPath]],
//check that correct version
[VarSet, dllVersion, [FileExecute, [Var,dllPath], Version]]
[If, [Val,dllVersion] >= 8.0,//dll version
//OK
,//else earlier version
[Note,"\Cff9923Note :\Cc0c0c0 The \Cff9923 ZFileUtils plugin \CffffffDLL\Cc0c0c0 is
an earlier version which does not support this plugin. Please install correct version."]
[Exit]
]
, // else no DLL.
[Note,"\Cff9923Note :\Cc0c0c0 The \Cff9923 ZFileUtils plugin \CffffffDLL\Cc0c0c0 could
not be found at the correct location. Please re-install the plugin, making sure the
relevant files and folders are in the \CffffffZStartup/ZPlugs\Cc0c0c0 folder."]
[Exit]
]
]//end routine
[IButton,SubtoolRename,“Rename selected subtool”,
[RoutineCall, CheckSystem]
[Note, “0”]
[VarSet,newName,“My New Name”]
[VarSet,buttonPath,“Tool:SubTool:Rename”]
//set buttonPath to the button you want
//“Tool:SubTool:Rename” - for SubTool
//“Tool:Layers:Rename” - for Layers
//“Preferences:Transpose Units:Set Units” - for Transpose Units
[If, (([IExists, buttonPath]) && ([IsEnabled, buttonPath])),
[FileExecute, [Var, dllPath], RenameSetNext, newName]
[IPress, buttonPath]
[Note, “1”]
]
]//end button
its basically just the samples of website strung totgether 