Script to import HiRes model from ZBrush

Hello,
I made a Python script to import .obj ZBrush file.
The main difference with the Blender .obj import is the possibility to import big file >800 Mo (from ZBrush only).
You can import millions of polygons easily.

The script can:

  • load millions of polygons and display them
  • import polypainting

and cannot:

  • import UVs
  • create polygroup and subtool

I currently work on UV.
It is experimental (at first for my personnal use only),and not tested on Linux and Mac.

The link:
http://hostit.warrenberberd.org/dl.php?file=9e6be25520a800ee587990f897d45657

http://imghost.warrenberberd.org/2010/08/22/Thumbs/9e6be25520a800ee587990f897d45657-M.py

How is this different to the current obj importer? That can already import multi-million poly obj meshes output from zbrush. When you get to these kind of poly numbers without using multires, blender slows down horribly.

Hello Richard,
the main difference is the use of the memory (less memory more millions :slight_smile:
The interest to import HiRes is only for special case, not for a standard workflow :wink:

The main interest is to use the real model directly to render, without using normal map or other big textures map. There is some other interest, but I repeat, it is for special case.

Interesting, just what I’ve been waiting for. I have an urgent question though and hopefully academic for you.

I cant seem to see the uv lines in my saved files( which I bring into photot shop for painting) just one flat color. What am I missing? Please help as I have nice models made in blender but really need to paint them in other than blender but with no lines, I 'm in the dark. :spin:

Thanks
Erick
Virginia Beach

This hasn’t really anything to do with this thread has it ?
In 2.5 to export your UV map in the UV/Image editor header you use UVs / Export UV Layout menu. In the browser window that opens, at the bottom left select either .eps or .svg as the image format to export. These are the only formats available but at least one of these can be opened in PS.

How is this different to the current obj importer? That can already import multi-million poly obj meshes output from zbrush. When you get to these kind of poly numbers without using multires, blender slows down horribly.

Your idea about using multires is really good, but difficult to realise.
But I found a way to do this, using the low res and to add the hi-res to save more memory and more time when importing big files.
I work on it.
A+

Thanks,really interesting,Blender and Zbrush could work much better together.
Now it’s a bit a pain,in blender 2.49 was acceptable,in 2.5 not much.

What is not acceptable?

I mean the performance of the blender obj script found in blender 2.5,really slow(unusable for me,maybe now it’s fixed,I don’t have tried recently as I prefer to use 2.49 version for now after having seen the first bad results)
Actually for exchanging data with zbrush 2.49 obj scripts are “safe” and “better”,they cover more or less every situation (import,export ,without changing index vertices and face order)
I write “scripts” and no"script" because if you reconstruct in zbrush subdivision level only one different script work without breaking the order .
So,it’s a complex problem,not much adressed in 2.5(not to make critics,my point of view)

Ok I understand.
The .obj import script int the Blender 2.53 beta has been fixed, no more problem to import big file !
My script is a bit different and work only for ZBrush 4.0

I compared the standard obj importer in the 2.53beta against your script with a 3.2million poly model from zbrush4
The standard obj importer took 4min 20secs to import the obj, after 1.5 hours waiting with your script I gave up. This was on an OSX 10.6.4 machine.

Thx to try my script :slight_smile:

The standard obj importer took 4min 20secs to import the obj, after 1.5 hours waiting with your script I gave up.

It is not a feature but a bug (ZBrush bug?), I seems to be an end-line problem:
For the polypainting, the line finished with a Cr+Lf char and not for ohter lines.
I read line with a basic file.readline() but sometimes, its bug…
I investigate to fix it.

Edit:
you can pass this bug if you uncheck the Polypainting option…