Modify All Bones

I was able to access all bones but I am unable to modify them. My current code gives me an error of AttributeError: . . . "Bone" is read-only which is consistent with the documentation.
So I guess there is another way to access and actually modify them.

May I know how?

import bpy

bones =['Deformation'].bones

for bone in bones: 
    bone.use_connect = True # line that gives the error
import bpy =['Deformation']
bones = bpy.context.selected_bones

for bone in bones: 
    bone.use_connect = True 

try this

1 Like

Thanks @jerzygorskiart, Works as expected. So, I guess the key solution here is to be in the edit mode.

I think the key is to use bpy.context to change the data instead of using which is read only i guess. I’m not sure, i’m not a programmer :slight_smile: