05-03-2019, 07:52 PM
Code:
// My visibility control functions in C#
public void HideVisuals() => _robot.SetVisible(false, 1); // Show only the tool frame
public void ShowVisuals() // Show robot but not joint frames
{
int jointNum = _robot.Joints . length ();
int mask = 2;
for (int i = 0; i < jointNum; i++)
{
mask = (mask << 2) + 2;
}
mask += 1; // Add mask for tool frame
_robot.SetVisible(true, mask);
}
Through experimentation, I found that you can set the visibility of specific joints in a mechanism. The joints to show are specified by a bit mask as the second argument to the .SetVisible(bool, mask) function. The first bit is always the tool frame, and then the bits alternate between joint visuals and joint frames.
Note, the frames will not appear visible unless the corresponding joint is visible as well.