Indigo Binary Mesh (.igmesh) format with source code.

A forum for exporter development discussion.
User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Wed Jan 14, 2009 7:54 pm

[edit]
Finally got it working !!
So problem solved.
Thanks guys !!

User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

Re: Indigo Binary Mesh (.igmesh) format with source code.

Post by dougal2 » Sun Sep 06, 2009 8:09 am

I wrote an igmesh reader and writer in python - see attached.

I tested by loading the mesh.igmesh in testscenes/ and writing it back.
The written back file was identical to the original.

After loading an object the following member vars are int:
magic_number, format_version, num_uv_mappings, num_used_materials, num_vert_positions, num_vert_normals, num_uv_pairs, num_triangles

The following member vars are lists of 3-tuples: vert_positions, vert_normals

The following is a list of 2-tuples: uv_pairs

The following is a dict: uv_set_expositions
the dict format is { index: name }

The following is a list of dicts: triangles
the dicts are of the format
{
'vertex_indices': <list of ints>,
'uv_indices': <list of ints>,
'tri_mat_index': int
}


I've no idea how it will perform with larger data sets yet.
Attachments
igmesh.zip
(2.06 KiB) Downloaded 344 times

User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

Re: Indigo Binary Mesh (.igmesh) format with source code.

Post by dougal2 » Sun Sep 06, 2009 9:35 am

Don't know where the bottleneck is yet, but here's a preliminary benchmark:

Code: Select all

[EF 2009-09-05 22:09:08] Indigo export started...
<igmesh
                Magic Number:           5456751
                Format Version:         1
                Num UV Mappings:        0
                Num Used Materials:     1
                Used Materials:         ['clay']
                Num UV Set Expositions: 0
                UV Set Expositions:     {}
                Num vert positions:     495794
                Vert positions:         <list length 495794>
                Num Vert Normals:       0
                Vert Normals:           <list length 0>
                Num UV Pairs:           0
                UV Pairs:               <list length 0>
                Num Triangles:          991232
                Triangles:              <list length 991232>
                Data size:              33704068 bytes
>
[EF 2009-09-05 22:09:24] ...finished. Export took 15.297000 seconds

User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

Re: Indigo Binary Mesh (.igmesh) format with source code.

Post by dougal2 » Mon Sep 07, 2009 2:21 am

Suv or Nick,

Can you explain the multi-uv ordering? I'm coming across the same problems.

User avatar
OnoSendai
Developer
Posts: 6237
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: Indigo Binary Mesh (.igmesh) format with source code.

Post by OnoSendai » Mon Sep 07, 2009 10:32 am

Hi dougal, actually I just checked in a python igmesh reader/writer to the blendigo src, if you want to have a look at that.

The UV ordering inteleaves the uv sets/layers

So if there are M uv coords per layer, and N uv layers,
and uv_i_j is the i-th uv coordinate in the j-th set/layer, then the UVs area laid out like so:

uv_0_0
uv_0_1
..
uv_0_N
uv_1_0
uv_1_1
...
uv_1_N
uv_2_0
..
..
..
uv_M_N

User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

Re: Indigo Binary Mesh (.igmesh) format with source code.

Post by dougal2 » Mon Sep 07, 2009 10:48 am

OnoSendai wrote:Hi dougal, actually I just checked in a python igmesh reader/writer to the blendigo src, if you want to have a look at that.
Oh, right. That will be interesting to compare :)

I'm not sure if I know where you've 'checked-in' to exactly ... please PM or email me details.

The rest makes sense.

Cheers,
Doug.

User avatar
OnoSendai
Developer
Posts: 6237
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: Indigo Binary Mesh (.igmesh) format with source code.

Post by OnoSendai » Mon Sep 07, 2009 10:53 am

attached.
Ignore class OldIndigoMesh, use INdigoMesh.
I used the python 'array' module because it's faster.
Stupid scripting languages.
Attachments
indigo_mesh.zip
(1.54 KiB) Downloaded 330 times

User avatar
Whaat
Developer
Posts: 1827
Joined: Fri Dec 22, 2006 6:15 am
Location: Canada
Contact:

Re: Indigo Binary Mesh (.igmesh) format with source code.

Post by Whaat » Wed Dec 09, 2009 9:41 am

OnoSendai wrote:attached.
Ignore class OldIndigoMesh, use INdigoMesh.
I used the python 'array' module because it's faster.
Stupid scripting languages.
So, this Python IGMESH code is guarenteed to work? Or has it been modified/fixed since you attached it here, Ono?

I don't know Python but it looks fairly similar to Ruby. Any advice on porting this code to Ruby?

User avatar
OnoSendai
Developer
Posts: 6237
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: Indigo Binary Mesh (.igmesh) format with source code.

Post by OnoSendai » Wed Dec 09, 2009 10:03 am

SHould work for Python, yeah, but I think it uses quite python-specific techniques.

User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

Re: Indigo Binary Mesh (.igmesh) format with source code.

Post by dougal2 » Wed Dec 09, 2009 10:08 am

OnoSendai wrote:SHould work for Python, yeah, but I think it uses quite python-specific techniques.
Nick's published igmesh code produces erroneous files on 64bit (linux only?) systems because of the Long data types used. (Should be ints).

Look in blendigo source since 2.2.8 for igmesh code that works more reliably.

User avatar
OnoSendai
Developer
Posts: 6237
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: Indigo Binary Mesh (.igmesh) format with source code.

Post by OnoSendai » Wed Dec 09, 2009 10:12 am

Oh dear.. sorry about that :)

User avatar
Whaat
Developer
Posts: 1827
Joined: Fri Dec 22, 2006 6:15 am
Location: Canada
Contact:

Re: Indigo Binary Mesh (.igmesh) format with source code.

Post by Whaat » Wed Dec 09, 2009 10:23 am

Thanks doug, will do!

User avatar
Whaat
Developer
Posts: 1827
Joined: Fri Dec 22, 2006 6:15 am
Location: Canada
Contact:

Re: Indigo Binary Mesh (.igmesh) format with source code.

Post by Whaat » Wed Dec 09, 2009 10:25 am

OnoSendai wrote:SHould work for Python, yeah, but I think it uses quite python-specific techniques.
Yeah, but it looks like the process of packing the data into binary format is the same as Ruby. That's my main concern.

BTW, what's the difference between num_uv_mappings and num_uv_expositions? Will this number always be the same?

User avatar
OnoSendai
Developer
Posts: 6237
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: Indigo Binary Mesh (.igmesh) format with source code.

Post by OnoSendai » Wed Dec 09, 2009 11:33 am

Uv sets are the number of uv layers.
uv set expositions are naming of particular layers, of which there may be many per layer.

Daniel
Posts: 13
Joined: Tue Mar 01, 2016 2:32 am
3D Software: Cinema 4D

Re: Indigo Binary Mesh (.igmesh) format with source code.

Post by Daniel » Thu Sep 21, 2017 7:13 pm

At the risk of asking the obvious... ;) in Indigo 4 compressed .igmesh files were introduced, is there any documentation of the compressed format or how to unpack it?

Post Reply
66 posts

Who is online

Users browsing this forum: No registered users and 1 guest