Home Technical Talk

[Zbrush] Is there a way to batch save each subtool as its own ztool?

polycounter lvl 12
Offline / Send Message
BARDLER polycounter lvl 12
I have a bunch of concrete, brick, rubble, and junk subtools in my scene. I want to make each one its own unique ztool so I can create a tileable document with them. I can't find away to just batch export all my subtools into individual ztools which would save a ton of time.

Thanks for your help!

Replies

  • a3sthesia
    Options
    Offline / Send Message
    a3sthesia polycounter lvl 10
    I haven't got ZBrush setup on this machine at the moment, but I think it's something like, polygroups (Auto might be enough), so that you have each item that you want as a tool, as it's own polygroup. Then you should be able to seperate all the polygroups...no wait, bugger this, i'm going to open ZBrush on another machine...brb...

    Yeah! so, use polygroups, then under your subtool menu, use split >> group split. That should append them all into their own subtools. Then you can use subtool master to export/save them all out as OBJ's or whatever.

    Let me know if that was the solution ;P
  • BARDLER
    Options
    Offline / Send Message
    BARDLER polycounter lvl 12
    a3sthesia wrote: »
    I haven't got ZBrush setup on this machine at the moment, but I think it's something like, polygroups (Auto might be enough), so that you have each item that you want as a tool, as it's own polygroup. Then you should be able to seperate all the polygroups...no wait, bugger this, i'm going to open ZBrush on another machine...brb...

    Yeah! so, use polygroups, then under your subtool menu, use split >> group split. That should append them all into their own subtools. Then you can use subtool master to export/save them all out as OBJ's or whatever.

    Let me know if that was the solution ;P

    Thanks for the post but that isn't exactly what I need to do. I don't know if the way I explained it was weird, but I have 25 sub tools in my scene of various junk and rubble. I want to make a tileable texture using the draw mode in a Document and dragging individual ztools into place. I don't think it will let you use insert mesh brushes or subtools in draw mode.

    What I want is to be able to take all my subtools and save each one as a unique ztool with a click off a button. The fastest way I figured out how to do it was export out all my subtools as an obj, import into maya, separate the meshes, rename, batch export each mesh as an obj. Then in zbrush go to the ztool box, click import, pick the first obj, then click save tool, and then go down the list with each one until they are all done.

    Hope this clears up what I was talking about. :D
  • a3sthesia
    Options
    Offline / Send Message
    a3sthesia polycounter lvl 10
    aw sorry Bardler. I remember during one of David Lesperance's workshops that he mentions there not being an easier way to do things like that, followed by a chorus of forum posts about people wishing Pixologic would add this feature. That was about a year ago, and I'm not sure anything has changed. Fingers crossed someone knows another way....
  • cryrid
    Options
    Offline / Send Message
    cryrid interpolator
    I think it would be faster to just work with a single tool consisting of several subtools. You'd just have to enable Solo mode, use N to quickly pick the subtool you want from a menu similar to the IMM brushes, and ctrl+s to snapshot it on the document. I think it would be quicker to populate a canvas this way, and you'd only have to switch between edit modes when panning the document.

    If you still wanted each subtool to be a separate tool, then using the clone button along with the above would make shorter work out of it as well. Select subtool, clone, select subtool, clone, etc. A macro could make even quicker work of it I'm sure

    Edit 3: There we go:
    [Loop,[SubToolGetCount],
          [SubToolSelect,[Val,n]]
          [If,n>0,
            [VarSet,subToolPath,[IGetTitle,Tool:Item Info]]
                          ]
          [IPress,Tool:Clone]
      ,n]
    

    Bind it to a button, or run it as is
  • BARDLER
    Options
    Offline / Send Message
    BARDLER polycounter lvl 12
    cryrid wrote: »
    I think it would be faster to just work with a single tool consisting of several subtools. You'd just have to enable Solo mode, use N to quickly pick the subtool you want from a menu similar to the IMM brushes, and ctrl+s to snapshot it on the document. I think it would be quicker to populate a canvas this way, and you'd only have to switch between edit modes when panning the document.

    If you still wanted each subtool to be a separate tool, then using the clone button along with the above would make shorter work out of it as well. Select subtool, clone, select subtool, clone, etc. A macro could make even quicker work of it I'm sure

    Edit 3: There we go:
    [Loop,[SubToolGetCount],
          [SubToolSelect,[Val,n]]
          [If,n>0,
            [VarSet,subToolPath,[IGetTitle,Tool:Item Info]]
                          ]
          [IPress,Tool:Clone]
      ,n]
    
    Bind it to a button, or run it as is

    Thank you! I will try both of these things when I get a chance.
  • Strkl
    Options
    Offline / Send Message
    Strkl polycounter lvl 7
    Hey, I tried to make a script doing this, it's my first contact with zscript, it may not be perfect (far from it ! :p)

    the ztls will be save in the location of the script .txt file, I don't know how to change that yet ^^
    [VarDef, SubToolNumber,0] //variable to store number of subtools
    [VarDef, CurrentSubtoolName,""]
    
    [varDef, ClonedtoolId, 0]
    [varDef, OriginalId, 0]
    
    [If, 1,
    
    	[VarSet, SubToolNumber,[SubToolGetCount]] // Get number of subtool and assign it to SubToolNumber var
    	[VarSet, OriginalId, [IGet, Tool:ItemInfo]] // get id of original tool (with all subtool)
    	
    
    	[Loop, SubToolNumber, //loop through each subtool
    	
    		[subToolSelect, n] 
    
    		[VarSet, CurrentSubtoolName,[IGetTitle, Tool:ItemInfo]] // assign name of currentsubT to CurrentSubtoolName
    
    		[IPress,Tool:Clone]
    		[VarSet,ClonedtoolId,[IGetMax,Tool:ItemInfo]] //get id of the clone
    
    //***************************************************** Saving clone **************************************************** 
    
    		[ISet, Tool:ItemInfo, ClonedtoolId] // select clone and save it 
    
    		[FileNameSetNext,[StrMerge,CurrentSubtoolName,ztl]] //name save 
    		//[note,[StrMerge,"Saved ",CurrentSubtoolName,"_00",n,.ztl]]
    
    		[Ipress, Tool:SaveAs] //save 
    		
    		
    
    //*****************************************************/Saving clone **************************************************** 
    
    
    
    		[ISet, Tool:ItemInfo, OriginalId] // select orginal back
    		
    		
    		
    	,n]	
    
    ]
    
    
  • nyx702
    Options
    Offline / Send Message
    Cool. Good job on the script Strkl!

    There are a couple different ways you can point to a path. Probably the easiest (laziest) way I do it is to use the command.
    [StrAsk, Initial string, Title]
    

    And have the user paste/type in the path they want to use. The path can be saved in a .zvr so the user only has to do it once or whenever they want to change it again.

    A more advanced way is to use a function inside the ZFileUtils.dll to open a windows dialog to choose a folder.
    http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/zfileutils/

    I would also consider deleting the cloned subtools after the save to clean up the file so the user doesn't have to. Just a quality of life thing :)
Sign In or Register to comment.