hey! Just hat time to tackle this problem and I came up with a somewhat different solution. Just thought I’d share it here.
In my case I have now 3dsmax export the selected objecto a obj file. This file could be called Teapot01.obj, Sphere.obj, or whatever name the selected object in 3dsmax had.
So I have made 3dsmax export also an obj_name.txt
(That txt file has always the same name)
In it, though, I have the name of the object, which will tell zbrush what obj it has to look for.
[MemDelete, gomaxObjNameTxt]
(This string deletes the memory block, just in case it already exists in memory, you never know)
[VarDef, GomaxObjName, " "]
(This is creates the variable GomaxObjName, wich we will later on use to archive the string that we got from the txt file)
[MemCreateFromFile, gomaxObjNameTxt, “ZBRUSH_ZStartup\ZPlugs\GoMax\Import\obj_name.txt”]
(Creating the actual memory block from the txt file and giving it the name "gomaxObjNameTxt)
[MemReadString, gomaxObjNameTxt, GomaxObjName, 0, 1]
(I’m reading the string, which starts at 0, and I’m assigning it to GomaxObjName, which we created before. The “1” at the end means it reads until the line breaks)
[FileNameSetNext,[StrMerge,“ZBRUSH_ZStartup\ZPlugs\GoMax\Import”,GomaxObjName,".OBJ"]][IPress,Tool:Import]
(Finally I’m importing the obj, and I’m using "GomaxObjName variable instead of a fixed name)
[MemDelete, gomaxObjNameTxt]
(I’m deleting the memory block, since I don’t need it anymore)