Indigo Binary Mesh (.igmesh) format with source code.
Re: Indigo Binary Mesh (.igmesh) format with source code.
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.
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 668 times
Re: Indigo Binary Mesh (.igmesh) format with source code.
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.
Suv or Nick,
Can you explain the multi-uv ordering? I'm coming across the same problems.
Can you explain the multi-uv ordering? I'm coming across the same problems.
Re: Indigo Binary Mesh (.igmesh) format with source code.
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
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.
Oh, right. That will be interesting to compareOnoSendai 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.

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.
attached.
Ignore class OldIndigoMesh, use INdigoMesh.
I used the python 'array' module because it's faster.
Stupid scripting languages.
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 741 times
Re: Indigo Binary Mesh (.igmesh) format with source code.
So, this Python IGMESH code is guarenteed to work? Or has it been modified/fixed since you attached it here, Ono?OnoSendai wrote:attached.
Ignore class OldIndigoMesh, use INdigoMesh.
I used the python 'array' module because it's faster.
Stupid scripting languages.
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.
SHould work for Python, yeah, but I think it uses quite python-specific techniques.
Re: Indigo Binary Mesh (.igmesh) format with source code.
Nick's published igmesh code produces erroneous files on 64bit (linux only?) systems because of the Long data types used. (Should be ints).OnoSendai wrote:SHould work for Python, yeah, but I think it uses quite python-specific techniques.
Look in blendigo source since 2.2.8 for igmesh code that works more reliably.
Re: Indigo Binary Mesh (.igmesh) format with source code.
Oh dear.. sorry about that 

Re: Indigo Binary Mesh (.igmesh) format with source code.
Thanks doug, will do!
Re: Indigo Binary Mesh (.igmesh) format with source code.
Yeah, but it looks like the process of packing the data into binary format is the same as Ruby. That's my main concern.OnoSendai wrote:SHould work for Python, yeah, but I think it uses quite python-specific techniques.
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.
Uv sets are the number of uv layers.
uv set expositions are naming of particular layers, of which there may be many per layer.
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.
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?

Who is online
Users browsing this forum: No registered users and 3 guests