Local and Global Location

Greetings

Well first things first thank you for your time and I hope you can help me :). I am currently working with a script in Blender, and my problem is with the location of the vertex in one of my mesh, (well actually I did not made it, I just found it) , I assigned a new location for the x,y and z coordinates, for example:

mymesh.verts[23].co= Mathutils.Vector(1,2,19)

However the assignment was global, blender move the vertex globally (and I expected local movement) and I do not how it was possible, I am working with other mesh and the assignment was local, all the time I was thinking to make the assignment global but I could not find how and I even thought it was not possible, and now with this new mesh all the assignment was global, so my question is, how can I manipulate global coordinates or how could I fix it and make the assignment local ?

Again thank you very much and have a good day

I’m not exactly sure what your problem is (other than some discrepancy between local and global placement), but once you figure out what system Blender uses (which wasn’t clear to me in your post), couldn’t you just add or subtract the object center’s global coordinates as needed to convert?

For example, if Blender places the verticies using global coordinates, but you want to place them in local coordinates:

  • Set your local coordinate: mylocalx = 2.3
  • convert by adding center location: myglobalx = mycenterx + mylocalx
  • now set the verticies x-coord to myglobalx

Given this, it’s pretty simple to go the other way, too. mylocalx = myglobalx - mycenterx