Replies: 1 comment 1 reply
-
I do not know the answer to @EwingKang's issue, but wanted to note this possibly related issue I filed back in April 2023: #6094 “how to use animation callbacks with o3d.visualization.draw()?” |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As title stated, it took me some time going through the source code to understand the issue. One of the most easily encountered example is
SetAnimating()
. This is used when an user is trying to stop the animation automatically after reaching some animation time.I believe, and please correct me if I'm worng, the root cause arises from the SetAnimating() function. The function unsets the callback functor during the callback. This causes some kind of callstack corruption.
Open3D/cpp/open3d/visualization/visualizer/O3DVisualizer.cpp
Lines 1737 to 1758 in d7a2cf6
This can be captured with GDB, which shows memory is not accessible:
Another similar problem is with
AddGeometry
andRemoveGeometry
within the animation callback. Since it actually callsSetAnnimating(false)
during the callback. However, I believe that this is the intended way of updating the geometries sinceUpdateGeometry
only works with TGeometry PointClouds.Open3D/cpp/open3d/visualization/visualizer/O3DVisualizer.cpp
Lines 1078 to 1081 in d7a2cf6
My current workaround is to call the geometry update function directly from the rendering scene object.
So what is the best way to work around this?
I found a similar case in
Widget
class, which uses a flag to avoid the issue.Open3D/cpp/open3d/visualization/gui/Widget.cpp
Lines 111 to 124 in d7a2cf6
I think that even we're not going to implement anything for change of behavior, it should at least implement some kind of preprocessor function that warns/prevents user from calling invalid functions within the animation callback.
Beta Was this translation helpful? Give feedback.
All reactions