JoseConseco / GoB

Fork of original GoB script (I just added some fixes)
GNU General Public License v3.0
647 stars 78 forks source link

support Multires highres transfer #34

Open spiraloid opened 5 years ago

spiraloid commented 5 years ago

Tasks

Proposal

A thought on getting zbrush subdivisions.

if you were to export the highest res obj after exporting the lowest res with a detail_subdivCount.obj suffix, you could restore the zbrush sculpt details by importing the detail mesh, add a multires mesh modifer, shrink wrapping to the detail mesh after each subdivision...

an idea. could do the same thing in zbrush too w a post goz zcript

https://youtu.be/MU7EQjauKNo

Zbrush handling of subdiv levels

  1. If the selected subtool has no subdivision levels then the imported mesh will replace the existing mesh.
  2. If the selected subtool has subdivision levels then ZBrush will attempt to project the details onto the imported mesh.
  3. If the name of the imported mesh is different to the subtool then the subtool will be renamed.
kromar commented 5 years ago

hi @spiraloid i wanted to look into the multires issue for some time but never had a chance to. Do you know if other applinks from zbrush support such a multires functionality? I noticed that zbrush always switches to the lowest subdiv befor it sends it over to blender.

spiraloid commented 4 years ago

yeah, the lowest cage is a limitation of the zbrush default GOZ install. Mainly because it writes out an obj file which inheritantly doesn't support Hierarchical subdivs. But..... we could write out the highest poly mesh and unsubdivide to resonstruct even with an OBJ... we just need to know the unsubdivide number... I bet we could write a custom Zscript that exports the highest resolution obj and puts the subdiv number in the name as a suffix.

i.e. GOB_subdiv_6.obj

then you import that file, parse the filename suffix and unsubdivide the multires N times.... to reproduce the same subtool in blender.

an idea.

kromar commented 4 years ago

some good thoughts there, i think i would try to avoid to have the need for an extra script on zbrush side since it makes the whole setup more complicated so if we can handle it on blenders side would be the easiest solution.

i know we can adapt to shapes with the reshape option in the modifier so i think we do not need the unsubdivide, but im not sure if it can be done on any level, so also something to test. image

an other idea might be to freeze the subdiv in zbrush so the highres gets exported, and on import we try to look at the vertex count that comes into blender with meshes that have the same name and if it is a multiple of the base mesh it might be possible to use that one as multires high res mesh and probably know the subdiv level needed... not sure if that is even possible but just a thought that came to my mind.

what we probably also would need is a option to specify the subdiv level that should be exported from blender because that might be different from the preview level that is set.

kromar commented 4 years ago

idea to transfer highres mesh from multires modifier resolutions:

  1. low level will be exported from blender as mesh_low
  2. high subdivision will be exported from blender as mesh_high
  3. import in zbrush as individual meshes?
    -try to add high res to subdivision level (problem this can not be exported by default GoZ and most likely would need custom exporter. if this is needed consider using a standard format like fbx or obj for data transfer.
  4. export meshes from zbrush
  5. import in blender checks for suffixes and if lowres has a multires modifier (could be created as well)
  6. import hihgres mesh and reshape on lowres mesh with multires modifier (possibility to add in modifier or as raw mesh)