Trying to have border select through python interactive.

Context is correct but I’m not getting the usual box. This is what I’m using:

bpy.ops.anim.channels_select_border(‘INVOKE_DEFAULT’)

Need this cause I’m changing the way selection in the graph editor behaves (I want to select the channels and toggle visibility all with one click). I made it work with the click operator with this

bpy.ops.anim.channels_click(‘INVOKE_DEFAULT’, extend=False, children_only=False)
bpy.ops.anim.channels_visibility_set()

but can seem to correctly activate the border select.

Anyone can help?

Calling it with invoke_default gives you all the default values.


>>> bpy.ops.anim.channels_select_border(
channels_select_border()
bpy.ops.anim.channels_select_border(gesture_mode=0, xmin=0, xmax=0, ymin=0, ymax=0, extend=True)

if you turn bpy.app.debug = True in the console and border select the channels you get an idea what the values need to be to select


bpy.ops.anim.channels_select_border(gesture_mode=3, xmin=0, xmax=1000, ymin=0, ymax=1000, extend=True)

The mins maxs could prob be calculated from the height/width of the region. The docs are here http://www.blender.org/documentation/blender_python_api_2_62_release/bpy.ops.anim.html

There is a select_all_toggle op that may better suit your needs.

Also i dont think you get the “box” only the result.

Thanks.

I’m not really trying to get a select all behaviour, rather I’m trying to chain up a couple of operators, the first being the border select. Unfortunately it doesn’t seem to be interactive when I call it from python.