Home Technical Talk

zBrush - export polypaint to vertex color

greentooth
Offline / Send Message
fearian greentooth
Hey guys, I have a problem and I can't seem to find the documentation I need.

I have a very high res mesh, with both texture data and vertex colour data. I need to take this mesh through zbrush, but I can't seem to do this without loosing the vertex colour data. I know I can make a new polypaint from the texture, and iirc polypaint is basically vertex colour; So how do I export this vertex colour from my model?

Replies

  • Bal
    Offline / Send Message
    Bal polycounter lvl 17
    When you export an obj from Zbrush, if the polypaint is visible, it'll export it in the obj's vertex color.
    Is that what you're asking?
  • fearian
    Offline / Send Message
    fearian greentooth
    hmm, it's never shown up in the program I'm bringing the OBJ into. Might be a problem on the import end then.

    Thanks!
  • Bal
    Offline / Send Message
    Bal polycounter lvl 17
    Yeah most commonly that's a prob with your import, I know for example if you try baking the vertex color to a map in xNormal, it should work.
    Some apps/verssions of the obj importer are a bit annoying with properly importing various data from objs, it can be quite annoying.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    The "vertex color in OBJ file" is a massive hack that Pixologic added in the last couple of years - it's not actually part of the OBJ file format specification (which is why most importers won't use it).

    They basically shoved the Polypaint vertex colour information into the OBJ file as comments so "standard" OBJ importers won't even read it.

    There are only a couple of apps which updated their OBJ importer to support this (XNormal is one), I guess if someone was feeling particularly adventurous with scripting/coding then they could do the same with other apps.

    As Bal said the best way to get this colour info into another program (without modifying the import tools to support Pixologic's hacky implementation!) is by baking it out using XNormal and then applying the result back to the original object. Obviously this means your polypainted object will need UVs - although the quick GUVTiles or something like that might be passable if your object isn't already mapped.
  • Jeff Parrott
    Offline / Send Message
    Jeff Parrott polycounter lvl 19
    Yeah MoP is spot on. OBJ just wasn't made to handle vert colors ages ago. Just give your high res some autoUVs in ZBrush (GUV, PUV, or AUV whatever works in that order usually) and new texture from polypaint.

    Then export your high mesh and texture (the texture will be flipped in the vertical direction. You can fix that in ZBrush export options or in the texture menu or in Phoshop). Just make sure NOT to decimate your highres as that tends to hose the Polypaint.

    One thing I was wondering of is using GoZ to get the polypaint info. It probably won't work but it's something to try.
  • cryrid
    Offline / Send Message
    cryrid interpolator
    I have a very high res mesh, with both texture data and vertex colour data. I need to take this mesh through zbrush, but I can't seem to do this without loosing the vertex colour data.

    Just to be clear, you're not asking how to load polypaint from zbrush into other programs, you're asking how to get vertex color from another program into zbrush to preserve it?

    If that's the case, what are the vertex colors going to be used for? Do they need to be loaded into zbrush to drive the material/color, or are you looking to make some change to the mesh in zbrush and get the result back out (in which case you don't need to load them into zbrush, you just need the resulting zbrush export to play happy with information from the old mesh in a standard modeling program)?
  • fearian
    Offline / Send Message
    fearian greentooth
    SOLUTION:

    I came across this problem again recently, and while googling it, I hit my own thread! Luckily I have a workaround/solution, so I thought I'd post it.

    Once again, this is for a situation where you want to export polypaint information from zBrush as colour per vertex, and you need to read this colour per vertex in another program. Using Texture maps isn't an option. For clarification, an example situation like this is if you had high density 3d scan geometry with colour data, that you needed to merge together.

    The simple workaround is to export from zBrush as an OBJ, then load it into meshlab. Meshlab can read the vertex colours in the obj and will be able to export PLY, which is more commonly used for meshes vertex colour.

    That's about it! Hopefully whatever you are importing to can real .ply files. (for the record, xNormal does great with them!)

    Sorry for the necro bump everyone.
  • lode
    Offline / Send Message
    lode polycounter lvl 3
    Thanks Fearian, 

    Also sorry to bump the thread after so long, but this appears to be the top result when searching for how to transfer Polypaint out of Zbrush as vertex colors. 

    The method Fearian suggests works fine as of March 2016 (Zbrush 4R7). 
    I have tested this by:
    -Decimating a mesh down to 5 million polys ("use and keep polypaint")
    -Exporting the resulting mesh as OBJ
    -Importing the OBJ into Meshlab
    -Export out of Meshlab as PLY
    -Import into 3ds max using the "Guruware PLY importer" (Free 3rd party plugin for 3ds Max) with scale set to 1.

    Results in a perfect transfer of polypaint as vertex colors. 

    If a new or quicker technique has been developed i'd be most interested to hear about it. 

    Thanks again Fearian!
  • thomasp
    Offline / Send Message
    thomasp hero character
    i prefer doing my vertex colors in Z as polypaint vs the finicky interface found elsewhere and baking to bitmap is not an option for this use case.

    i had no trouble locating a maxscript via google that reads zbrush's polypaint and imports the OBJ without further ado. disclaimer: i had to alter it so it would not create a menu item all by itself and i have not tested how it would handle truly complex geometry, i tend to only require vertex colors on medium density meshes or lower. i recall i found the link to it somewhere on vimeo.

    unaltered file attached.

  • fearian
    Offline / Send Message
    fearian greentooth
    Wow! Nice bumps guys! Shame .ply is still poorly supported.

    ThomasP - Nice work! I will warn others that for heavy scan meshes (my original issue) Max doesn't handle things well.
  • CheeseOnToast
    Offline / Send Message
    CheeseOnToast greentooth
    You can export straight out of zbrush as an FBX, which preserves vertex colour.
  • Ravenok
    Offline / Send Message
    Ravenok polycounter lvl 7
    You can export straight out of zbrush as an FBX, which preserves vertex colour.
    I'm reading through this whole thing thinking "goddamnit, what a mess, goddamnit" since I can't export to texture and I'm not using Max. Then your comment hits my face. What the F where was my brain, thanks man. :smile: 
  • Nivellen
    Offline / Send Message
    Nivellen polycounter lvl 2
    Hi, I'm sorry for the necromancy, but actually this thread is positioned at Google as second. And luckily, in my case the mesh has 3.3 million polys. Thomasp script works great. Kudos :)
  • BittaSingh
    Offline / Send Message
    BittaSingh triangle
    You can export straight out of zbrush as an FBX, which preserves vertex colour.
    Hi , i am exporting  my multiple subtools into one  fbx file and when i use that to bake  it is not picking vertex color . can you please help me . here  are more details on it  

    http://polycount.com/discussion/196704/cw-flash-barry-allen-sculpt#latest 


    BUT as you can see the error below , it did not pick the vertex color i assigned to high poly meshes , i researched  and found  out that  when exporting it to fbx i have to make sure  that  all vertex have color , like even the white color  has to be painted . so i checked it again  and i am pretty sure there is no vertex without color , but still am not getting any color  . plus  my third  udim  which is of face and half mask  is black . like this  and others are blank . here is a curvature map too if that helps . if iam doing something wrong  please tell me . 


Sign In or Register to comment.