3DSMax 6.0 MultiRes fix
by Samme Ng · in Torque Game Engine · 04/16/2004 (3:36 am) · 60 replies
I think I have fixed the crash if there is MultiRes modifier in the mesh.
It is simply modifing three files:
1) In ShapeMimic.h
Change the declaration of
void recordMergeOrder(IParamBlock *, MultiResMimic *);
to
void recordMergeOrder(IParamBlock2 *, MultiResMimic *);
2) In ShapeMimic.cc
Change the following inside void ShapeMimic::addMultiRes(INode * pNode, INode * multiResNode) from ..
Change
void ShapeMimic::recordMergeOrder(IParamBlock * paramBlock, MultiResMimic * multiResMimic) to
void ShapeMimic::recordMergeOrder(IParamBlock2 * paramBlock, MultiResMimic * multiResMimic)
In the last statement inside void ShapeMimic::recordMergeOrder(IParamBlock * paramBlock, MultiResMimic * multiResMimic)
Change all
Change ShapeMimic::~ShapeMimic()
3)In maxUtil.cc
Change the following inside TriObject * getTriObject( INode *pNode, S32 time, S32 multiResVerts, bool & deleteIt)
from ..
Hope it help you!
Samme
It is simply modifing three files:
1) In ShapeMimic.h
Change the declaration of
void recordMergeOrder(IParamBlock *, MultiResMimic *);
to
void recordMergeOrder(IParamBlock2 *, MultiResMimic *);
2) In ShapeMimic.cc
Change the following inside void ShapeMimic::addMultiRes(INode * pNode, INode * multiResNode) from ..
IParamBlock * paramBlock = NULL;To
IParamBlock2 * paramBlock = NULL;
paramBlock->GetValue(0,DEFAULT_TIME, multiResList.last()->totalVerts,range);To
paramBlock->GetValue([b]1[/b],DEFAULT_TIME, multiResList.last()->totalVerts,range);
Change
void ShapeMimic::recordMergeOrder(IParamBlock * paramBlock, MultiResMimic * multiResMimic) to
void ShapeMimic::recordMergeOrder(IParamBlock2 * paramBlock, MultiResMimic * multiResMimic)
In the last statement inside void ShapeMimic::recordMergeOrder(IParamBlock * paramBlock, MultiResMimic * multiResMimic)
Change all
paramBlock->SetValue(0, ....To
paramBlock->SetValue(1, ....
Change ShapeMimic::~ShapeMimic()
IParamBlock * paramBlock = (IParamBlock*)obj->SubAnim(j)->SubAnim(0); Interval range = multiResList[ii]->multiResNode->GetTimeRange(TIMERANGE_ALL|TIMERANGE_CHILDNODES|TIMERANGE_CHILDANIMS); paramBlock->SetValue(0,DEFAULT_TIME,multiResList[ii]->totalVerts);To
IParamBlock2 * paramBlock = (IParamBlock2*)obj->SubAnim(j)->SubAnim(0); Interval range = multiResList[ii]->multiResNode->GetTimeRange(TIMERANGE_ALL|TIMERANGE_CHILDNODES|TIMERANGE_CHILDANIMS); paramBlock->SetValue(1,DEFAULT_TIME,multiResList[ii]->totalVerts);
Quote: ** I have change the [i] to [ii] due to it think as italics code!
3)In maxUtil.cc
Change the following inside TriObject * getTriObject( INode *pNode, S32 time, S32 multiResVerts, bool & deleteIt)
from ..
IParamBlock * paramBlock = NULL;To
IParamBlock2 * paramBlock = NULL;
paramBlock->SetValue(0,time,multiResVerts);To
paramBlock->SetValue([b]1[/b],time,multiResVerts);
Hope it help you!
Samme
#22
05/05/2004 (1:07 am)
Niels (my modeller partner) is going to test it in a few days. We have been busy on other issues, but will take it for a test drive and report back asap
#23
05/05/2004 (5:13 pm)
Thanks Thomas
#24
In this routine...
TriObject * getTriObject( INode *pNode, S32 time, S32 multiResVerts, bool & deleteIt)
Don't you also need to change this line...
paramBlock = (IParamBlock*)obj->SubAnim(i)->SubAnim(0);
to this? ...
paramBlock = (IParamBlock2*)obj->SubAnim(i)->SubAnim(0);
05/10/2004 (12:05 pm)
Just took a brief look at this fix and I think that in the MaxUtil.cc fix I think you missed a line that needs a change...In this routine...
TriObject * getTriObject( INode *pNode, S32 time, S32 multiResVerts, bool & deleteIt)
Don't you also need to change this line...
paramBlock = (IParamBlock*)obj->SubAnim(i)->SubAnim(0);
to this? ...
paramBlock = (IParamBlock2*)obj->SubAnim(i)->SubAnim(0);
#25
05/10/2004 (4:49 pm)
Oh yes. I have changed but missed to post in the first post! Sorry. The exporter I created should include this fix.
#26
05/14/2004 (3:41 am)
So this includes working multires for skins?
#27
05/14/2004 (4:12 am)
Yes, currently I have used this version to export my 3DSMAX characters using MultiRes without any problem. ^_^
#28
I didn't get anything Alex, so I can't try it.
05/14/2004 (5:13 am)
Could someone post a binary? Or at least the correct code, as this seems to lack the change from mr. Dougher.I didn't get anything Alex, so I can't try it.
#29
Will someone can release it to others if really wanted to test if it work? I think no one know how to get it.
05/14/2004 (9:29 am)
Actually I have uploaded to FTP stated by Alex, however, I haven't receive any response from him.Will someone can release it to others if really wanted to test if it work? I think no one know how to get it.
#31
I will email everyone with login info for a new FTP site.
05/14/2004 (2:57 pm)
I had it up and hosted and gave out FTP information to a number of people, but my actual request for people to email me asking for the login got posted in a different max6 thread. I must not have been paying close enough attention. Sorry to everyone.I will email everyone with login info for a new FTP site.
#32
05/14/2004 (3:01 pm)
If you don't anyone else wants to test it out, please email me and let me know and I will send FTP info.
#33
In addition after testing a few other things this exporter Does not export 2 sided materials or reflective maps. I'm stumped on why 2 sided won't go out but it is reported on the sparks webboard that reflective material channel is not accsesible in the standard MAX6 SDK but can be accsessed using the Igame interface. But that would require alot of changes to the plugin.
Also if someone has it could they post the linking info fo VC7 to get this plugin to compile.
Thanks
Matt
07/18/2004 (1:23 pm)
I tested this plugin and couldn't get a good multires to export. I tested on a scene that was created and exported correctly from MAX5 with bravetrees exporter and MAX4 multires plugin. I need to build scene from scratch to confirm this but I haven't the time right now.In addition after testing a few other things this exporter Does not export 2 sided materials or reflective maps. I'm stumped on why 2 sided won't go out but it is reported on the sparks webboard that reflective material channel is not accsesible in the standard MAX6 SDK but can be accsessed using the Igame interface. But that would require alot of changes to the plugin.
Also if someone has it could they post the linking info fo VC7 to get this plugin to compile.
Thanks
Matt
#34
Regarding the 2 sided materials, what do you mean doesn't "export". In MAX4 export (I just modify the MultiRes part of it for Max6), it do support but the normal is zero due to using the same vertex normal for both side. I have added some new parameters for my own use to deal with it (instead of using 2Sided, I disable the "back-culling" so both side will be displayed).
At last, the reflective map, I just asked a week before for me to test, actually the exporter exported it and DTS contains the information, but I found there is a bug in the TSMesh::setupTexture, which causing the reflection doesn't work.
You need to fix it in order the external reflective alpha being using for reflecting the environment.
I will post the correction later on here.
07/18/2004 (3:52 pm)
That is quite strange. Actually, I am using it to export the "provided sample" and our own model right.Regarding the 2 sided materials, what do you mean doesn't "export". In MAX4 export (I just modify the MultiRes part of it for Max6), it do support but the normal is zero due to using the same vertex normal for both side. I have added some new parameters for my own use to deal with it (instead of using 2Sided, I disable the "back-culling" so both side will be displayed).
At last, the reflective map, I just asked a week before for me to test, actually the exporter exported it and DTS contains the information, but I found there is a bug in the TSMesh::setupTexture, which causing the reflection doesn't work.
You need to fix it in order the external reflective alpha being using for reflecting the environment.
I will post the correction later on here.
#35
We are in the proscess of fixing the reflection problem. It only occurs when you do not provide a seperate map for the material. Not a big deal but if you wouldn't mind posting the changes you made that might help us out.
Any luck on speeding the thing up? LOL its slow as the dickens but I can deal with that if I have too.
Matt
07/18/2004 (3:58 pm)
I used the compiled exporter that alex has a copy of and it didn't work. When I applied the changes myself I found none of these problems. The the thing is working as far as I know I am about to try the multires. We are in the proscess of fixing the reflection problem. It only occurs when you do not provide a seperate map for the material. Not a big deal but if you wouldn't mind posting the changes you made that might help us out.
Any luck on speeding the thing up? LOL its slow as the dickens but I can deal with that if I have too.
Matt
#36
07/18/2004 (3:59 pm)
Samme Ng: Me and my friend couldn't get your fix to make anything productive either. Nothing.
#38
07/18/2004 (4:53 pm)
I checked with our modeler and he had numerous issues until he ran the dtsUnMess utility on the model. Then it ran perfectly. perhaps that is the difference?
#39
07/18/2004 (7:31 pm)
Actually, I also required to run the unMessDTS in order to make it work, it is no matter of using MultiRes or not.
#40
So far I am using that exporter doing lot of thing, such as reflective mapping, detail mapping, MultiRes, special 2 sided texturing, Forced Z write for transparence with alpha test, etc.
Matthew: The speed of the exporter should be the fastest, almost the same as the one coming with TGE SDK. I only can use the VC Pro. compiler (which make it more than 100% faster already). I don't wanted to deal with lot of the internal for optimazation, since the interal is quite complicated.
I am not sure why unmessdts is required still, as I updated the tool already that fix the possible problem.
07/18/2004 (7:41 pm)
Stefan: Not sure what happen with your situation, could you give more details? So far I am using that exporter doing lot of thing, such as reflective mapping, detail mapping, MultiRes, special 2 sided texturing, Forced Z write for transparence with alpha test, etc.
Matthew: The speed of the exporter should be the fastest, almost the same as the one coming with TGE SDK. I only can use the VC Pro. compiler (which make it more than 100% faster already). I don't wanted to deal with lot of the internal for optimazation, since the interal is quite complicated.
I am not sure why unmessdts is required still, as I updated the tool already that fix the possible problem.
Torque Owner Alex Swanson