# Convert a mathutils.Vector object into 3D coordinates

I've been working with both Python and Blender for the first time over the past few days and keep running into these mathutils Vector objects which I have no idea what to do with. I can't figure out a way to convert a Vector into a plain X,Y,Z coordinate set that accurately maps to the Blender units, which I can use and apply to object.location

This:

<Vector (-1.0000, 1.0000, 1.0000)>


To: (x, y, z)

I have an object in the scene, a cube that has been resized into a box. I've made a mesh using bmesh, and am looping the edges and examining the Vector points. The problem is that they don't correlate to the blender units of the object I'm pulling them from in order to loop. Why don't the Vector coordinates translate exactly, what am I doing wrong? I'm sure I'm missing something really simple - any help is much appreciated! :)

• Please be more specific. How did you scale the object. What are the coordinates and what do you expect them to be? Did you expect world-coordinates when iterating over object points without applying the object transformation? Aug 26, 2018 at 18:47

## 1 Answer

You access Vector object as sequence like this:

This functionality comes from python, it's called slice notation.

From API reference:

Note: Classes, methods and attributes that accept vectors also accept other numeric sequences, such as tuples, lists.

You don't have to convert anything, both tuple or vector will work for object location:

• I have an object in the scene, a cube that has been resized into a box. I've made a mesh using bmesh, and am looping the edges and examining the Vector points. The problem is that they don't correlate to the blender units of the object I'm pulling them from in order to loop. Does that makes sense? Why doesn't the Vector coordinates translate exactly, what am I doing wrong? Aug 26, 2018 at 18:43
• @ineedhelp The mesh vertices locations are relative to the object's centre. If you need a vertex location relative to scene origin, you need to add the object transformation (it's translation) to the location of each vertex. Aug 26, 2018 at 21:34
• That makes sense, thanks. I will take a look! Aug 26, 2018 at 23:39