Add in a single vert

Hi,

I’ve been trying to write a small add-on, (which was my first mistake :D) and this add-on is supposed to add in a single vert to start of retopology, but I keep getting the famous error “Python script fail, look in the console for now…” it adds an object, but the object does not have geometry in it.

I published it as an add-on, which installs, but does not run:


But anyway, below is the code I used:

import bpy

verts = [(1.0,1.0,1.0)]


me = bpy.data.meshes.new("Vert")

ob = bpy.data.objects.new("Vert", me)          
ob.location = bpy.context.scene.cursor_location   
bpy.context.scene.objects.link(ob) 

me.from_pydata(verts,[],)   
me.update(calc_edges=True)     


Thanks in advance!

I keep getting the famous error “Python script fail, look in the console for now…”

Do you know that you can see the actual error message in the system console?

It goes like:

Traceback (most recent call last):
  File "\operator_simple.py", line 12, in <module>
TypeError: from_pydata() missing 1 required positional argument: 'faces'
Error: Python script fail, look in the console for now...

You are missing the third parameter of from_pydata()

me.from_pydata(verts, , )

works.

Thanks! It works like a charm!

Hi blend1,
Do you know that:


and

but you have study the python code and it’s good for you!