Recompile max2dtsExporterPro for max 9?
by Feng Ning · in Torque Game Engine · 07/04/2008 (9:05 am) · 14 replies
I just tried to modify the max2dtsExporterPro of TGE SDK 1.5.2 to make it work for 3ds max 9:
1. Dup the max2dtsExporterPro Max7 project as max2dtsExporterPro Max9
2. Re-point all references to 3dsmax sdk 9
3. Compile it, no error
But seems I got two issues:
1. 3ds max loaded the .dle without any error (I guess the loading is successful because if you try to load say the exporter for max7, you will got a loading error), but I just could not find the plug-in in Utilities panel > Configure Button Sets. Does anybody know why?
2. The .dle I got is only 480K, but the one downloaded from TDN is about 2M. I'm wondering why there is such a big difference? Is there any way I can get the source code of the official dts exporter for max 9? That should be included in the SDK anyway. I need it because I'm expanding the DTS format, I need to modify the exporter too.
Any advice is appreciated.
1. Dup the max2dtsExporterPro Max7 project as max2dtsExporterPro Max9
2. Re-point all references to 3dsmax sdk 9
3. Compile it, no error
But seems I got two issues:
1. 3ds max loaded the .dle without any error (I guess the loading is successful because if you try to load say the exporter for max7, you will got a loading error), but I just could not find the plug-in in Utilities panel > Configure Button Sets. Does anybody know why?
2. The .dle I got is only 480K, but the one downloaded from TDN is about 2M. I'm wondering why there is such a big difference? Is there any way I can get the source code of the official dts exporter for max 9? That should be included in the SDK anyway. I need it because I'm expanding the DTS format, I need to modify the exporter too.
Any advice is appreciated.
About the author
#2
Where I can get source code of newer "non-pro" exporter? The one within the SDK seems obsolete.
07/04/2008 (11:00 am)
Thank you Magnus,Where I can get source code of newer "non-pro" exporter? The one within the SDK seems obsolete.
#3
Though to answer your question, the source provided in the SDK is for the "good, old" dts exporter, though of course its formatted for the Max 4 SDK so it would to be updated to the SDK for the release you plan to use and recompiled.
Logan
07/04/2008 (12:25 pm)
Unless you are adding a few things or making a 64-bit port of the exporters there is no need to worry about recompiling. There are versions of the good old DTS exporter for 3DS Max 3 all the way to the flashy new 2008 release.Though to answer your question, the source provided in the SDK is for the "good, old" dts exporter, though of course its formatted for the Max 4 SDK so it would to be updated to the SDK for the release you plan to use and recompiled.
Logan
#4
Actually I'm worrying about the recompiling. I encountered compile errors like TSMesh::tverts due to engine upgrades and MakeRefByID(), NoRemap() due to 3ds max upgrades but I think I can handle them. And I also heard about other non-compile issues such as MultiRes, 2-sides texture, crashes, etc. that I don't think I can figure out them all. Since the official exporter for max9 works perfectly, why not just open the source code to the SDK coders?
Magnus:
I noticed that you wrote lots of posts about exporter. Are you the author of the official exporter? Could you please share the modification you made to the exporter for Max 4? Thank you very much ;)
07/04/2008 (10:07 pm)
Thanks L,Actually I'm worrying about the recompiling. I encountered compile errors like TSMesh::tverts due to engine upgrades and MakeRefByID(), NoRemap() due to 3ds max upgrades but I think I can handle them. And I also heard about other non-compile issues such as MultiRes, 2-sides texture, crashes, etc. that I don't think I can figure out them all. Since the official exporter for max9 works perfectly, why not just open the source code to the SDK coders?
Magnus:
I noticed that you wrote lots of posts about exporter. Are you the author of the official exporter? Could you please share the modification you made to the exporter for Max 4? Thank you very much ;)
#5
Other than fixing those, as far as I can remember there's only one other thing that needs to be fixed, (again; as I said, I don't have the source in front of me so I can't look right now); There's some oddities with multires, there is an old forum post somewhere describing it (and the fix) but I can't find it right now.
As for where to get the source, both the pro and non-pro ones are included with TGE (at least the last version I looked at had source for both of them).
07/05/2008 (2:08 pm)
I'm not the "author" of the exporter, no. But I was the one that compiled it for max9 up to 2009, yes. The MakeRefByID() and NoRemap() things are described in the max SDK help (those functions have been deprecated and replaced by similar functions, I don't have the source here in front of me so I can't look up the specifics right now I'm afraid).Other than fixing those, as far as I can remember there's only one other thing that needs to be fixed, (again; as I said, I don't have the source in front of me so I can't look right now); There's some oddities with multires, there is an old forum post somewhere describing it (and the fix) but I can't find it right now.
As for where to get the source, both the pro and non-pro ones are included with TGE (at least the last version I looked at had source for both of them).
#6
Do you remember whether your compiled exporter worked fine? I have got it compiled successfully, but it crashes the max when exporting whatever models.
I put all changes I mode in the end of the post. Summary of my changes:
1. Updated MakeRefByID(), NoRemap() due to max upgrade
2. Updated all TSMesh::tverts to TSMesh::mUVs[TSMesh::tDiffuse].uvs due to engine upgrade
3. Fixed a const Point3 to Point3 & conversion
4. Changed all MultiRes related IParamBlock to IParamBlock2, that's the one other thing that needs to be fixed you are referring to.
5. Commented out a duplicate declaration in engine/platformWin32/winMemory.cc
6. Fixed the TORQUE_DISABLE_MEMORY_MANAGER macro (This one should be optional)
No compiling errors but there are still logic errors. Does anybody have idea? There is no feature changes in the official version, right?
engine/platform/platformMemory.cc and engine/platformWin32/winMemory.cc:
07/05/2008 (3:22 pm)
Hi Magnus,Do you remember whether your compiled exporter worked fine? I have got it compiled successfully, but it crashes the max when exporting whatever models.
I put all changes I mode in the end of the post. Summary of my changes:
1. Updated MakeRefByID(), NoRemap() due to max upgrade
2. Updated all TSMesh::tverts to TSMesh::mUVs[TSMesh::tDiffuse].uvs due to engine upgrade
3. Fixed a const Point3 to Point3 & conversion
4. Changed all MultiRes related IParamBlock to IParamBlock2, that's the one other thing that needs to be fixed you are referring to.
5. Commented out a duplicate declaration in engine/platformWin32/winMemory.cc
6. Fixed the TORQUE_DISABLE_MEMORY_MANAGER macro (This one should be optional)
No compiling errors but there are still logic errors. Does anybody have idea? There is no feature changes in the official version, right?
engine/platform/platformMemory.cc and engine/platformWin32/winMemory.cc:
... I removed them since there are bugs in them. Please check the final version below.
#7
Seems you got all of the needed changes, at least as far as I can remember. I can't recall changing the TSMesh::tverts thing, but then again I may have compiled against an older version of TGE and something changed with that recently.
07/06/2008 (2:06 am)
My compile of the exporters should be working fine (they have been for me at least and I haven't heard anyone complain). Seems you got all of the needed changes, at least as far as I can remember. I can't recall changing the TSMesh::tverts thing, but then again I may have compiled against an older version of TGE and something changed with that recently.
#8
mUVs to support multiple UVs I guess.
I just found that my exporter crashes the max because I handle the TSMesh::tverts incorrectly, and I'm fixing that. It should be some codes like this:
I will put the changes here once I finished.
07/06/2008 (3:54 am)
Yeah, the TSMesh::tverts thing is new. TGE SDK 1.5.2 has no more TSMesh::tverts but uses VectorI just found that my exporter crashes the max because I handle the TSMesh::tverts incorrectly, and I'm fixing that. It should be some codes like this:
Vector<Point2F> uvs; mesh->getUVs(TSMesh::tDiffuse, uvs); // get the uvs ... // uses uvs as TSMesh::tverts before mesh->setUVs(TSMesh::tDiffuse, uvs); // write it back
I will put the changes here once I finished.
#9
I just posted my changes as a resource here:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=15015
Again, regarding to DTS/DSQ version 25:
In engine\ts\tsMaterialList.cc, bool TSMaterialList::read(Stream & s), I found version 25 is about multi-lightmaps. The non-pro exporter within the SDK does not include this feature since it wasn't updated for a long time. Can anybody add this feature? That would be wonderful.
Regarding to the AssertFatal when exporting model with bones, in tools/max2dtsExporter/ShapeMimic.h, change:
07/07/2008 (11:07 am)
Hi,I just posted my changes as a resource here:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=15015
Again, regarding to DTS/DSQ version 25:
In engine\ts\tsMaterialList.cc, bool TSMaterialList::read(Stream & s), I found version 25 is about multi-lightmaps. The non-pro exporter within the SDK does not include this feature since it wasn't updated for a long time. Can anybody add this feature? That would be wonderful.
Regarding to the AssertFatal when exporting model with bones, in tools/max2dtsExporter/ShapeMimic.h, change:
~ObjectMimic()
{
dFree((char*)name);
dFree((char*)fullName);
for (S32 i=0;i<numDetails;i++)
delete details[i].mesh;
}to~ObjectMimic()
{
if (isBone)
delete[] name; // char * boneName = new char[len];
else
dFree((char*)name);
dFree((char*)fullName);
for (S32 i=0;i<numDetails;i++)
delete details[i].mesh;
}
#10
07/07/2008 (12:40 pm)
Well, this is slightly off topic, but I SUSPECT that the Max 9 standard exporter does not export animation sequences. I have been trying to get it to do so for three days with no luck.
#11
Maybe it's because there are many limits. Did you follow the steps in torque.smdlabs.com/3dsmaxAnimationSetup.htm? I don't know how to use 3ds Max, but my artist friend follows the steps and he can export animation sequences (.dsq).
07/07/2008 (10:18 pm)
Hi Nmuta,Maybe it's because there are many limits. Did you follow the steps in torque.smdlabs.com/3dsmaxAnimationSetup.htm? I don't know how to use 3ds Max, but my artist friend follows the steps and he can export animation sequences (.dsq).
#12
07/08/2008 (4:02 am)
Nmuta; that would be very off topic yes, and no; it exports animation just fine.
#13
07/08/2008 (8:14 am)
As it turns out Nmuta's problem was due to the fact he was running the DTS Pro exporter with the "Good, Old" exporter. The pro exporter was buggering up his sequence exporting (which is something Magnus and I experianced in the past when using the two exporters together).
#14
07/08/2008 (8:35 am)
Yes, what L Foster wrote is correct. I think this should be publicised for anyone still using Max 9 (like me).
Torque Owner Magnus Blikstad