GoZ script problems


#1

Hi

Is anybody successfully using the GoZ bridge between R19 and ZBrush 4R8?
It seems that it’s been busted for the last couple of versions.
It works fine from ZBrush to C4D but always errors when going from C4D to ZBrush.
The error relates to the names of objects and takes the form:

GoZ Note:
“Object_x” already exists in the current GoZbrush project.
The object will be renamed “Object_x2”

So if, for instance, you have 4 cubes in your scene each named “Cube” they all get renamed “Cube2” and just one of them gets exported.

With any luck it’s something minor that’s wrong with the script and how it’s checking for duplicate objects.
Getting this fixed would be great :slight_smile:


#2

Sadly except recoding the GoZ plugin you can’t do alot.

Anyway here a script I made for get out of the mesh XX already exist message, So by export all your cube one by one it should work. (But yeah it’s boring)
Select your objects and run this script


import c4d
import os
def main():
    GoZ_CONTAINER_ID = 2000000
    
    objs = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHILDREN)
    doc.StartUndo()
    for obj in objs:
        doc.AddUndo(c4d.UNDOTYPE_CHANGE, obj)
        bc = obj.GetDataInstance()
        old_file_path = bc[GoZ_CONTAINER_ID]
        if not old_file_path:
            continue
        
        file_to_delete = list()
        file_to_delete.append(old_file_path+ ".ztn")
        file_to_delete.append(old_file_path+ ".ztl")
        file_to_delete.append(old_file_path+ ".GoZ")
        file_to_delete.append(old_file_path+ "_TXTR.tif")
        file_to_delete.append(old_file_path+ "_NM.tif")
        file_to_delete.append(old_file_path+ "_DISP.tif")
        
        for f in file_to_delete:
            if os.path.exists(f):
                os.remove(f)
        bc[GoZ_CONTAINER_ID] = ""
        
    doc.EndUndo()
    c4d.EventAdd()
    c4d.gui.MessageDialog("Succes")
if __name__=='__main__':
    main()

Should fix everything ! :slight_smile:


#3

Thanks for taking the time to do that :slight_smile:

I’m probably doing something stupid but when I run the script I get the following message in the console:

[FAIL] Script ‘GoZ patch’ Line 2 Pos 1 : Function declaration expected

and nothing appears to happen.

User error?


#4

Glad someone brought this up, it reminds me:

Everything I see on their site suggests GoZ doesn’t work with anything later than R17. It’s one of the reasons I have not purchased 4R8, despite some pretty amazing modeling features that can solve a lot of problems C4D (thus far) cannot. But it’s not worth a whole lot if you have to force the amazing model / mesh you created through hacks to get their C4D exporter to work, or worse f around with crap formats like STL.

Looks like if you can’t get GoZ to work you’re stuck with OBJ export or what they describe as a partial feature set FBX export? Curious to hear peoples experiences, to understand how much fumbling around they have to do to get a finished Zbrush mesh into C4D while maintaining its detail.


#5

I have Zbrush 4R8 and C4D 18/19 (primarily use 18 at the moment), but I’m curious as to what the issue is with exporting to OBJ or FBX to import into ZBrush. Unfortunately, I don’t use Zbrush as much as I’d like to, but I haven’t had any issues with the odd occasion where I exported from C4D and imported into ZBrush.


#6

What does your typical workflow look like? My understanding from watching their instructional videos and the like is you can build (from scratch) some pretty amazing models / meshes that you can’t build in C4D (or most other DCC packages) — using their more flexible primitives system, dynamesh, live boolean, etc. Which is all great and I was ready to make the investment right up until I started digging around for import/export documentation (some of which seemed pretty outdated - like some of the feature videos on their site).

Per my earlier comment I got the impression that the export options in particular are limited, both in terms of which C4D versions it can “talk to” and in terms of the degree to which some of the standard formats like FBX / OBJ are supported. Can’t remember which one but one of them had a note to the effect of “partial feature support” which makes me think that maybe you build up your amazing model but as soon as you try to “convert” it to go into C4D, you might loose the look of it or the detail to some degree.

Basically my assumption here is, given the weaknesses in some of C4D’s modeling and sculpting tools, wouldn’t the main reason for ZBrush be to circumvent those limitations, build better models / meshes in shorter time and then bring them into C4D for other parts of the workflow? Technically I guess the same kind of questions about apply to any textures or painting done in ZBrush as well. But the way I’m envisioning using it may not be the way people typically do. Sounds like you’re talking about a very different workflow — maybe moving a model into ZBrush for painting or texturing?


#7

I’m not sure what the hesitance is here with respect to ZBrush to C4D workflow. It is robust and more or less standard for many DCC packages.

