Add > Mesh > Vertex

Created because there is apparent demand and I was unable to find a similar add-on.

Installation

  • Download the script and save it in your preferred location for scripts; this can be anywhere, but I recommend a dedicated folder.
  • Open Blender and in the User Preferences window, go to the ‘Addons’ tab and choose ‘Install from File…’.
  • Navigate to the folder you saved the script in, select it and click ‘Install from File’
  • The script is now installed and Blender should auto-filter the add-on list to show it.
  • Click the check box in the script’s entry to activate it.

Location

Once installed and activated, the add-on can be accessed via the Add > Mesh menu when in Object Mode.
This add-on can also be access with the hot-key SHIFT A.

Method

The add-on works by:

  • Adding a new Vertex object
  • or magic. Your choice.
Known Issues and Limitations
  • The single vertex is hidden beneath the origin point upon creation.

Version 0.2 fixes the Edit Mode problem.
Version 0.2.1 fixes problem where the operator would send the user to Object Mode if called when in Edit Mode.
Version 0.3 rewriting of code after pink vertex showed me a better method.

Download and Wiki
https://github.com/RichardW3D/AddOnis/wiki/primitive_vertex_addprimitive_vertex_add_03.zip (1.07 KB)

Interesting idea… what was the reason for it?

wouldnt it be enough to simply do CTRL - Left Click in Editmode ? For me this adds new verts which are even connected by edges to the last vertex selected, it even addes edges and faces if more verts were selected.


bl_info = {
    "name": "New Vertex",
    "author": "your name here",
    "version": (1, 0),
    "blender": (2, 68, 0),
    "location": "View3D > Add > Mesh > New Vertex",
    "description": "Adds a new Mesh Object containing a single Vertex",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": "Add Mesh"}

import bpy
from bpy.props import FloatVectorProperty

class AddVertex(bpy.types.Operator):
    """Add a simple vertex mesh"""
    bl_idname = "mesh.primitive_vertex_add"
    bl_label = "Add Vertex"
    bl_options = {'REGISTER', 'UNDO'}

    location = FloatVectorProperty(
            name="Location",
            subtype='TRANSLATION',
            )

    def execute(self, context):

        mesh = bpy.data.meshes.new("Vertex")
        mesh.vertices.add(1)

        # add the mesh as an object into the scene with this utility module
        from bpy_extras import object_utils
        object_utils.object_data_add(context, mesh, operator=self)

        return {'FINISHED'}


def menu_func(self, context):
    self.layout.operator(AddVertex.bl_idname, icon='MESH_CUBE')


def register():
    bpy.utils.register_class(AddVertex)
    bpy.types.INFO_MT_mesh_add.append(menu_func)


def unregister():
    bpy.utils.unregister_class(AddVertex)
    bpy.types.INFO_MT_mesh_add.remove(menu_func)

if __name__ == "__main__":
    register()

copied the “Operator Mesh Add” template and erased everything unnecessary

So how did you solve the ‘single vertex is hidden by the larger object location marker’ problem?

@ 1d_Inc and Scorpion81
The point is to add a new object that has only one vertex. The person who wanted this function was tired of wasting time by adding a plane object, tabbing into Edit Mode and then merging the vertices. They wanted to speed up the process, so I wrote this add-on.

@pink vertex
Wait, there’s a template? facepalm
Thank you.

edit: There were some errors in the code you provided, but I worked out a solution. Thank you for your help.

@Orinoco
You mean the problem where the origin point is located in the exact same position as the single vertex added? I didn’t. I also don’t see a need to, since the origin point would be easier to see than the single vertex with default theme settings.

I’m using similar script “Add Single Vertisce & empty” by Meta Androcto and it is one of the most useful scripts.

Well, I’ve got it, but I don’t understand what it can be used for.
For example, I don’t feel the need to create that kind objects, so, maybe I missing something in my workflow?
I want to know what for people uses that kind of objects. Maybe for snapping? Or creating pointclouds with sripts like this?

Or something else?..

I’ve seen people use a single vertex as a starting point when using the Skin Modifier for creating a base mesh. They’ll often add a plane and merge the vertices to get the single vertex. Jonathan Williamson and Kent Trammell from Blender Cookie both use this method. It’s not a function that everyone needs, I think it’s fairly niche, but it’s there for those who do.

I presume that the person who asked for this on Blender Institute’s Facebook page wanted it for a similar work flow.

No dank0, the Meta Androcto add-on make a vertex and go in Edit mode.
I prefer the Richard W. add-on to make vertex everywhere on the object space to make several “favoris” points: faster!
Thks a lot for your job, Man!
Bye bye
Spirou4D

I erased the generic transform props which actually are needed by the utility module.

BTW:
The display size of vertices can be changed by User Preferences->Themes->3DView->Vertex Size.
Templates can be found in the text editor.


bl_info = {
    "name": "New Vertex",
    "author": "your name here",
    "version": (1, 0),
    "blender": (2, 68, 0),
    "location": "View3D > Add > Mesh > New Vertex",
    "description": "Adds a new Mesh Object containing a single Vertex",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": "Add Mesh"}

import bpy
from bpy.props import <b>BoolProperty,</b> FloatVectorProperty

class AddVertex(bpy.types.Operator):
    """Add a simple vertex mesh"""
    bl_idname = "mesh.primitive_vertex_add"
    bl_label = "Add Vertex"
    bl_options = {'REGISTER', 'UNDO'}

<b>    # generic transform props
    view_align = BoolProperty(
            name="Align to View",
            default=False
            #,options={'HIDDEN'} to hide this property from the toolbar
            )</b>

    location = FloatVectorProperty(
            name="Location",
            subtype='TRANSLATION',
            )
<b>
    rotation = FloatVectorProperty(
            name="Rotation",
            subtype='EULER',
            )</b>

    def execute(self, context):

        mesh = bpy.data.meshes.new("Vertex")
        mesh.vertices.add(1)

        # add the mesh as an object into the scene with this utility module
        from bpy_extras import object_utils
        object_utils.object_data_add(context, mesh, operator=self)

        return {'FINISHED'}


def menu_func(self, context):
    self.layout.operator(AddVertex.bl_idname, icon='MESH_CUBE')


def register():
    bpy.utils.register_class(AddVertex)
    bpy.types.INFO_MT_mesh_add.append(menu_func)


def unregister():
    bpy.utils.unregister_class(AddVertex)
    bpy.types.INFO_MT_mesh_add.remove(menu_func)

if __name__ == "__main__":
    register()

changes are made bold

I solved the problem by removing the rotation, location and alignment information entirely; using operator=None instead of operator=self. This seems to have worked perfectly.

class primitive_vertex_add(bpy.types.Operator):    """Add a vertex"""
    bl_idname = "mesh.primitive_vertex_add"
    bl_label = "Vertex"
    bl_options = {"REGISTER", "UNDO"}
    
    def execute(self, context):
        mesh = bpy.data.meshes.new("Vertex")
        mesh.vertices.add(1)
        
        from bpy_extras import object_utils
        object_utils.object_data_add(context, mesh, <b>operator=None</b>)
        return {'FINISHED'}

I knew there were templates, I just didn’t know there was one for the Add > Mesh menu and I didn’t even think to check (I just dove straight into coding).

Thank you for your help.

@Spirou4D
I’m glad you like the add-on.