fury icon indicating copy to clipboard operation
fury copied to clipboard

textbox2d recording issues

Open 16bitmood opened this issue 4 years ago • 2 comments

Description:

While recording for test_ui_textbox, if you press specific keys like e and i, you get this warning:

2021-02-09 14:18:14.392 (  39.748s) [        B1AF1740]          vtkObject.cxx:545   WARN| Passive observer should not call AddObserver or RemoveObserver in callback.

which interrupts the recording of tests. The previous test didn't include those keys so it did not have this issue.

Ways to reproduce:

  • Start recording:
import test_ui
test_ui.test_ui_textbox(recording = True)
  • Press e or i repeatedly

System Information:

{'fury_version': '0.6.1.post137.dev0+g56f0c43', 'pkg_path': '/home/gts/main/src/fury/fury', 'commit_hash': '56f0c43122be08423b8be0f4d1ab977b435d250e', 'sys_version': '3.8.6 (default, Sep 25 2020, 09:36:53) \n[GCC 10.2.0]', 'sys_executable': '/home/gts/main/src/fury/env/bin/python3', 'sys_platform': 'linux', 'numpy_version': '1.20.0', 'scipy_version': '1.6.0', 'vtk_version': '9.0.1', 'matplotlib_version': '3.3.4', 'dipy_version': '1.3.0'}

Demonstration:

https://user-images.githubusercontent.com/63354262/107341175-a8ae1200-6ae4-11eb-820a-a5f4a25ee615.mp4

Conjecture:

It might be related to default keybinds, ex: e is bound to exit the application and i for interactor.

More details can be found here

16bitmood avatar Feb 15 '21 10:02 16bitmood

It might be related to default keybinds, ex: e is bound to exit the application and i for interaction.

I think you are on the right track. A vtkInteractorEventRecorder object is used to record the events and it watches for either a 'e' or 'q' to stop the recording. https://github.com/Kitware/VTK/blob/948a48ec545a4489e50c77a27cb5a84a2234fd30/Rendering/Core/vtkInteractorEventRecorder.cxx#L374

When digging a bit about the warning, I also found the following:

// 0. Passive observer loop // Loop over all observers and execute those that are passive observers. // These observers should not affect the state of the system in any way, // and should not be allowed to abort the event. Ref: https://github.com/Kitware/VTK/blob/master/Common/Core/vtkObject.cxx#L504-L507

Which vtkInteractorEventRecorder seems to set for KeyPressCallbackCommand https://github.com/Kitware/VTK/blob/948a48ec545a4489e50c77a27cb5a84a2234fd30/Rendering/Core/vtkInteractorEventRecorder.cxx#L36

Unfortunately, I can't spend much time digging any further. I think the patch needs to be done around here https://github.com/fury-gl/fury/blob/master/fury/window.py#L546 but I don't think removing the observers would work as it did for vtk.vtkInteractorStyleTrackballCamera, vtk.vtkInteractorStyleTrackballActor, and vtk.vtkInteractorStyleImage (i.e. https://github.com/fury-gl/fury/blob/master/fury/interactor.py#L294).

MarcCote avatar Feb 25 '21 02:02 MarcCote

I am unable to reproduce this issue. While importing test_ui it is throwing ModuleNotFound Error. Please Specify how to reproduce this error. Thank You.

ganimtron-10 avatar Mar 25 '21 12:03 ganimtron-10