Lot of shots of a new exporter and bad news ;-) (2/1/2007)

Announcements, requests and support regarding the 3DS MAX exporter
User avatar
VictorJapi
Posts: 58
Joined: Sun Jan 21, 2007 1:27 am
Location: Zamora - Algeciras || España

Post by VictorJapi » Sat Jan 27, 2007 1:00 pm

CTZn wrote:The problem is that Indigo will just use the first of the UVs sets, and discard the followings right away !
Nop the problem is that the 3ds file format only supports 1 uvw channel.
winmain(){
japi victorJapi;
victorJapi::Signature();
}

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Sat Jan 27, 2007 8:36 pm

XML supports 3 maping channels.
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?
-----
Read "Understanding Texture Coordinates and Vertex Colors" from help file.

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.
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

User avatar
VictorJapi
Posts: 58
Joined: Sun Jan 21, 2007 1:27 am
Location: Zamora - Algeciras || España

Post by VictorJapi » Sat Jan 27, 2007 10:50 pm

suvakas wrote:XML supports 3 maping channels.
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?
-----
Read "Understanding Texture Coordinates and Vertex Colors" from help file.

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.
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
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.
winmain(){
japi victorJapi;
victorJapi::Signature();
}

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Sat Jan 27, 2007 11:29 pm

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.
Is obj supported? I think not :roll:
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

User avatar
VictorJapi
Posts: 58
Joined: Sun Jan 21, 2007 1:27 am
Location: Zamora - Algeciras || España

Post by VictorJapi » Sun Jan 28, 2007 3:33 am

suvakas 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.
Is obj supported? I think not :roll:
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();
}

tizxx
Posts: 116
Joined: Tue Jul 04, 2006 1:50 am

Post by tizxx » Sun Jan 28, 2007 5:20 am

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...

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Sun Jan 28, 2007 5:41 am

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...
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.
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 :wink:

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.

User avatar
VictorJapi
Posts: 58
Joined: Sun Jan 21, 2007 1:27 am
Location: Zamora - Algeciras || España

Post by VictorJapi » Sun Jan 28, 2007 7:55 am

suvakas wrote:
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...
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.
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 :wink:

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.
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 speed :D
winmain(){
japi victorJapi;
victorJapi::Signature();
}

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Sun Jan 28, 2007 8:23 am

What? Max can export to xml? Are you sure? :roll:
In my Max you can't :wink:

tizxx
Posts: 116
Joined: Tue Jul 04, 2006 1:50 am

Post by tizxx » Sun Jan 28, 2007 10:14 pm

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

User avatar
VictorJapi
Posts: 58
Joined: Sun Jan 21, 2007 1:27 am
Location: Zamora - Algeciras || España

Post by VictorJapi » Sun Jan 28, 2007 11:24 pm

WTF ??? xD is so much simplier!!!! getMapFace <---- use this!!!!


No, max can't export xml but 3ds and obj.
winmain(){
japi victorJapi;
victorJapi::Signature();
}

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

Post by OnoSendai » Sun Jan 28, 2007 11:28 pm

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.

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Sun Jan 28, 2007 11:55 pm

OnoSendai 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.
I have no words - this would be SUPERB !!! Best Indigo news ever 8)

[edit]
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
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.

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

Post by OnoSendai » Mon Jan 29, 2007 2:34 am

Ok... .obj support is done. (probly some bugs tho)
Do you want an Indigo build with obj support to test with?

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Mon Jan 29, 2007 2:58 am

OnoSendai wrote:Ok... .obj support is done. (probly some bugs tho)
Do you want an Indigo build with obj support to test with?
Awesome !! You're a code machine !! (.. or do you have one? :D )
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

Post Reply
78 posts