I ignore GoZ, since it seems to be more or less moribund. And its real claim to fame was the ability to pop back and forth between a DCC app and ZBrush, which has become less necessary as ZBrush’s tools have improved (specifically zmodeller, and live booleans).

A typical workflow in going from ZBrush to C4D is:

  • Model in ZBrush, using its broad suite of modelling options. You can usually ignore topology at this stage.
  • Duplicate your mesh
  • Retopologize the mesh using ZRemesher.
  • Add UV coordinates with UV Master (Zplugin).
  • Subdivide your retopologized mesh a few times; reproject detail from original high-res sculpt.
  • Optional: subdivide further, and add high-frequency detail
  • Optional: polypaint color onto the mesh.
  • Export low-res retopologized mesh as OBJ.
  • Export displacement and/or color maps with the Multimap export Zplugin.
  • Import OBJ into C4D, create material with displacement and colour maps. Sub-poly displacement restores detail.
  • Profit!

Of course there are many potential variants if you want to add other, specialty programs (like Mari, or something for UV coordinates) into the mix. Or if you are exporting for realtime, you might export a normal map rather than a displacement map.

There are some wrinkles in terms of how you export displacements, and how different render engines interpret them, but it is not difficult to troubleshoot.


#8

Great info NW. Thanks. Your comment about GoZ is exactly the impression I got — like it was something from 5 years ago that never got updated. Their collection of web sites in general is a strange mix of new and modern-looking stuff and stuff that looks like it was made in 2002. :slight_smile:

So basically the process is taking a high poly / highly detailed mesh, and crunching it down with the remesher (which I’ve read about in a couple places) so that the mesh maintains the same shape and contours while using far fewer polygons… and later you export that same version of the mesh as an OBJ, and when you bring it into C4D as an OBJ… there’s no translation issues or cleanup / it just opens the thing and looks as you’d expect it to (short of the small details / displacement stuff not being done yet)?


#9

Yeah, GOZ has been Janky for as far as I can remember, I’m pretty sure it has an un-advertised polygon limit too.
Obj is the way to go. Now that both Cinema 4D & ZBrush can re-construct subdivision levels, it’s even easier to send meshes back & forth.


#10

Hello ! i was wondering about this … sending models from Zbrush to Cinema 4d while keeping the subdiv levels in C4D …
Then send it back to Zbrush, still with all the subdiv levels. You seem to say that it’s something possible ? C4D can re-construct the subdivision levels ? What do you mean please ? Because what you say is maybe something else than what i’d like to understand.

What i see in C4D is just the Obj from one of the subdivs.

Thank you.


#11

If you switch Cinema 4D to the ‘Sculpt’ layout, there is a button called ‘unsubdivide’ which will look at your mesh & see if it is made of a lower polygon model subdivided. If so, it will add a sculpting tag & re-instate those lower subdivision levels.
Of course, if you have added or removed polygons afterwards, it wouldn’t be possible to unsubdivide & the command won’t do anything.
There is a corresponding command in zbrush called ‘Reconstruct Subdiv’ from the 'Geometry pallette.


#12

Thanks so much Decade !!! i hoped it could be true and it seems so !

i have to try. i hope that it keeps exactly the original low poly version made in Zbrush, when importing the hi poly .Obj in C4D in sculpt mode …
and vice versa.

All i want to do is importing the low and the hi poly from Zbrush in C4D, as a subdividable/unsubvidable mesh ( just like a zbrush tool to make it short ) , and then apply a scaling to the object, and re orient it. This would be helpful to work with 3d scans and develop a correct displace map once re imported into Zbrush.

And this would also allow me to avoid reprojecting the low and hi again, with différences over the previous one.


#13

Hi Decade, i had a chance to test this “unsubdivide” button on an obj exported from Zbrush ( import to C4D : i checked objects : “combined” , and no material ) , but it didn’t recreate the subdivisions even though it added a sculpt tag to a duplication of the initial object. , i’m wondering if there’s something special to do that i’m missing.

oups ! Edit : by clicking on the sculpt tag, i can select the level, from 3 to 0 and it works :slight_smile: ( although it understands 0 to 3 so 4 levels, when in zbrush it’s from level 1 to 5, so five levels. don’t know why one is missing, the lowest. )

So far, the level 2 of the zbrush tool and the level 0 of the obj imported in C4D do match ! Cool, and the reconstruct subdiv seems to work correctly. it could save me a lot of hassle.
It seems to lose the polygroups though, and the UV’s, which is terrible in this case. anything that can be done about it so it’s not lost maybe ?
Thanks again !