script to import from file names / directory

Hi I was wondering if there’s way to expand upon subtool master, or en extra script, that would be able to import multiple models back into each subtool ? I have a set of mel scripts in Maya that read in exported subtools for tweaking, and then I save them back out again to the same file name. Just want to refresh my subtools to read that back in.

I know GoZ can do this already, but we use Windows Zbrush and Linux Maya (on a different machine, or another user), so I’m using a set of MEL tools on the Maya end of things.

Anyway I can emulate how goZ works with a custom script to loop through files and import them for each matching subtool ?



In principle this isn’t too difficult. In pseudo code you would:

  1. Get the path to the folder where your files are.
  2. Get the name of the first subtool and concatenate it with the path & extension to form the file name.
  3. See if there’s a file of this name in the folder.
  4. If there is a file, go to the relevant (presumably lowest) subdivision level of the subtool and import the file.
  5. Repeat for all subtools.

For (1) you can either hard code the path or use a text file which is read by the zscript.

For (2) you would do something like:

[VarSet,subToolName,[IGetTitle,Tool:Item Info]]

For looping through the subtools you can adapt this macro: http://www.zbrushcentral.com/showthread.php?94752-Useful-small-ZScripts-and-Macros-for-ZBrush-4-amp-4R3&p=798045&viewfull=1#post798045

Let me know if you’ve any other questions,