PStokes
PStokes

Reputation: 138

Syntax Error with convert_obj_three.py

Whenever I try to convert my obj file I get a syntax error on line 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

I am not sure what is going on. I checked what I was doing against others who have had success and I don't seem to be doing anything wrong. Any ideas?

Upvotes: 1

Views: 1741

Answers (1)

Nitzle
Nitzle

Reputation: 2477

Since you mentioned in your comment that you're using Python 3.3, you can fix this by changing your print statement to use 3.x's string format operator (and print() as a function):

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

Or you can just run the same script using a python 2.x interpreter without any changes.

Upvotes: 2

Related Questions