Need Testers for Blender Exporter
by James Urquhart · in Torque Game Engine · 08/22/2003 (1:26 pm) · 22 replies
Hey there,
For the past few days, i have been writing a blender exporter that (via some process) converts blender scenes to torque .dts objects. (since there is currently no way i can make DTS files in linux)
[removed. see resource]
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4662
I would apreciate any comments =)
For the past few days, i have been writing a blender exporter that (via some process) converts blender scenes to torque .dts objects. (since there is currently no way i can make DTS files in linux)
[removed. see resource]
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4662
I would apreciate any comments =)
About the author
#2
I also tried the lowpolycar.blend from blender gamekit cd and got the same error.
It seems to work with the demo file you provided in the tarball.
Note: am using Mandrake 9.1/python 2.2 (version that came with mdk).
08/22/2003 (6:43 pm)
When i try to export simple shapes (donut/torus for example) i get the followingFile "blend2silly.py", line 384, in ?
DumpSilly(file)
File "blend2silly.py", line 327, in DumpSilly
sm.dIndex = sname[1]
IndexError: list index out of rangeI also tried the lowpolycar.blend from blender gamekit cd and got the same error.
It seems to work with the demo file you provided in the tarball.
Note: am using Mandrake 9.1/python 2.2 (version that came with mdk).
#3
You need to name the meshes(and their objects) in the scene properly :
e.g
You also need to make sure that the mesh is made up of triangles only.
Also, be sure to assign a material to the mesh(name will be the name of the texture that torque loads, minus the extension), aswell as texture coordinates (F & U buttons)
Finally, make sure you have at least 1 armature in the scene named "Root"
Then to convert the .silly file to a .dts, just use the "silly2dts" program.
Hope that helps =)
(btw it says this in the Readme.html file)
08/23/2003 (3:58 am)
Benoit:You need to name the meshes(and their objects) in the scene properly :
e.g
MyMesh|1|50Would tell the exporter this mesh belongs to detail level 1, and that detail level is size 50.
You also need to make sure that the mesh is made up of triangles only.
Also, be sure to assign a material to the mesh(name will be the name of the texture that torque loads, minus the extension), aswell as texture coordinates (F & U buttons)
Finally, make sure you have at least 1 armature in the scene named "Root"
Then to convert the .silly file to a .dts, just use the "silly2dts" program.
Hope that helps =)
(btw it says this in the Readme.html file)
#4
Will give these a try later today.
08/23/2003 (4:00 am)
Doh ... i only partially read enough to get started :) that will teach me!Will give these a try later today.
#5
(see first post for url)
Things fixed :
- A mesh no longer needs to be triangulated. If a face has 4 vertexes, the exporter splits them into two triangles.
- The texturing problem should be fixed.
- The exporter now only uses the "OB:" (object) name to get a mesh, so now the mesh ("ME:") can be called anything. Only the object name needs to be in the format "||"
08/23/2003 (7:50 am)
I've just made a few fixes to the blender exporter and uploaded everything again as version "0.51"(see first post for url)
Things fixed :
- A mesh no longer needs to be triangulated. If a face has 4 vertexes, the exporter splits them into two triangles.
- The texturing problem should be fixed.
- The exporter now only uses the "OB:" (object) name to get a mesh, so now the mesh ("ME:") can be called anything. Only the object name needs to be in the format "
#6
09/17/2003 (8:03 am)
James could you repost a working link to your exporter. I suffered a HD outage last week, and thought i had a backup but unfortunately looks like i lost the file, and i tried access the first link you post but seems like its dead.
#8
09/17/2003 (10:10 am)
Thanks. I got a bit side tracked recently, so i haven't been able to work with it more :) , but have you done any more work on it?
#9
Im in bad need of a exporter for blender and will contribute as much as i can to it!
10/08/2003 (11:19 pm)
Please, can i test this?Im in bad need of a exporter for blender and will contribute as much as i can to it!
#10
Please see the resource -
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4662
The pure python scripts currently suffer from a problem in the DTSStream class, and i have not yet been able to solve the problem.
However the other exporter works (although buggy in certain functions, and limited in that it can only export static meshes) =)
10/09/2003 (6:58 am)
@Luke :Please see the resource -
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4662
The pure python scripts currently suffer from a problem in the DTSStream class, and i have not yet been able to solve the problem.
However the other exporter works (although buggy in certain functions, and limited in that it can only export static meshes) =)
#11
-Josh
10/09/2003 (7:19 am)
@James: I just really need to cheer you on, GO MAN GO... THIS IS AWESOME!!!!-Josh
#12
Seeing as im a coder with zero modeling exp (need plugin for team), is anyone able to contribute a few models, such as:
basic mesh.
basic mesh with animation.
int/ext statics and so on?
Im hoping i can put as much effort into helping this as i can, tho i dont really know too much python.
Im guessing that the pure python script prob with DTSStream class, may be that its not writing the stream in the correct order?
Maybe a look at any model files generated by it (as in hex) and looking through the headers and such maybe help to figure it out a bit more?
10/10/2003 (1:43 am)
Thanks, i ended up finding it..Seeing as im a coder with zero modeling exp (need plugin for team), is anyone able to contribute a few models, such as:
basic mesh.
basic mesh with animation.
int/ext statics and so on?
Im hoping i can put as much effort into helping this as i can, tho i dont really know too much python.
Im guessing that the pure python script prob with DTSStream class, may be that its not writing the stream in the correct order?
Maybe a look at any model files generated by it (as in hex) and looking through the headers and such maybe help to figure it out a bit more?
#13
The buffers magically increase size by 3 bytes (except the 8bit buffer)
It also appears that some numbers magically reappear twice, etc.
(So stuff we read/write is going haywire)
The DTSShape and DTSMesh classes have been coded to read things in the correct order from the correct buffer, so no problem there.
10/10/2003 (7:28 am)
@Luke :The buffers magically increase size by 3 bytes (except the 8bit buffer)
It also appears that some numbers magically reappear twice, etc.
(So stuff we read/write is going haywire)
The DTSShape and DTSMesh classes have been coded to read things in the correct order from the correct buffer, so no problem there.
#14
I got the shape reading code broken again(doesn't like to read torque shapes), but i got the Dts Stream class reading and writing properly again =)
Will update the copy in the resource later.
10/10/2003 (8:26 am)
Update...I got the shape reading code broken again(doesn't like to read torque shapes), but i got the Dts Stream class reading and writing properly again =)
Will update the copy in the resource later.
#15
Are you saying that the models outputed by DtsStream in the pure Python scripts are now working ingame, or just writing prop?
I dont have time to check it out at the moment, but please keep the files updated. I'll do the best i can to help.
Cheers.
10/14/2003 (2:29 am)
So Dts Stream is going and shape stuff reading broke?Are you saying that the models outputed by DtsStream in the pure Python scripts are now working ingame, or just writing prop?
I dont have time to check it out at the moment, but please keep the files updated. I'll do the best i can to help.
Cheers.
#16
As of today, the following things happen :
- The Script can load in meshes (except Skin meshes)
- The Script can save meshes, but they cannot be read back in (need to investiagate, checkpoints are ok) - Presumably a write problem.
- Any shapes generated cannot be loaded into torque (see previous item)
- The blender script can export meshes and sequences (still needs a bit of modding in the area of keyframes).
The world position for the mesh verts still needs to be calculated aswell.
10/14/2003 (7:27 am)
Luke,As of today, the following things happen :
- The Script can load in meshes (except Skin meshes)
- The Script can save meshes, but they cannot be read back in (need to investiagate, checkpoints are ok) - Presumably a write problem.
- Any shapes generated cannot be loaded into torque (see previous item)
- The blender script can export meshes and sequences (still needs a bit of modding in the area of keyframes).
The world position for the mesh verts still needs to be calculated aswell.
#17
and now there comes the but: :)
... but it dont works for me.
I have modeled just a simply object by extruding the default plane and triangulating it, repairing normals outside, giving it a material (default) and image texture, giving it a name like myobject|1|50.
than i loaded your script into and alt+p'd:
Using a clean Global Dictionary.
DTS Exporter running...
> No Nodes Present. Adding Dummy
> Adding Object Plane
> Added Materials from Object
Traceback (most recent call last):
File "/opt/Python_Torque/Dts_Blender.py", line 466, in ?
Shape = BlenderShape()
File "/opt/Python_Torque/Dts_Blender.py", line 319, in __init__
tmsh = BlenderMesh(self, msh, DtsMesh().T_Normal, 0, self.scaleFactor) # Root is always 0
AttributeError: DtsMesh instance has no attribute 'T_Normal'
than i looked into your code... and well, he's right, T_Normal is not defined. I changed it and tried it again with every defined T_x type, leading to various other errors (can give you if you need, but dont think so)
the PYTHONPATH is set correctly
i am using blender 2.28c and got your script from the garagegames resource page.
any ideas?
thanx
10/15/2003 (11:53 pm)
Hello, first of all i want to thank you for doing this...and now there comes the but: :)
... but it dont works for me.
I have modeled just a simply object by extruding the default plane and triangulating it, repairing normals outside, giving it a material (default) and image texture, giving it a name like myobject|1|50.
than i loaded your script into and alt+p'd:
Using a clean Global Dictionary.
DTS Exporter running...
> No Nodes Present. Adding Dummy
> Adding Object Plane
> Added Materials from Object
Traceback (most recent call last):
File "/opt/Python_Torque/Dts_Blender.py", line 466, in ?
Shape = BlenderShape()
File "/opt/Python_Torque/Dts_Blender.py", line 319, in __init__
tmsh = BlenderMesh(self, msh, DtsMesh().T_Normal, 0, self.scaleFactor) # Root is always 0
AttributeError: DtsMesh instance has no attribute 'T_Normal'
than i looked into your code... and well, he's right, T_Normal is not defined. I changed it and tried it again with every defined T_x type, leading to various other errors (can give you if you need, but dont think so)
the PYTHONPATH is set correctly
i am using blender 2.28c and got your script from the garagegames resource page.
any ideas?
thanx
#18
The two mesh types that should work are T_Standard and T_Skin.
(however torque crashes on skin meshes the script generates, and standard meshes don't load properly)
The current scripts don't require you to name your mesh in any particular way. This is because it exports everything as 1 detail level (will remove that limitation when the exporter works a bit better)
Changing it to "T_Standard" should work.
There might also be another script error (typo), involving an if statement checking if the "ty" is "T_Skin"
The correct code would be "if ty == self.T_Skin:"
Hopefully soon i will get shapes writing properly so they will load properly in torque =)
I will probably be uploading another version later today.
Thanks for taking your time to test :)
10/16/2003 (9:10 am)
Heiko,The two mesh types that should work are T_Standard and T_Skin.
(however torque crashes on skin meshes the script generates, and standard meshes don't load properly)
The current scripts don't require you to name your mesh in any particular way. This is because it exports everything as 1 detail level (will remove that limitation when the exporter works a bit better)
Changing it to "T_Standard" should work.
There might also be another script error (typo), involving an if statement checking if the "ty" is "T_Skin"
The correct code would be "if ty == self.T_Skin:"
Hopefully soon i will get shapes writing properly so they will load properly in torque =)
I will probably be uploading another version later today.
Thanks for taking your time to test :)
#19
Good news, the exporter now can export static meshes (without animation or collision). In english, this means it is now slighty more useful =)
I would apreciate it if anyone else can give me any feedback on the exporter (e.g improvements, problems, criticism, etc)
Again, the url for the resource :
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4662
10/17/2003 (10:57 am)
Update :Good news, the exporter now can export static meshes (without animation or collision). In english, this means it is now slighty more useful =)
I would apreciate it if anyone else can give me any feedback on the exporter (e.g improvements, problems, criticism, etc)
Again, the url for the resource :
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4662
#20
Im having a play aroung with it at the moment, using it as a way to learn python, wish i had something to give.
10/31/2003 (7:03 pm)
How is it coming along?Im having a play aroung with it at the moment, using it as a way to learn python, wish i had something to give.
Torque Owner Benoit Touchette