Well, either you blender copy is mischievous and lying to you, or you are asking it the wrong thing…think of ‘ctrl’ + ‘spacebar’ as truth serum for mischievous lying Blender copies that need to be put into timeout. :evilgrin: Ok, truth time for me, I’ve never used python with an armature before but this is what is so great about autocomplete in the console (ctrl + spacebar is autocomplete)
I added an armature with one bone, I went to edit mode and extruded it several times so I had 4 bones. I didn’t know what extrude would do, but luckily and logically, hitting e caused a new bone to spring out of the previous one and each new bone became a child of the one before it. Then I went to pose mode.
in the console…without the lines starting with #. I typed.
#the armature object
my_armature = bpy.context.object
#the bone within the armature data
my_bone = my_armature.data.bones['Bone.001']
now…in the console, I type “my_bone.” and then ‘ctrl’ + ‘spacebar’ and see what it has
indeed, there is no “rotation_euler”…so that’s good, Blender didn’t lie to you, I owe it an apology. You will probably want to check out the “matrix” and “martix_local” properties if you want to set them by hand in this way. Eg
my_bone.matrix = my_calculated_matrix
when you do it this way, it doesnt have to be selected, you are manually setting the data to something. If however, you want to say rotate it by _____ from where it is, and calculating the matrix is a pain (which it would be for me because who paid attention in middle school?)
#deselect all the other ones if they are
bpy.ops.pose.select_all(action = 'DESELECT')
#make the bone I want selected
my_bone.select = True
and now press ‘ctrl’ + ‘spacebar’ to learn about the rotate operator syntax which I will leave as an exercise for you. As a heads up, the rotate operator sytax is a little bit weird, just use all the commas that look like they shouldn’t be there and you will be fine THe difference is that here, we are calling an operator to modify an objects data. It knows what to work on based on what is selected and/or active.