Page 4 of 5

Posted: Wed Jan 14, 2009 7:54 pm
by suvakas
[edit]
Finally got it working !!
So problem solved.
Thanks guys !!

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

Posted: Sun Sep 06, 2009 8:09 am
by dougal2
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.

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

Posted: Sun Sep 06, 2009 9:35 am
by dougal2
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

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

Posted: Mon Sep 07, 2009 2:21 am
by dougal2
Suv or Nick,

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

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

Posted: Mon Sep 07, 2009 10:32 am
by OnoSendai
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

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

Posted: Mon Sep 07, 2009 10:48 am
by dougal2
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.

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

Posted: Mon Sep 07, 2009 10:53 am
by OnoSendai
attached.
Ignore class OldIndigoMesh, use INdigoMesh.
I used the python 'array' module because it's faster.
Stupid scripting languages.

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

Posted: Wed Dec 09, 2009 9:41 am
by Whaat
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?

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

Posted: Wed Dec 09, 2009 10:03 am
by OnoSendai
SHould work for Python, yeah, but I think it uses quite python-specific techniques.

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

Posted: Wed Dec 09, 2009 10:08 am
by dougal2
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.

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

Posted: Wed Dec 09, 2009 10:12 am
by OnoSendai
Oh dear.. sorry about that :)

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

Posted: Wed Dec 09, 2009 10:23 am
by Whaat
Thanks doug, will do!

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

Posted: Wed Dec 09, 2009 10:25 am
by Whaat
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?

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

Posted: Wed Dec 09, 2009 11:33 am
by OnoSendai
Uv sets are the number of uv layers.
uv set expositions are naming of particular layers, of which there may be many per layer.

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

Posted: Thu Sep 21, 2017 7:13 pm
by Daniel
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?