Showtool: load a second model and clear the first.
by Ori Cohen · 04/26/2004 (10:28 am) · 4 comments
Hi Folks,
i was discussing the issue of loading models in showtool with one of the artists i am working with. we both agreed that when you have many models that you need to load in showtool it gets very confusing when they are all stacked one on top of the other.
so i decided to make a small fix to the showtool code, unfortunantly for me while asking questions in the channel the Great MangoFusion instead of pointing me to the right direction gave me the code fix, so now i have to share the glory of the code snippit with him :P
okay to business:
1.open game->showTSshape.cc,
2.find line 804.
5.run the new exe
you will notice that when you load a second model the first one will disappear.
hope this helps to anyone out there..
Ori
i was discussing the issue of loading models in showtool with one of the artists i am working with. we both agreed that when you have many models that you need to load in showtool it gets very confusing when they are all stacked one on top of the other.
so i decided to make a small fix to the showtool code, unfortunantly for me while asking questions in the channel the Great MangoFusion instead of pointing me to the right direction gave me the code fix, so now i have to share the glory of the code snippit with him :P
okay to business:
1.open game->showTSshape.cc,
2.find line 804.
ConsoleFunction( showShapeLoad, void, 2, 3, "(string shapeName, bool faceCamera)")3.replace
ShowTSShape * show = new ShowTSShape(argv[1]);With:
// this should clear the old model and load a new one.
ShowTSShape * show;
if (ShowTSShape::currentShow != NULL)
{
ShowTSShape::currentShow->unregisterObject();
delete ShowTSShape::currentShow;
ShowTSShape::currentShow = NULL;
}
show = new ShowTSShape(argv[1]);4.compile 5.run the new exe
you will notice that when you load a second model the first one will disappear.
hope this helps to anyone out there..
Ori
About the author
#2
04/28/2004 (7:16 pm)
cool. I have a similar problem where after you load one animation, you have to restart the program to load another one.
#3
ShowInit();
to the code right below the line:
Sim::getRootGroup()->addObject(show);
which is 7 lines below the code references above. You will then reset the camera view as well on load of a new object.
09/05/2007 (4:36 pm)
If you add this line:ShowInit();
to the code right below the line:
Sim::getRootGroup()->addObject(show);
which is 7 lines below the code references above. You will then reset the camera view as well on load of a new object.
#4
12/26/2007 (3:40 pm)
Thanks for this resource, it fixed a problem when using the call in a game , on the mac side the character avatar model was showing up on the terrain after the mission loaded, and this code fixed it! 
Torque Owner Yannick Lahay
Thank you :)