How can I export or print coordinates of each selected vertex?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
I am pretty new to Blender. I need to get coordinates of each selected vertex somehow. I don't really want to manually copy coordinates of each and single vertex that would just take a lot of time. I need them either printed somewhere or save them into some kind of text file.
Again I need only those vertexes I have selected, not the entire model.
export vertices coordinates
New contributor
Jan ČeleÄÂa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
1
down vote
favorite
I am pretty new to Blender. I need to get coordinates of each selected vertex somehow. I don't really want to manually copy coordinates of each and single vertex that would just take a lot of time. I need them either printed somewhere or save them into some kind of text file.
Again I need only those vertexes I have selected, not the entire model.
export vertices coordinates
New contributor
Jan ČeleÄÂa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am pretty new to Blender. I need to get coordinates of each selected vertex somehow. I don't really want to manually copy coordinates of each and single vertex that would just take a lot of time. I need them either printed somewhere or save them into some kind of text file.
Again I need only those vertexes I have selected, not the entire model.
export vertices coordinates
New contributor
Jan ČeleÄÂa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I am pretty new to Blender. I need to get coordinates of each selected vertex somehow. I don't really want to manually copy coordinates of each and single vertex that would just take a lot of time. I need them either printed somewhere or save them into some kind of text file.
Again I need only those vertexes I have selected, not the entire model.
export vertices coordinates
export vertices coordinates
New contributor
Jan ČeleÄÂa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Jan ČeleÄÂa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 1 hour ago


