How do I convert a 2D vector into 3D?
EDITED:

Did find a quicker, easier way after all:

v2d = Vector((1,2))
v3d = v2d.to_3d()


Or if you do prefer to do it in place, rather than assign to a new variable (you were very close in your original attempts):

v = Vector((1,2))
v.resize_3d()

&gt;&gt;&gt; v
Vector((1.0, 2.0, 0.0)) # Has been converted in place to 3D


Old method:

Generate a new 3D vector from your 2D one:

from mathutils import Vector
2dVec = Vector((1,2))

3dVec = Vector((2dVec.x, 2dVec.y, 0))


If you have a whole list of 2d vecs, you can simply use a list comprehension to convert 'em all:

3dVecs = [ Vector((2dVec.x, 2dVec.y, 0)) for 2dVec in 2dVecs ]