每当我尝试转换obj文件时,都会在第781行收到语法错误。

C:\Users\Paul>cd "C:\Users\Paul\Documents\GitHub\three.js\utils\converters\obj"

C:\Users\Paul\Documents\GitHub\three.js\utils\converters\obj>python convert_obj_
three.py -i dragon.obj -o dragon.js -x 1000
File "convert_obj_three.py", line 781
print "WARNING: skipping morph [%s] with different number of vertices [%d] t
han the original model [%d]" % (name, n_morph_vertices, n_vertices)

                           ^
SyntaxError: invalid syntax


我不确定发生了什么。我检查了自己在对付那些取得成功的人身上所做的事情,但似乎没有做错任何事情。有任何想法吗?

最佳答案

由于您在评论中提到您正在使用Python 3.3,因此可以通过更改打印语句以使用3.x的字符串format运算符(和print()作为函数)来解决此问题:

print(
    "WARNING: skipping morph {} with different number of vertices {} "
    "than the original model {}".format(name, n_morph_vertices, n_vertices)
)


或者,您可以直接使用python 2.x解释器运行相同的脚本,而无需进行任何更改。

关于python - convert_obj_three.py的语法错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15163812/

10-12 17:34
查看更多