Ok, I'm converting the models for my shipset (using obj2dattex.py) and three of them (namely the cat_body, python_cc_body and python_cc_eng) are refusing to convert, giving me this error:
converting...
['cat_body.obj']
cat_body.obj->cat_body.dat
going to open material library file: cat_body.mtl
Material default_cat3.png -> cat3.png
Traceback (most recent call last):
File "C:\models\Obj2DatTex.py', line 137, in <module>
textureName = tokens[1]
IndexError: list index out of range
Ok, I'm converting the models for my shipset (using obj2dattex.py) and three of them (namely the cat_body, python_cc_body and python_cc_eng) are refusing to convert, giving me this error:
Code:
converting...
['cat_body.obj']
cat_body.obj->cat_body.dat
going to open material library file: cat_body.mtl
Material default_cat3.png -> cat3.png
Traceback (most recent call last):
File "C:\models\Obj2DatTex.py', line 137, in <module>
textureName = tokens[1]
IndexError: list index out of range
whats going wrong and how can I fix it?
I'd the same mishappen yesterday. I went back to Blender, unpacked the png. Opened the proper png file again in UV View and repacked it. Then I overwrited the obj and mtl files 'et voilá' . It worked again.
There is an art, it says, or rather, a knack to flying. The knack lies in learning how to throw yourself at the ground and miss. … Clearly, it is this second part, the missing, which presents the difficulties. Bloghttp://mimoriarty.wordpress.com/
I believe the problem it's, somehow, there're more than 1 image file packed into the mtl file.
There is an art, it says, or rather, a knack to flying. The knack lies in learning how to throw yourself at the ground and miss. … Clearly, it is this second part, the missing, which presents the difficulties. Bloghttp://mimoriarty.wordpress.com/
I believe the problem it's, somehow, there're more than 1 image file packed into the mtl file.
Generally Blender doesn't have a problem with that, I've made models with more than 8 textures reffed to the image and they have still exported/converted fine. Upon closer examination these particular models also had specular maps set up in blender (so I could blender-render them to get a better veiw of what they look like) Upon removing that second map as you suggested it has all gone smoothly, Cheers!
Generally Blender doesn't have a problem with that
The problem wasn't Blender. I believe it's the Obj2DatTex.py whose is not able to convert obj+mtl files with more than 1 texture file packed but i'm not really sure about that because i'm not programer.
There is an art, it says, or rather, a knack to flying. The knack lies in learning how to throw yourself at the ground and miss. … Clearly, it is this second part, the missing, which presents the difficulties. Bloghttp://mimoriarty.wordpress.com/
Generally Blender doesn't have a problem with that
The problem wasn't Blender. I believe it's the Obj2DatTex.py whose is not able to convert obj+mtl files with more than 1 texture file packed but i'm not really sure about that because i'm not programer.
obj2datTex.py converts models with many textures just fine..
Does anyone know how to fix the model in Blender so that it snaps to a background grid, no matter which angle you choose? I can't seem to figure it out, but I somehow had my models so they would snap right to a grid behind, whether it was front, back, left, right, or up, down. As it is now, when I choose one of those viewpoints, there is no background grid, and the model doesn't even appear to be centered. Kind of confusing, and much harder to get models centered correctly. Any suggestions?
I get some odd lighting issues ingame when i convert a model with the Obj2DatTexNorm.py script, i haven't quite worked out why it's happening, but it seems to be faces that point along a certain axis, the X axis i think, they switch instantly from being unlit to being fully lit without any in-between stages. Is this being caused by modelling crapness on my behalf, or something in the script that's getting the average normal wrong when it groups a few polygons together that face along the X axis (and possibly only X+ )?
I noticed it on a cargo pod model i was workng on, the 5 point polygon 'ends' had the problem whilst the cylinder sides were OK, i tried a few things such as putting a central vertex 'pole' in the end polygon and connecting it to the edges like this
but it didn't help (plus i also made sure all points were aligned so that all the end polygons were 'flat')
I've never used obj2dattexnorm.py, so I can't help with that, but when I made a similar shaped cylindrical thing (that funky fuel station from a while back) it worked fine using just the obj2dattex.py, so try using that and see if the problems remain. (btw, this would also be caused if you made a high-poly model and baked the normals to the low poly one if the high-poly one had a flipped normal, however you have explaned how you make normal maps and it's not like this...)
Yeah, it seems to work ok with obj2dattex.py but i'm not sure if that script supports setting hard/soft edges on the model prior to export- i'm using the smooth=true option in oolite and the hard edges are great for controling how the light moves across the ship
Fixed a nasty bug where trailing zeros in integers were removed.
When a face’s winding is changed (in any winding mode), the texture coordinates are no longer messed up.
Added new option to flip normals independently of winding mode.
Options are now set through a friendly command-line interface instead of by changing the script. There’s even a --help option. Welcome to the nineteen-seventies, gentlemen.
For example, to create an “inside-out” object to use as a dock, use: ./Obj2DatTexNorm.py --winding-mode 1 --flip-normals myDock.obj
Testing is very welcome, as are bug reports for files that don’t convert well with this version. For a failure report to be useful, it must include the OBJ file causing the problem, its associated MTL file, and preferably the original Wings/Blender/whatever file and textures.
Does this maintenance version of the script need a particular version of python? i've got version 2.6 installed on a windows 7 pro 64 bit PC and when i try and convert a model using
I'm still seeing lighting issues on surfaces facing the X axis
here's a zip containing the model in .wings format with hard/soft edges marked and also the .obj format of the model exported from wings
and a test oxp containing the obj converted to .dat with Obj2DatTexNorm.py "The particular version described in this post" version from the post above. The test oxp has a script to spawn 10 barrels outside the station on launch, have a look at them spinning in space, the end caps switch instantly from dark to light https://www.box.com/s/63feb7453a7ecb8676da
The normals in the converted model are correct, and the sudden switching goes away if I turn off shaders, so I’m going to dispute that this particular problem is my fault.
However, in verifying this i found a severe bug in winding mode 2 (the default) which is now fixed.