Hi,
I want to get mouse position in network editor, such operator position. I use ui.pans[0].x/y and miuse in(Absolut) to caculate, But the numerical mapping is wrong.
Is there any way to achieve it? Thanks
Hi,
I want to get mouse position in network editor, such operator position. I use ui.pans[0].x/y and miuse in(Absolut) to caculate, But the numerical mapping is wrong.
Is there any way to achieve it? Thanks
I have no idea if this is possible in the 1 step elegant way you are hoping for - would be sweet! However, you might be able to in a very annoying round about way, calculate the position in graph space by transforming your absolute mouse coordinates from the raw coordinates into the desired coordinate space.
For instance, something like this:
1 is easy, already have that. 2 is possible, though not simple. can use python ctypes library to access windows and their positions, etc. 3 is maybe not possible, though you can maybe assume certain fixed offsets from the TD window if your environment is pretty controlled. 4 is possible.
@lucasm’s solution just might work but is certainly a huge pain.
What are you trying to achieve… maybe there is a more straightforward way.
Thanks!!!
I used the fourth method to remap the mouse position before, but when I zoom the grid, I have to click the mouse and drag again to refresh the data.
hey @Zink would you mind sharing your solution? can’t wrap my brain around this one. just the python or the equation would be fine - don’t need a tox (unless you’d prefer to share that).