In my application, I have custom keyboard and pointer bindings for many navigation operations. I would like to bind the + and - keys to incrementally zoom in and out the node editor, for example, and bind shift-mouse1-motion to drag the viewport. I would like to be able to set the viewport origin and zoom under control of my code rather than exclusively by pointy-clicky interaction with the node editor.
Zoom
I am aware of he GetCurrentZoom() function to read the zoom, but I can't find a corresponding SetCurrentZoom(zoom_val) or other way to change the zoom.
The implementation of GetCurrentZoom implies that I might be able to just change GetView().InvScale:
but I am using a Python binding of imgui-node-editor so I can't try that out. Is there an official API somewhere that I am missing?
Viewport position
I see the NavigateToContent() and NavigateToSelection() helpers, which look to move the viewport in specific ways, but I don't see any API to just say "place the viewport at upper_left, lower_right" or even to get the (upper_left, lower_right) of the current viewport. Internally, there's the NavigateTo action, but again I am working with a Python binding so I'm restricted to the public API.
In my application, I have custom keyboard and pointer bindings for many navigation operations. I would like to bind the + and - keys to incrementally zoom in and out the node editor, for example, and bind shift-mouse1-motion to drag the viewport. I would like to be able to set the viewport origin and zoom under control of my code rather than exclusively by pointy-clicky interaction with the node editor.
Zoom
I am aware of he
GetCurrentZoom()
function to read the zoom, but I can't find a correspondingSetCurrentZoom(zoom_val)
or other way to change the zoom.The implementation of
GetCurrentZoom
implies that I might be able to just changeGetView().InvScale
:but I am using a Python binding of imgui-node-editor so I can't try that out. Is there an official API somewhere that I am missing?
Viewport position
I see the
NavigateToContent()
andNavigateToSelection()
helpers, which look to move the viewport in specific ways, but I don't see any API to just say "place the viewport at upper_left, lower_right" or even to get the (upper_left, lower_right) of the current viewport. Internally, there's theNavigateTo
action, but again I am working with a Python binding so I'm restricted to the public API.