I would like to select only the vertices on the left side of my plane using Python (like on the screeenshot), does anybody have an idea how to do it ?
I try the following to get all vertices but i'm unable to isolate those on the left.
My actual code to get all the vertices:
bpy.ops.import_image.to_plane(
files=[{'name': os.path.basename(file)}],
directory=os.path.dirname(file)
)
obj = bpy.context.object
group = obj.vertex_groups.new(name = 'Group' + str(number))
index = 0
verts = []
for v in obj.data.vertices:
verts += [index]
index = index + 1
print(v.co)
group.add(verts, 1.0, 'REPLACE')

bpy.ops.object.mode_set(mode = 'OBJECT')and this linegroup.add([v.index for v in data.vertices if v.select], 1.0, 'REPLACE')at the end of the script. Don't forget the line from your answer where you create the vertex group. – Gorgious Apr 15 '20 at 09:41