2013-04-25 65 views
0

導出要使用的3D模型的方法是在我的three.js腳本中。不幸的是,我並不熟悉python和所有3D內容。將.obj-model導出爲three.js json-object導致python-errors

當我從windows shell運行converter-script(convert_obj_three.py)時,出現錯誤。 (腳本和模型在同一目錄中。)

$ c:/Python33/python convert_obj_three.py -i couch.obj -o couch.js 
File "convert_obj_three.py", line 781 
print "WARNING: skipping morph [%s] with different number of vertices [%d] than the original model [%d]" % (name, n_morph_vertices, n_vertices) 

         ^
SyntaxError: invalid syntax 

這是因爲模型有問題還是我犯了一個錯誤?

回答

0

問題是您使用Python 3而不是Python 2來運行腳本。

的Python 2:

print '' 

的Python 3:打印是一個函數並且沒有關鍵字所以它需要括號:

print('')