python - Convert_obj_two.py 语法错误

标签 python 3d three.js webgl

每当我尝试转换 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,因此您可以通过更改 print 语句以使用 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_two.py 语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15163812/

相关文章:

python - Python 中等效的 'nth_element' 函数是什么?

python - 如何制作可移植的 python 桌面应用程序?

python - 将重复行转换为独立列

javascript - 将场景渲染为纹理 Three.js

python - Pandas:如何在二维以上构建数据?

image - Three.js 从图像导入 svg 路径

javascript - Threejs 将裁剪应用于对象的特定区域

python - 在 PyObjc 和 Cocoa 中实现 NSText 委托(delegate)方法

graphics - 为什么单个深度缓冲区足以满足这个 vulkan 交换链渲染循环?

javascript - Threejs CameraHelper点坐标