# Access skin modifier radius data

With Skin Modifier, we can "weight" a vertex (in Edit Mode) so that the resulting Skin mesh is bigger or smaller - similar to Curve objects which has "Scale Feather" adjustable.

Manually, we can hit Tab, go to Edit Mode, select Vertices, then CtrlA and drag.

However, I would like to be able to do this using Python. Does anyone know anything about it?

## 1 Answer

Reading and writing these values from Python must happen in Object mode. I added a plane and deleted one vertex, added the skin modifier and decreased the radius of one vertex.

>>> obj = bpy.data.objects['Plane']
>>> for v in obj.data.skin_vertices[0].data:
...     print(v.radius[:])
...
(0.25, 0.25)
(0.25, 0.25)
(0.08836718648672104, 0.08836718648672104)


Each element in skin_vertices[0].data has radius, use_loose, use_root to read and write. Radii can be any two element iterable (tuple, list).

import bpy

obj = bpy.data.objects['Plane']
for v in obj.data.skin_vertices[0].data:
v.radius = 0.2, 1.2


I just realized that CtrlA lets you constrain the effect on radius per axis with ShiftX,Y.

• Thanks so much for this answer @Zeffii! Right on solution. I was also surprised that we can constraint the effect either with X or Y axis. Only obvious when checking the radius value using Python, and it gives 2 values. Very interesting. I found this blog post that kind of talks a bit about the radius weight for skin vertices: michelanders.blogspot.com.au/p/… I will soon post this in my blog. Jul 3, 2013 at 1:21
• @BlenderSushiGuy to let others know that this answer satisfies your question please log in with your other account and accept it. I recommend that you stop using two usernames, it's extra work in the long run. Jul 3, 2013 at 5:23
• I first thought skin_vertices will contain data for each skin modifier (in case there are more than one), but it always has one element corresponding to first-added skin modifier! BTW great finding! Aug 2, 2013 at 18:36
• note if you get an error, when trying to access or set skin weights, you need to first initialize at least one skin modifier either with code or using the UI Jun 21, 2021 at 12:59