farbrausch / fr_public

Farbrausch demo tools 2001-2011
3.38k stars 346 forks source link

.OBJ file importer (minimesh) #19

Closed Skinnytorus closed 12 years ago

Skinnytorus commented 12 years ago

Hello. Have been testing importers lately. XSI seems to work OK, but OBJ fails to. I tried different .obj export options (I used Blender). Got 2 results:

  1. OBJ Op doesn't show anything in 3d view and remains red all the way, or
  2. Causes wz3 to cash with Debug Assertion Faild window referring to: ...VS2010\VC\include\vector Line 932 Expression: vector subscript out of range

Is OBJ import supposed to work at all? Or are there any prerequisites one should take account of while exporting an .obj file? Thank you.

rygorous commented 12 years ago

This was only used once, in 2004, to debug something else :) (kkrieger collision stuff - was easier to just fprintf an .OBJ file from the collision builder than to hook it up properly). That said, it can totally be made to work in a useful manner :). I'll look into it.

Skinnytorus commented 12 years ago

Cool. It would be great to see OBJ working as it should! Thanks.

rygorous commented 12 years ago

Can you send me an .OBJ file that you think should work?

Skinnytorus commented 12 years ago

ryg just sent you the test models. check your e-mail.

rygorous commented 12 years ago

Okay, should be fixed now. Note the MinMesh side of the OBJ loader is still very limited; the material information is completely thrown away, as are things like smoothing groups. Don't expect too much :)

Skinnytorus commented 12 years ago

Many thanks for that!

Skinnytorus commented 12 years ago

Just tested the new obj importer. A little clarification needed. If 'the material information is completely thrown away' does this mean that I can not apply any textured material to such mesh (through MatInput for exmple)? So far I can't do that... Thank you.

rygorous commented 12 years ago

You can apply a texture after it's converted to MinMesh, but the .OBJ loader won't automatically create any materials matching the parameters in the file.

Skinnytorus commented 12 years ago

I sent you a file illustrating what I mean. It seems that all texture information is discarded when I connect a material to the imported OBJ mesh... Strange...