Page MenuHome

Python : Cannot Access "bone.roll" property
Closed, ArchivedPublic

Description

System Information
Windows 8.1 - GTX1060

Blender Version
Broken: 2.79b

Short description of error
I cannot access the bone.roll property in python console.

Exact steps for others to reproduce the error
-In python console, enter:

bpy.ops.object.armature_add()
bpy.ops.object.editmode_toggle()
bpy.data.objects["Armature"].data.bones["Bone"].roll

-You get the following error message :

Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
AttributeError: 'Bone' object has no attribute 'roll'

Which is against the Online Python Reference : https://docs.blender.org/api/blender_python_api_current/bpy.types.EditBone.html#bpy.types.EditBone.roll

Event Timeline

Brecht Van Lommel (brecht) changed the task status from Unknown Status to Unknown Status.Jul 10 2018, 11:30 AM
Brecht Van Lommel (brecht) claimed this task.

You need .edit_bones instead of .bones to get an EditBone.