I have a rig in Blender, and I want to write a script that selects any one rig control. But I am unable to select the the control. What I am basically doing is copying the python instructions on the top panel and repeat them in the script editor.
Here is the code I have so far :
import bpy bpy.ops.pose.select_all(action='TOGGLE') bpy.context.space_data.context = 'DATA' bpy.context.object.active_index = 0 bpy.ops.pose.group_select()
First 2 lines work fine, then I am going to data tab and selecting a bone group. Here I get the error :
SpaceTextEditor has no attribute 'context'
I'm sure this is some silly error but I'm an absolute beginner so any help is appreciated :)