How to access TSShapeConstructor for newbies
by Kira · in Torque 3D Professional · 07/12/2009 (10:13 pm) · 7 replies
If you want to add auto billboarding to a already solid functioning tree model .dts how do you acess the code to add the required autobillboarding code
We have it working by adding a BB detail in maya before exporting and it works in T3D except it only renders top view.... so how do we add auto billboarding to a dts step by step , I could not find anything on how to actually access TSShape constructor or how to actually use it.
Perhaps this needs to be added to Docs for non programmers
Any help would be VERY much appreciated
We have it working by adding a BB detail in maya before exporting and it works in T3D except it only renders top view.... so how do we add auto billboarding to a dts step by step , I could not find anything on how to actually access TSShape constructor or how to actually use it.
Perhaps this needs to be added to Docs for non programmers
Any help would be VERY much appreciated
#2
07/13/2009 (2:53 pm)
Unfortunately the documentation can be improved upon. I use to teach myself and I use to have to write full manuals and if they weren't 200% clear we'd get our butts kicked and have to write them again. This particular documentation isn't very clear. We have both been through it time and time again as well as through the forums etc. Yes it describes it's function and commands but not how to access it. It needs to be both friendly for artists and programmers. Given that it's under the artits section it is not artist friendly...and we are advanced professional artists.
#3
The TSShapeConstructor documentation is a bit out of date now - and there were a couple of bugs in beta3 that will be resolved when beta4 comes out (hopefully soon!). At the moment the docs are more of a command reference than a tutorial (and written by a programmer to boot!), so I'd welcome any suggestions you have about how to make the functionality more accessible to artists.
The steps you'd follow to add an auto-billboard to a DTS shape are below, but unfortunately, beta3 will likely crash even though you are doing everything right (the bug that causes this has been resolved in beta4).
1. Create a TorqueScript file with the same name as your DTS shape, but with a .cs extension. For example, if your shape is called myShape.dts, you would create a file called myShape.cs. Put this file in the same folder as the DTS shape.
2. Add the following code to the new script file:
Where "art/shapes/myShape.dts" is the path to your DTS file, and "MyShapeDts" is an arbitrary name for the TSShapeConstructor object.
3. Run Torque3D. The script will be executed automagically when the DTS shape is loaded.
07/13/2009 (4:21 pm)
Hi Richard,The TSShapeConstructor documentation is a bit out of date now - and there were a couple of bugs in beta3 that will be resolved when beta4 comes out (hopefully soon!). At the moment the docs are more of a command reference than a tutorial (and written by a programmer to boot!), so I'd welcome any suggestions you have about how to make the functionality more accessible to artists.
The steps you'd follow to add an auto-billboard to a DTS shape are below, but unfortunately, beta3 will likely crash even though you are doing everything right (the bug that causes this has been resolved in beta4).
1. Create a TorqueScript file with the same name as your DTS shape, but with a .cs extension. For example, if your shape is called myShape.dts, you would create a file called myShape.cs. Put this file in the same folder as the DTS shape.
2. Add the following code to the new script file:
function MyShapeDts::onLoad(%this)
{
%this.addAutoBillboard(2, 4, 2, 0, 64, true, 10);
}
singleton TSShapeConstructor(MyShapeDts)
{
baseShape = "art/shapes/myShape.dts";
}Where "art/shapes/myShape.dts" is the path to your DTS file, and "MyShapeDts" is an arbitrary name for the TSShapeConstructor object.
3. Run Torque3D. The script will be executed automagically when the DTS shape is loaded.
#4
We have standard billboarding using detail BB working fine except its a bit funky when you have leaning palms as it flicks stright .
We are in the process of modelling our games full vegetation range .about 400 dts trees for use with the forest kit, better quality than Crysis , and want to test these out properly before we post them for sale as a resource at GG
I was convinced this morning we just added the line to the cfg file
Thanks again will give it a go
07/13/2009 (4:30 pm)
Thanks for thatWe have standard billboarding using detail BB working fine except its a bit funky when you have leaning palms as it flicks stright .
We are in the process of modelling our games full vegetation range .about 400 dts trees for use with the forest kit, better quality than Crysis , and want to test these out properly before we post them for sale as a resource at GG
I was convinced this morning we just added the line to the cfg file
Thanks again will give it a go
#5
We just tried that , no crash but the billboard just vanishes when it should kick in.
When we loaded it in Showtool it opened fine but did not show up in there either , but that may be normal for showtool?
Does it need to be defined anywhere else such as datablock or header etc?
Do you add a detail 2 to the model on export or id sthis generated by the cfg file?
Thanks
07/13/2009 (5:52 pm)
Thanks againWe just tried that , no crash but the billboard just vanishes when it should kick in.
When we loaded it in Showtool it opened fine but did not show up in there either , but that may be normal for showtool?
Does it need to be defined anywhere else such as datablock or header etc?
Do you add a detail 2 to the model on export or id sthis generated by the cfg file?
Thanks
#6
I notice you are a Kiwi
Same here but live in Brisbane,Im from Wellington originally.
As per your request on the Docs, from an artists point of view most are pretty good , the new Scatter sky docs for example are great , but If they want to have Quote "the best docs of any engine" they need to remember that artists a lot of the time have very limited knowledge of code, I do the moddleing at our studio doing contract game art and Naval Architecture related modelling ,and my wife does the coding as she is a qualified c++ programmer but the problem is she has had very little actual experiance so is having to learn the engine as we go , so she still needs very basic Docs relating to code, which is why we posted this in the first place.
I get really peeved when people make sarcastic comments that try to make you feel stupid, when all you do is ask a question,So thanks again for your help
We ask alot of basic questions, most never get answered by anyone except Tom S
We have been greating art for 2 yrs full time for our upcoming game and have decided to start selling the assets as a way to partly finance the game and as we cant really contribute much code-wise we can in a big way asset wise.
07/14/2009 (6:36 pm)
@ChrisI notice you are a Kiwi
Same here but live in Brisbane,Im from Wellington originally.
As per your request on the Docs, from an artists point of view most are pretty good , the new Scatter sky docs for example are great , but If they want to have Quote "the best docs of any engine" they need to remember that artists a lot of the time have very limited knowledge of code, I do the moddleing at our studio doing contract game art and Naval Architecture related modelling ,and my wife does the coding as she is a qualified c++ programmer but the problem is she has had very little actual experiance so is having to learn the engine as we go , so she still needs very basic Docs relating to code, which is why we posted this in the first place.
I get really peeved when people make sarcastic comments that try to make you feel stupid, when all you do is ask a question,So thanks again for your help
We ask alot of basic questions, most never get answered by anyone except Tom S
We have been greating art for 2 yrs full time for our upcoming game and have decided to start selling the assets as a way to partly finance the game and as we cant really contribute much code-wise we can in a big way asset wise.
#7
Only needs to be defined in the one place, and no need to add details prior to export - TSShapeConstructor takes care of this. As I mentioned though, beta3 had a couple of bugs in TSShapeConstructor that may be why you don't see the billboard.
If I get a chance later today I will check that it is all working in beta4.
07/14/2009 (10:49 pm)
Quote:Does it need to be defined anywhere else such as datablock or header etc?
Do you add a detail 2 to the model on export or is this generated by the cfg file?
Only needs to be defined in the one place, and no need to add details prior to export - TSShapeConstructor takes care of this. As I mentioned though, beta3 had a couple of bugs in TSShapeConstructor that may be why you don't see the billboard.
If I get a chance later today I will check that it is all working in beta4.
Associate Manoel Neto
Default Studio Name