Closed itbellix closed 6 months ago
I confirm that the issue seems there also when using another model, and appears to be related to the visualization of the markers alone. Bodies, wrapping surfaces and muscles can be correctly hidden
Hi @itbellix
The visualization of markers is dictated by a special OpenSim flag that is treated separately from the right-click menu (which operates by manipulating any Appearance
properties it can find).
To toggle those special flags, there is a row of buttons in the top menu bar of the UI:
The fact they are separate is annoying, though, and I'll keep this ticket open in case I can maybe do something like detect "if the user specifically right-clicks the markerset then have a special rule where it toggles the flag rather than the appearance"
Hi @adamkewley, I see thank you for explaining. It might be better then to disable all the "Display" options for the markers then? Also, I think that the same options are present in OpenSim, and there they normally work also for the markers (apart from the fact that sometimes they stop working randomly, maybe because of the fact that deep down there are separate threads as you mentioned above...)
It might be better then to disable all the "Display" options for the markers then?
Agreed. The main reason I didn't do this is because it requires walking over the entire tree from where the user clicked (e.g. the entire model, a markerset, a forceset) and asking every single component "can you be toggled for visibility". I didn't implement it just in case it would mean that rendering the context menu would then become surprisingly expensive in order to grey out a button or similar.
Also, I think that the same options are present in OpenSim, and there they normally work also for the markers (apart from the fact that sometimes they stop working randomly, maybe because of the fact that deep down there are separate threads as you mentioned above...)
I have just investigated how OpenSim GUI is doing it, so that I can understand what OSC's options are. Effectively:
Show Only
(e.g.) triggers this: https://github.com/opensim-org/opensim-gui/blob/4.4/Gui/opensim/view/src/org/opensim/view/ObjectDisplayShowOnlyAction.java#L54setVisible
or toggleObjectDisplay
based on whether the object has an Appearance
property (same as OSC) or similar, which the GUI traits as ColorableInterface
internallyColorableInterface
, so the implementation uses toggleObjectDisplay
: https://github.com/opensim-org/opensim-gui/blob/4.4/Gui/opensim/view/src/org/opensim/view/ObjectDisplayShowOnlyAction.java#L104toggleObjectDisplay
sends a message to the 3D visualizer: https://github.com/opensim-org/opensim-gui/blob/4.4/Gui/opensim/view/src/org/opensim/view/pub/ViewDB.java#L947Effectively, it is able to show/hide components by directly telling a 3D visualizer to toggle the visibility of a piece of 3D geometry in the scene. Works fine, but has the drawback that the "state" being manipulated is held inside one visualizer (OSC needs to support multiple visualizers) and that the state isn't part of the model (so undo/redo will be broken). Also, the state change is initiated as a command with no flags for tracking it, which means that I imagine the visualization toggles will be forgotten if the visualizer ever needs to reboot.
I imagine OSC's implementation will require adding those toggles as state on the model, because I would want toggles to propagate between visualizers, be undo/redo friendly, etc. - the current approach isn't as powerful but it works "consistiently" (as in, once you know the behavior it will always behave the same way)
I see, thank you for the clarifications!
Closing this because, although it's confusing, it's somewhat baked into the cake (OpenSim) and cannot be changed without OSC having to contain a lot of custom hacks - sorry @itbellix
Hi @adamkewley, I am trying to hide markers in a model, but when selecting the whole markerset (or a single marker) in the![image](https://github.com/ComputationalBiomechanicsLab/opensim-creator/assets/50029203/bd43c487-3980-4fa0-b060-315ed33b728b)
Navigation
panel, and right-clicking on it to "Hide" it this does not work and the marker remains there.I attach here the model that I am using, and will try now with another model too.
The same does not happen when trying to hide a body (like the head of the model). In that case, everything works smoothly.