I'm trying to select 400 or so random points on the face of a mesh using a script (just on the face, not inside the volume) but I'm not sure how to do that.
I've tried looking into the following function:
bpy_extras.mesh_utils.face_random_points(num_points, tessfaces)
but I'm not sure how to use it in a script.
Currently, I've tried running it as such:
import bmesh
obj = bpy.data.objects[1] #Gets the object
me = obj.data
bm = bmesh.from_edit_mesh(me)
faces_select = [f for f in bm.faces if f.select]
bpy_extras.mesh_utils.face_random_points(400, faces_select)
but I get the following error:
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "C:\Program Files\Blender Foundation\Blender\2.75\scripts\modules\bpy_extras\mesh_utils.py", line 533, in face_random_points
verts = f.id_data.vertices
AttributeError: 'BMFace' object has no attribute 'id_data'
and I have no idea what that means. A simple script to select an object from bpy.data.objects and select 400 points from its faces would be really helpful.
http://blender.stackexchange.com/questions/23086/add-a-simple-vertex-via-python
– paragbhtngr May 04 '16 at 15:52