How can I export or print coordinates of each selected vertex?

The name of the pictureThe name of the pictureThe name of the pictureClash 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.










share|improve this question









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.

























    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.










    share|improve this question









    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.





















      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.










      share|improve this question









      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






      share|improve this question









      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.











      share|improve this question









      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.









      share|improve this question




      share|improve this question








      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.




















          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






          share|improve this answer



























            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")





            share|improve this answer




















              Your Answer




              StackExchange.ifUsing("editor", function ()
              return StackExchange.using("mathjaxEditing", function ()
              StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
              StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
              );
              );
              , "mathjax-editing");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "502"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );






              Jan Čeleďa is a new contributor. Be nice, and check out our Code of Conduct.









               

              draft saved


              draft discarded


















              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






























              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






              share|improve this answer
























                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






                share|improve this answer






















                  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






                  share|improve this answer












                  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







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 1 hour ago









                  rob

                  469312




                  469312






















                      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")





                      share|improve this answer
























                        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")





                        share|improve this answer






















                          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")





                          share|improve this answer












                          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")






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 1 hour ago









                          cnisidis

                          1665




                          1665




















                              Jan Čeleďa is a new contributor. Be nice, and check out our Code of Conduct.









                               

                              draft saved


                              draft discarded


















                              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.













                               


                              draft saved


                              draft discarded














                              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













































































                              Comments

                              Popular posts from this blog

                              What does second last employer means? [closed]

                              List of Gilmore Girls characters

                              Confectionery