Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I recently just found soya3d. I want to import .obj files, but it seems to only accept .data files. How can I import .obj files?

Importing a .obj file named "house" produces this error:

Traceback (most recent call last):  
  File "introduction.py", line 7, in <module>  
    model = soya.Model.get("house")  
  File "/usr/lib/pymodules/python2.6/soya/__init__.py", line 259, in get  
    return klass._alls.get(filename) or klass._alls.setdefault(filename, klass.load(filename))  
  File "/usr/lib/pymodules/python2.6/soya/__init__.py", line 268, in load  
    dirname  = klass._get_directory_for_loading_and_check_export(filename)  
  File "/usr/lib/pymodules/python2.6/soya/__init__.py", line 194, in _get_directory_for_loading_and_check_export  
    dirname = klass._get_directory_for_loading(filename, ext)  
  File "/usr/lib/pymodules/python2.6/soya/__init__.py", line 171, in _get_directory_for_loading  
    raise ValueError("Cannot find a %s named %s!" % (klass, filename))  
ValueError: Cannot find a <class 'soya.Model'> named house!  
* Soya3D * Quit...
share|improve this question

1 Answer 1

According to the (yet-in) complete guide to Soya 3D, the only supported model formats are .blend files or its own custom format. I've found a couple places that said you can import .obj files by placing them in a certain directory, but there was no proof or confirmation.

At any rate, I can say that if importing .obj files directly is possible, it's not in the documentation.

So to use your files, I recommend importing them with Blender, saving as a .blend file, then importing that with Soya. Either that, or use a separate .obj parser. This file looks to me like it will work, but I offer no guarantees. I'm sure you can write your own as well; .obj files are notoriously easy to parse.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.