Nop the problem is that the 3ds file format only supports 1 uvw channel.CTZn wrote:The problem is that Indigo will just use the first of the UVs sets, and discard the followings right away !
Lot of shots of a new exporter and bad news ;-) (2/1/2007)
- VictorJapi
- Posts: 58
- Joined: Sun Jan 21, 2007 1:27 am
- Location: Zamora - Algeciras || España
XML supports 3 maping channels.
It says:
I did it like that and it works Ok (gets quite slow with large poly count though).
Just remember, that in max texture face = geometry face. By knowing that it is quite logical to get the corresponding vertexes. You have to search for the texture vertex that has the same index as your initial geometry vertex index was.
(maby a bit confusing at first, but read and think and test it over multiple times and it gets clear)
Hope it helps
suvakas
Read "Understanding Texture Coordinates and Vertex Colors" from help file.tizxx wrote: please someone can help me ...
this is an example to export an object selected in 3ds max to indigo
the proble is
how can I obtain UV0 UV1 and UV2 values?
someone can help me?
-----
It says:
Code: Select all
In order to find out which texture vertex corresponds to a mesh vertex, you have to do the following:
1. Take the index of the mesh vertex.
2. Find out which faces reference the index of the vertex
3. Note the number of the vertex (1st, 2nd or 3rd - .x, .y or .z) inside each face.
4. For each face referencing the vertex, get the texture face with the same index.
5. Get the index of the respective texture vertex from the face - 1st, 2nd or 3rd / .x, .y or .z
6. The vertex you got corresonds to the mesh vertex we started with.
7. Repeat steps 3 to 6 for all faces found.Just remember, that in max texture face = geometry face. By knowing that it is quite logical to get the corresponding vertexes. You have to search for the texture vertex that has the same index as your initial geometry vertex index was.
(maby a bit confusing at first, but read and think and test it over multiple times and it gets clear)
Hope it helps
suvakas
- VictorJapi
- Posts: 58
- Joined: Sun Jan 21, 2007 1:27 am
- Location: Zamora - Algeciras || España
i use xml formats to realtime intermediate format , but its hard to export (time and hd space) maybe would be better obj if it works.suvakas wrote:XML supports 3 maping channels.
Read "Understanding Texture Coordinates and Vertex Colors" from help file.tizxx wrote: please someone can help me ...
this is an example to export an object selected in 3ds max to indigo
the proble is
how can I obtain UV0 UV1 and UV2 values?
someone can help me?
-----
It says:I did it like that and it works Ok (gets quite slow with large poly count though).Code: Select all
In order to find out which texture vertex corresponds to a mesh vertex, you have to do the following: 1. Take the index of the mesh vertex. 2. Find out which faces reference the index of the vertex 3. Note the number of the vertex (1st, 2nd or 3rd - .x, .y or .z) inside each face. 4. For each face referencing the vertex, get the texture face with the same index. 5. Get the index of the respective texture vertex from the face - 1st, 2nd or 3rd / .x, .y or .z 6. The vertex you got corresonds to the mesh vertex we started with. 7. Repeat steps 3 to 6 for all faces found.
Just remember, that in max texture face = geometry face. By knowing that it is quite logical to get the corresponding vertexes. You have to search for the texture vertex that has the same index as your initial geometry vertex index was.
(maby a bit confusing at first, but read and think and test it over multiple times and it gets clear)
Hope it helps
suvakas
winmain(){
japi victorJapi;
victorJapi::Signature();
}
japi victorJapi;
victorJapi::Signature();
}
Is obj supported? I think notVictorJapi wrote:i use xml formats to realtime intermediate format , but its hard to export (time and hd space) maybe would be better obj if it works.
Do you use *.3ds instead of xml? Does it really takes that much less hdd space? For example i prefer one xml over 100s or 1000s of *.3ds files. Seems a bit more reasonable.
suvakas
- VictorJapi
- Posts: 58
- Joined: Sun Jan 21, 2007 1:27 am
- Location: Zamora - Algeciras || España
Is obj supported? I think notsuvakas wrote:VictorJapi wrote:i use xml formats to realtime intermediate format , but its hard to export (time and hd space) maybe would be better obj if it works.
Do you use *.3ds instead of xml? Does it really takes that much less hdd space? For example i prefer one xml over 100s or 1000s of *.3ds files. Seems a bit more reasonable.
in a .3ds you could put more than one object, and if you have a tree in 3ds format you can put thousands of trees with only one 3ds file
[edit:] anyway i'm doing the materials right now, if you are interested i could provide you a simply interface like:
exportIndigooMats(myFlag, myFile) where myFlag could be sceneMaterials, selectedObjectMaterials, MeditMaterials
winmain(){
japi victorJapi;
victorJapi::Signature();
}
japi victorJapi;
victorJapi::Signature();
}
Actually i havn't been able to export objects larger than 60-70k polys from max using xml file format. Its either a) too slow or b) maxscript will run out of memory. It's probably cause my code is not quite optimized yet, but the same thing also happens with u3dreal exporter. So at the moment i think the poly count is not a factor when picking between *.3ds or xml. At least not with current exporters available.tizxx wrote:a .3ds file can contain objects with a maximum o 65535 faces
if you have a complex surrface like nurbs or other .3ds format
is not a good solution....
3ds format is just an old 3d version file...
OK. Well yes, I have exported models even higher than 400k polys using xml, but without smoothing groups and uv coordinates. The way you have to "hunt" texture vertexes in max makes it too slow for heavy models. I might be wrong too though. My knowledge comes from 2 week maxscript experience. I would be very happy if someone can prove I'm wrong
Suvakas
[edit] Thanks for your offer VictorJapi, but at the moment my material export code is also involved when exporting geometry so currently i cant use any 3rd party functions.
- VictorJapi
- Posts: 58
- Joined: Sun Jan 21, 2007 1:27 am
- Location: Zamora - Algeciras || España
You don't need to export it using scriptting writting, you can call max to export it in silent mode using their own plugin, remember: plugin's speed >> script's speedsuvakas wrote:Actually i havn't been able to export objects larger than 60-70k polys from max using xml file format. Its either a) too slow or b) maxscript will run out of memory. It's probably cause my code is not quite optimized yet, but the same thing also happens with u3dreal exporter. So at the moment i think the poly count is not a factor when picking between *.3ds or xml. At least not with current exporters available.tizxx wrote:a .3ds file can contain objects with a maximum o 65535 faces
if you have a complex surrface like nurbs or other .3ds format
is not a good solution....
3ds format is just an old 3d version file...
OK. Well yes, I have exported models even higher than 400k polys using xml, but without smoothing groups and uv coordinates. The way you have to "hunt" texture vertexes in max makes it too slow for heavy models. I might be wrong too though. My knowledge comes from 2 week maxscript experience. I would be very happy if someone can prove I'm wrong![]()
Suvakas
[edit] Thanks for your offer VictorJapi, but at the moment my material export code is also involved when exporting geometry so currently i cant use any 3rd party functions.
winmain(){
japi victorJapi;
victorJapi::Signature();
}
japi victorJapi;
victorJapi::Signature();
}
I find this example in max-script help
I suppose that
UV0 are only coordinate U and V of diffuse map
UV1 are only coordinate U and V of specular map
UV2 are only coordinate U and V of Bump map
so
UV0 is channel id 0
UV1 is channel id 1
UV2 is channel id 2
Ono what i'm thinkging is true?
--- EXAMPLE OF MAX SCRIPT ---
s = sphere material:(standardMaterial diffuseMap:(checker()))
showTextureMap s.material s.material.diffuseMap on
--
-- Add a normal modifier to make the sphere into a mesh
addModifier s (normalModifier())
r = ray [-100,5,0] (s.center-[-100,5,0])
--
-- Get the Intersection details
arr = (intersectRayEx s r)
--
-- Create a dummy at the point of intersection
dummy pos:(arr[1]).pos
--
-- Get the texture face
tf = getTVFace s arr[2]
--
-- Get the UVW verts of the face
tv1 = getTVert s tf.x
tv2 = getTVert s tf.y
tv3 = getTVert s tf.z
--
-- Calculate the texture vertices at point of intersection from
-- the barycentric coordinates
tv = tv1*arr[3].x + tv2*arr[3].y + tv3*arr[3].z
--
-- Delete the modifier
deleteModifier s 1
I suppose that
UV0 are only coordinate U and V of diffuse map
UV1 are only coordinate U and V of specular map
UV2 are only coordinate U and V of Bump map
so
UV0 is channel id 0
UV1 is channel id 1
UV2 is channel id 2
Ono what i'm thinkging is true?
--- EXAMPLE OF MAX SCRIPT ---
s = sphere material:(standardMaterial diffuseMap:(checker()))
showTextureMap s.material s.material.diffuseMap on
--
-- Add a normal modifier to make the sphere into a mesh
addModifier s (normalModifier())
r = ray [-100,5,0] (s.center-[-100,5,0])
--
-- Get the Intersection details
arr = (intersectRayEx s r)
--
-- Create a dummy at the point of intersection
dummy pos:(arr[1]).pos
--
-- Get the texture face
tf = getTVFace s arr[2]
--
-- Get the UVW verts of the face
tv1 = getTVert s tf.x
tv2 = getTVert s tf.y
tv3 = getTVert s tf.z
--
-- Calculate the texture vertices at point of intersection from
-- the barycentric coordinates
tv = tv1*arr[3].x + tv2*arr[3].y + tv3*arr[3].z
--
-- Delete the modifier
deleteModifier s 1
- VictorJapi
- Posts: 58
- Joined: Sun Jan 21, 2007 1:27 am
- Location: Zamora - Algeciras || España
I have no words - this would be SUPERB !!! Best Indigo news everOnoSendai wrote:Max has built-in support for exporting to obj?
U can call this from your exporter scripts?
If this is the case then I'll finish up the obj import.
[edit]
UV0->2 are the Map Channels 1-3 in Max. You can put whatever you want to those channels (1 is not related to diffuse and etc). The number shows what UVW maping channel texture uses.tizxx wrote:I find this example in max-script help
I suppose that
UV0 are only coordinate U and V of diffuse map
UV1 are only coordinate U and V of specular map
UV2 are only coordinate U and V of Bump map
so
UV0 is channel id 0
UV1 is channel id 1
UV2 is channel id 2
Awesome !! You're a code machine !! (.. or do you have one?OnoSendai wrote:Ok... .obj support is done. (probly some bugs tho)
Do you want an Indigo build with obj support to test with?
Yes, it would be great to get the build. I could then start implementing the *.obj export into maxscript right away. Should be easy thing to do (compared to xml-mesh export - which I just got working relatively fine too).
suvakas

