[Closed] ZBrush Helper Script: Better way to preserve multi/sub-object materials
Hello all,
I just recently started working with ZBrush and I wanted to create a script that streamlines the whole “export to OBJ”, modify your object, “import from OBJ.” I have this basic functionality done with a ZIn button and a ZOut button, but I wanted to take this a bit further to handle multi/sub-object nodes while preserving material assignments and accessing those sub-objects in ZBrush. This is particularly great for fixing a posed character, modifying an already texture character. This also great for bringing reference objects into ZBrush so you can easily hide/show them since ZBrush can only have one object active with no going back. (i.e. once you deselect and create another object you’re done with the previous one)
Currently, the pipeline works like this:
- export your multi/sub-object node as OBJ
- open the OBJ file and replace all “usemtl” with “g” (converts it from materials to groups)
- bring file into ZBrush and work your magic. (can easily hide groups via SHIFT+CTRL+click)
- export file back to OBJ when done.
- import OBJ into Max.
After this point the groups are there as unique elements in the mesh, but the material IDs are gone. Now, I can just store a file which holds all faces with it’s matID. (ZOut) Then when the user imports the mesh back in (ZIn) it just matches the faces and IDs again. Naturally this would require the same # of faces before and after its trip to ZBrush, but that doesn’t worry me too much. (easy to check) What does worry me is typical # of faces dealt with when working with ZBrush. (very high polycounts) Just wondering if anyone has a better idea on how to handle this so I can avoid writing large files to disk when transferring objects.
Thanks
Well, after more research, it looks like the two exporters for Max and ZBrush order faces very differently making the above project impractical for now. I would still like to hear how to cycle over elements in an object since I would like to do that for other scripts as well. Thanks.