How to set vertex radius when using skin modifier? I have this method that I want to use to change the skin size of the skin modifier.

If I do this, everything works fine:

def make_uniform_width() -&gt; None:
    bpy.ops.object.editmode_toggle()
    bpy.ops.mesh.select_all(action='SELECT')
    bpy.ops.transform.skin_resize(
        value=( self.properties.skin_size, self.properties.skin_size, self.properties.skin_size ),
    )
    bpy.ops.object.editmode_toggle()


I can just use: bpy.ops.mesh.select_all(action='SELECT') to change the value on all vertecies simultaniously.

But I want to select specific vertecies to do the skin_resize. So I thought this could work. But I have no access to the vertecies it seems.

def make_increase_width(self):
    bpy.ops.object.editmode_toggle()
    size = self.properties.skin_size
    for iteration in self._iterations:
        for vert in bpy.ops.object.vertecies:
            if vert.index in self._iterations[iteration]:
                vert.select = True
            else:
                vert.select = False

        size += self.properties.width_increase
        bpy.ops.transform.skin_resize(value=( size, size, size ))
    bpy.ops.object.editmode_toggle()


Is there a way to select specific vertecies from editmode?

EDIT:
I tried this, but it's too slow te execute. Maybe I will have to look for another way to change the skin width.

def make_increase_width(self, vein_cluster_object):
    for iteration in self._iterations:
        vein_cluster_object.vertex_groups.new(name='growth-iteration-%i' % iteration)
    for iteration,group in zip(self._iterations,vein_cluster_object.vertex_groups):
        group.add(self._iterations[iteration], weight=1, type='REPLACE')
    bpy.ops.object.editmode_toggle()
    size = self.properties.skin_size
    for iteration in self._iterations:
        bpy.ops.mesh.select_all(action='SELECT')
        bpy.ops.object.vertex_group_deselect()
        bpy.ops.object.vertex_group_set_active(group='growth-iteration-%i' % iteration)
        bpy.ops.object.vertex_group_select()
        bpy.ops.transform.skin_resize(value=( size, size, size ))
        size += self.properties.width_increase
    bpy.ops.object.editmode_toggle()


I found it, I think. This should theoretically do the trick:

def make_increase_width(self):
    bpy.ops.object.editmode_toggle()
    size = self.properties.skin_size
    active_object = bpy.context.active_object
    for iteration in self._iterations:
        for vert in active_object.data.vertices:
            if vert.index in self._iterations[iteration]:
                vert.select = True
            else:
                vert.select = False
        bpy.ops.transform.skin_resize(value=( size, size, size ))
        size += self.properties.width_increase
        print(iteration, size)
    bpy.ops.object.editmode_toggle()


But it's very slow to execute. It seems having this line in the loop bpy.ops.transform.skin_resize(value=( size, size, size )) makes it too hard to do. It will select a maximum of 20 verts for about 60 iterations but somehow it will take far to long for it to run. I'm not sure how come.
@lemon Was kind enough to help me find this answer:

def make_increase_width(self):
    size = self.properties.skin_size
    obj = bpy.context.active_object
    for iteration in self._iterations:
        size += self.properties.width_increase
    for iteration in self._iterations:
        for vert_index in self._iterations[iteration]:
            obj.data.skin_vertices[''].data[vert_index].radius = (size, size)
        size -= self.properties.width_increase


This is outside of edit mode, very fast and exactly what I needed.