Amir
1,0071320
1,0071320
New contributor
Jan ČeleÄÂa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 hours ago
Jan ČeleÄÂa
83
83
New contributor
Jan ČeleÄÂa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Jan ČeleÄÂa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Jan ČeleÄÂa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
Open up a new Text window and copy and past the following.
import bpy
import bmesh
# Get the active mesh
obj = bpy.context.edit_object
me = obj.data
# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)
bm.faces.active = None
# Modify the BMesh, can do anything here...
for v in bm.verts:
if v.select:
print(tuple(v.co) )
Make sure you are in Edit mode with the required vertices selected and click "Run Script"
The coordinates of each selected vertices is now printed in the System Console.
If you can not see the System Console select Toggle System Console in the Window menu.
To get this code I used the Bmesh Simple Editmode template from the Templates/Python
add a comment |Â
up vote
1
down vote
Another possible way is to do it with vertex groups (as I do often in order to keep things in tact)
So you select the vertices you want to keep in track (in edit mode) and assign them into the group of your choice, then you change the groupName and filename (optional) variables accordingly if you want to keep track on different groups.
import bpy
groupName = "Group"
filename = "myVerts"
if (filename not in bpy.data.texts):
myVerts = bpy.data.texts.new(filename)
else :
myVerts = bpy.data.texts[filename]
myVerts.clear()
myGroupsArr = ;
obj = bpy.context.selected_objects[0]
group = obj.vertex_groups[groupName]
for v in obj.data.vertices:
for g in v.groups:
print(g.group, group.index)
if g.group == group.index:
myGroupsArr.append()
for grp in myGroupsArr:
myVerts.write( str(grp[0])+str(grp[1])+str(grp[2])+ "n")
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Open up a new Text window and copy and past the following.
import bpy
import bmesh
# Get the active mesh
obj = bpy.context.edit_object
me = obj.data
# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)
bm.faces.active = None
# Modify the BMesh, can do anything here...
for v in bm.verts:
if v.select:
print(tuple(v.co) )
Make sure you are in Edit mode with the required vertices selected and click "Run Script"
The coordinates of each selected vertices is now printed in the System Console.
If you can not see the System Console select Toggle System Console in the Window menu.
To get this code I used the Bmesh Simple Editmode template from the Templates/Python
add a comment |Â
up vote
2
down vote
accepted
Open up a new Text window and copy and past the following.
import bpy
import bmesh
# Get the active mesh
obj = bpy.context.edit_object
me = obj.data
# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)
bm.faces.active = None
# Modify the BMesh, can do anything here...
for v in bm.verts:
if v.select:
print(tuple(v.co) )
Make sure you are in Edit mode with the required vertices selected and click "Run Script"
The coordinates of each selected vertices is now printed in the System Console.
If you can not see the System Console select Toggle System Console in the Window menu.
To get this code I used the Bmesh Simple Editmode template from the Templates/Python
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Open up a new Text window and copy and past the following.
import bpy
import bmesh
# Get the active mesh
obj = bpy.context.edit_object
me = obj.data
# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)
bm.faces.active = None
# Modify the BMesh, can do anything here...
for v in bm.verts:
if v.select:
print(tuple(v.co) )
Make sure you are in Edit mode with the required vertices selected and click "Run Script"
The coordinates of each selected vertices is now printed in the System Console.
If you can not see the System Console select Toggle System Console in the Window menu.
To get this code I used the Bmesh Simple Editmode template from the Templates/Python
Open up a new Text window and copy and past the following.
import bpy
import bmesh
# Get the active mesh
obj = bpy.context.edit_object
me = obj.data
# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)
bm.faces.active = None
# Modify the BMesh, can do anything here...
for v in bm.verts:
if v.select:
print(tuple(v.co) )
Make sure you are in Edit mode with the required vertices selected and click "Run Script"
The coordinates of each selected vertices is now printed in the System Console.
If you can not see the System Console select Toggle System Console in the Window menu.
To get this code I used the Bmesh Simple Editmode template from the Templates/Python
answered 1 hour ago
rob
469312
469312
add a comment |Â
add a comment |Â
up vote
1
down vote
Another possible way is to do it with vertex groups (as I do often in order to keep things in tact)
So you select the vertices you want to keep in track (in edit mode) and assign them into the group of your choice, then you change the groupName and filename (optional) variables accordingly if you want to keep track on different groups.
import bpy
groupName = "Group"
filename = "myVerts"
if (filename not in bpy.data.texts):
myVerts = bpy.data.texts.new(filename)
else :
myVerts = bpy.data.texts[filename]
myVerts.clear()
myGroupsArr = ;
obj = bpy.context.selected_objects[0]
group = obj.vertex_groups[groupName]
for v in obj.data.vertices:
for g in v.groups:
print(g.group, group.index)
if g.group == group.index:
myGroupsArr.append()
for grp in myGroupsArr:
myVerts.write( str(grp[0])+str(grp[1])+str(grp[2])+ "n")
add a comment |Â
up vote
1
down vote
Another possible way is to do it with vertex groups (as I do often in order to keep things in tact)
So you select the vertices you want to keep in track (in edit mode) and assign them into the group of your choice, then you change the groupName and filename (optional) variables accordingly if you want to keep track on different groups.
import bpy
groupName = "Group"
filename = "myVerts"
if (filename not in bpy.data.texts):
myVerts = bpy.data.texts.new(filename)
else :
myVerts = bpy.data.texts[filename]
myVerts.clear()
myGroupsArr = ;
obj = bpy.context.selected_objects[0]
group = obj.vertex_groups[groupName]
for v in obj.data.vertices:
for g in v.groups:
print(g.group, group.index)
if g.group == group.index:
myGroupsArr.append()
for grp in myGroupsArr:
myVerts.write( str(grp[0])+str(grp[1])+str(grp[2])+ "n")
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Another possible way is to do it with vertex groups (as I do often in order to keep things in tact)
So you select the vertices you want to keep in track (in edit mode) and assign them into the group of your choice, then you change the groupName and filename (optional) variables accordingly if you want to keep track on different groups.
import bpy
groupName = "Group"
filename = "myVerts"
if (filename not in bpy.data.texts):
myVerts = bpy.data.texts.new(filename)
else :
myVerts = bpy.data.texts[filename]
myVerts.clear()
myGroupsArr = ;
obj = bpy.context.selected_objects[0]
group = obj.vertex_groups[groupName]
for v in obj.data.vertices:
for g in v.groups:
print(g.group, group.index)
if g.group == group.index:
myGroupsArr.append()
for grp in myGroupsArr:
myVerts.write( str(grp[0])+str(grp[1])+str(grp[2])+ "n")
Another possible way is to do it with vertex groups (as I do often in order to keep things in tact)
So you select the vertices you want to keep in track (in edit mode) and assign them into the group of your choice, then you change the groupName and filename (optional) variables accordingly if you want to keep track on different groups.
import bpy
groupName = "Group"
filename = "myVerts"
if (filename not in bpy.data.texts):
myVerts = bpy.data.texts.new(filename)
else :
myVerts = bpy.data.texts[filename]
myVerts.clear()
myGroupsArr = ;
obj = bpy.context.selected_objects[0]
group = obj.vertex_groups[groupName]
for v in obj.data.vertices:
for g in v.groups:
print(g.group, group.index)
if g.group == group.index:
myGroupsArr.append()
for grp in myGroupsArr:
myVerts.write( str(grp[0])+str(grp[1])+str(grp[2])+ "n")
answered 1 hour ago


cnisidis
1665
1665
add a comment |Â
add a comment |Â
Jan ČeleÄÂa is a new contributor. Be nice, and check out our Code of Conduct.
Jan ČeleÄÂa is a new contributor. Be nice, and check out our Code of Conduct.
Jan ČeleÄÂa is a new contributor. Be nice, and check out our Code of Conduct.
Jan ČeleÄÂa is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fblender.stackexchange.com%2fquestions%2f120593%2fhow-can-i-export-or-print-coordinates-of-each-selected-vertex%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password