cant set up lod with t3d shape editor !!
by x-ming-x · in Torque 3D Professional · 02/06/2012 (2:13 pm) · 6 replies
hello :)
im having a strange issue with the lod / detail features of the shape editor
ive got 2 very simple models (dts) and im trying to add the low poly one to the high poly one as a detail level, using the t3d shape editor.
both models load fine on their own, after adding the lowpoly one to the high poly one as a detail level i can spawn it into the map and it works perfectly.
BUT when i restart torque3d and try to load the model i get this in the console
Resource<TSShape>::create - Could not open 'sign_metal_pole_1_lp.dts'
Failed to create resource: [sign_metal_pole_1_lp.dts]
addMesh failed: Could not load source shape: 'sign_metal_pole_1_lp.dts'
the thing that freaking me out is that the file is DEFINATELY there in the same folder
heres the cs file that is created by the shape editor
-------------------------
singleton TSShapeConstructor(Sign_metal_pole_1_hpDts)
{
baseShape = "./sign_metal_pole_1_hp.dts";
};
function Sign_metal_pole_1_hpDts::onLoad(%this)
{
%this.addMesh("30", "sign_metal_pole_1_lp.dts", "sign_metal_pole_1_lp 30");
}
------------------------------
ive read the shape editor docs and seem to be doing everything correctly, as i say i works but not after a restart !!
thanks for reading
any help much appreciated,
im having a strange issue with the lod / detail features of the shape editor
ive got 2 very simple models (dts) and im trying to add the low poly one to the high poly one as a detail level, using the t3d shape editor.
both models load fine on their own, after adding the lowpoly one to the high poly one as a detail level i can spawn it into the map and it works perfectly.
BUT when i restart torque3d and try to load the model i get this in the console
Resource<TSShape>::create - Could not open 'sign_metal_pole_1_lp.dts'
Failed to create resource: [sign_metal_pole_1_lp.dts]
addMesh failed: Could not load source shape: 'sign_metal_pole_1_lp.dts'
the thing that freaking me out is that the file is DEFINATELY there in the same folder
heres the cs file that is created by the shape editor
-------------------------
singleton TSShapeConstructor(Sign_metal_pole_1_hpDts)
{
baseShape = "./sign_metal_pole_1_hp.dts";
};
function Sign_metal_pole_1_hpDts::onLoad(%this)
{
%this.addMesh("30", "sign_metal_pole_1_lp.dts", "sign_metal_pole_1_lp 30");
}
------------------------------
ive read the shape editor docs and seem to be doing everything correctly, as i say i works but not after a restart !!
thanks for reading
any help much appreciated,
About the author
ive been making games since they used to be on floppy discs, ive been all over the industry and worked for / with all types of companies, big and small. Now im lucky enough to be indie and working full time for myself and my team :)
#2
thx for helping me out
i tried that but it spat out this in the console so im guessing there is some difference between the documentation and whats actually happening !!
Resource<TSShape>::create - '30' has an unknown file format
Failed to create resource: [30]
addMesh failed: Could not load source shape: '30'
so ive checked the source code and in
tsShapeConstruct.cpp(1351):
"%this.addMesh( \"ColMesh-1\", \"./collision.dts\", \"ColMesh\", \"Col-1\" );\n"
i noticed a difference there in that it seems to be expecting a ./ before the filename, so ive run that and its loaded no errors in console and i think its lodding but its hard to tell because if i try to open the shape editor on this shape it now crashes out of t3d completely..... with nothing in console to say why
function Sign_metal_pole_1_hpDts::onLoad(%this)
{
%this.addMesh("30", "./sign_metal_pole_1_lp.dts", "sign_metal_pole_1_lp 30");
}
dunno what to do next, id really like to be able to use the shape editor and im actually making a torque ready art pack to sell but i dont want it to come with free crashing feature ! :(
02/06/2012 (5:31 pm)
hello Rex thx for helping me out
i tried that but it spat out this in the console so im guessing there is some difference between the documentation and whats actually happening !!
Resource<TSShape>::create - '30' has an unknown file format
Failed to create resource: [30]
addMesh failed: Could not load source shape: '30'
so ive checked the source code and in
tsShapeConstruct.cpp(1351):
"%this.addMesh( \"ColMesh-1\", \"./collision.dts\", \"ColMesh\", \"Col-1\" );\n"
i noticed a difference there in that it seems to be expecting a ./ before the filename, so ive run that and its loaded no errors in console and i think its lodding but its hard to tell because if i try to open the shape editor on this shape it now crashes out of t3d completely..... with nothing in console to say why
function Sign_metal_pole_1_hpDts::onLoad(%this)
{
%this.addMesh("30", "./sign_metal_pole_1_lp.dts", "sign_metal_pole_1_lp 30");
}
dunno what to do next, id really like to be able to use the shape editor and im actually making a torque ready art pack to sell but i dont want it to come with free crashing feature ! :(
#3
so id say this constitutes a bug as the shape editor is not saving the lod information correctly if the models are in the same folder.
02/12/2012 (6:41 pm)
after renaming the model details ive managed to avoid it crashing but the original bug is still there and ive had to manually edit all of the models cs files adding the ./ to the beggining of the file name. so id say this constitutes a bug as the shape editor is not saving the lod information correctly if the models are in the same folder.
#4
I am going to try adding the "./" to my cs file and see how that behaves.
EDIT:
BTW I am using t3d 1.2
05/14/2012 (9:19 am)
I am having this same problem. When you say "after renaming the model details ive managed to avoid it crashing", what did you rename the files to?I am going to try adding the "./" to my cs file and see how that behaves.
EDIT:
BTW I am using t3d 1.2
#5
This does seem to be an issue though.
05/14/2012 (9:32 am)
I should have checked this before posting, but adding ./ before the filename does help. Also that object didn't crash the shape editor after I added ./ before the filename in the cs file.This does seem to be an issue though.
#6
required in the original object, bound, detail (eg 256), mesh, (optional collision)
required another 1 object for LOD using
on detail tab we create a new detail (eg 64)
and use button 'import shape into'
works but the better way is the LOD export with the object from the modeling program. LOD for objects, hiRes for players, npc and mobs.
05/14/2012 (11:21 am)
In a few cases i did this with the shape editor t3d 1.2required in the original object, bound, detail (eg 256), mesh, (optional collision)
required another 1 object for LOD using
on detail tab we create a new detail (eg 64)
and use button 'import shape into'
works but the better way is the LOD export with the object from the modeling program. LOD for objects, hiRes for players, npc and mobs.
Torque Owner Rex
BrokeAss Games
Here is the documentation:
addMesh(string shape_filename, string src_mesh, string mesh_name) shape_filename: the name of a shape file (DTS or DAE) that contains the geometry for the new detail level src_mesh: the name of the mesh to use for this detail level (usually the object name followed by the mesh detail size. eg. SimpleShape128) mesh_name: name of the new mesh, using the form <object_name> <detail_size>. eg. SimpleShape128Try swapping the "30" & "sign_metal_pole_1_lp.dts" arguments and see what happens then...