I'm writing to Space types with draw callbacks bgl & blf. The area
region.type == 'WINDOW' gives me the height and width correctly re 'UI', 'TOOLS' and 'CHANNELS' regions, but also includes the scrollbars. Writing a 100% width box overwrites the scrollbars that determine what frame and value ranges are displayed.
Is there an API method available to focus in on a custom range, hopefully without needing to use the border select operator:
graph_area = context.screen.areas # area.type = 'GRAPH_EDITOR' graph_window_region = graph_area.regions[-1] # region.type = 'WINDOW' c = context.copy() # copy the context c['area'] = graph_area c['region'] = graph_window_region # call ops with over-ridden context bpy.ops.graph.view_all(c) bpy.ops.graph.select_border(c, gesture_mode=3, xmax=lf, ymax=action_max) bpy.ops.graph.view_selected(c)
The ops above focus the view to varying degrees of success, less so if there are envelope modifiers on the fcurves.
Here is an example of what I want to get to.
ie having the full frame range and the value range in the top half of the region, my soundvis in the lower half.
Ok I can fudge the value axis of the preview range by adding a dummy property and keying in bottom left and top right coords, selecting and calling
bpy.ops.graph.view_selected(c) as shown below. The issue now is the frames, and looking at the image it occurs to me the preview range is including the handles. More to come.
PS: @CoDEmanX, thanks re scrollbars. apologies for the late edit, happier with the title now, the previous was a bit of a late night afterthought on this. I'm afraid tho you are quite right and there is no way to do this.