Plan for Sam Contapay
by Sam Contapay · 03/27/2002 (10:29 am) · 4 comments
The MAYA exporter is coming along. I finally am able to write out to a DTS file, however, expierence an error when reading it into the Torque engine. I am using -show to view the DTS file I have exported from MAYA. Quick RANT here on MAYA. When using the MAYA API to write an exporter and writing it first as a standalone application I get a problem with file location you can't just pass in "x:\filepath\filename" because it doesn't look at the path, you just pass in the name of the file and have the file located one directory above the application or working directory it works fine. I'll look into it more tonight and see if there is a MAYA API function to set the working directory.
Here's my problem with the exporter now, if anyone from the GG community can step up and help me answer the question it would be great. Plus as soon as I finish this exporter I am writing a resource to writing your own exporter but the source code for the ms2dts and the DTS SDK itself helps a lot, and I hope by writing this resource I can give back to the community. But I digress as usual, back to my problem. After writing to the exporter using the DTSShape::save() method I get a DTS file, however when bringing it into Torque I get an assertion error and it occurs here in this function TSShape::read() mainly at the point where it reads in the Sequences. For some reason inside my DTS file it reads in a value of -87546136, or something, that throws off the numSeq.SetSize() function. I notice that the sequence number is stored after the 32-bit, 16-bit, and 8-bit memory buffers. So my question is if using DTSShape shouldn't the buffer lengths be checked? So that the values returned by reading in the buffer from TSShape::read() is the correct length? Or where in the DTSShape::save() function is there room to overwrite the buffer so it is not the correct length any longer?
I'm going to review this again tonight, but if anyone has any suggestions please let me know. Also when I'm done with this and writing the resource I am making the exporter source code open source so others can learn from what I've done, and maybe more exporters can be written by the GG community.
Here's my problem with the exporter now, if anyone from the GG community can step up and help me answer the question it would be great. Plus as soon as I finish this exporter I am writing a resource to writing your own exporter but the source code for the ms2dts and the DTS SDK itself helps a lot, and I hope by writing this resource I can give back to the community. But I digress as usual, back to my problem. After writing to the exporter using the DTSShape::save() method I get a DTS file, however when bringing it into Torque I get an assertion error and it occurs here in this function TSShape::read() mainly at the point where it reads in the Sequences. For some reason inside my DTS file it reads in a value of -87546136, or something, that throws off the numSeq.SetSize() function. I notice that the sequence number is stored after the 32-bit, 16-bit, and 8-bit memory buffers. So my question is if using DTSShape shouldn't the buffer lengths be checked? So that the values returned by reading in the buffer from TSShape::read() is the correct length? Or where in the DTSShape::save() function is there room to overwrite the buffer so it is not the correct length any longer?
I'm going to review this again tonight, but if anyone has any suggestions please let me know. Also when I'm done with this and writing the resource I am making the exporter source code open source so others can learn from what I've done, and maybe more exporters can be written by the GG community.
About the author
#2
03/27/2002 (10:46 am)
That's what I was thinking Matt but after stepping through the exporter and going to sequence.size() it is set to 0 as I am not supporting animation, yet. However, when reading from TSShape::read() it picks it up as -8754321 or something. Which leads me to believe that during the save routine in the exporter it is either not saving values correctly to determine the "true" length of the file buffers, or it is overwriting somewhere so when TSShape::read()->Sequence is read it reads some positon that is not the "true" location of where sequence.size(), in the exporter, was written too.
#3
04/25/2002 (5:21 am)
I'm glad to hear your making a Maya export; you can't understand how badly I despise 3Ds Max
#4
Try making it global and see if same happens.
03/19/2003 (11:51 am)
Are you losing scope of the variable in the new function? Causing it to become a new variable thats not initialized?Try making it global and see if same happens.

Torque Owner Matt W