message: fix visibility crashes on volumes and geometries
diff: @@ -181,10 +181,12 @@ namespace ospray {
  inline void RenderScene::createGeometry(Node &node)
  {
  - if (!node.child("visible").valueAs<bool>())
  + auto geomNode = node.nodeAs<Geometry>();
  + if (!node.child("visible").valueAs<bool>()) {
  + geomNode->groupIndex = -1;
  return;
  + }
  - auto geomNode = node.nodeAs<Geometry>();
  if (geomNode->groupIndex >= 0 && geomNode->groupIndex < groups.size())
  return;
  @@ -268,9 +270,12 @@ namespace ospray {
  inline void RenderScene::createVolume(Node &node)
  {
  - if (!node.child("visible").valueAs<bool>())
  - return;
  auto volNode = node.nodeAs<sg::Volume>();
  + if (!node.child("visible").valueAs<bool>()) {
  + volNode->groupIndex = -1;
  + return;
  + }
  +
  if (volNode->groupIndex >= 0 && volNode->groupIndex < groups.size())
  return;
  @@ -333,7 +338,7 @@ namespace ospray {
  for (auto geom : geomChildren) {
  auto geomNode = geom->nodeAs<Geometry>();
  auto geomIdentifier = geomNode->groupIndex;
  - if (geomIdentifier < groups.size()) {
  + if (geomIdentifier >= 0 && geomIdentifier < groups.size()) {
  auto &group = groups[geomIdentifier];
  group.setParam(
  "dynamicScene", node.child("dynamicScene").valueAs<bool>());
  @@ -361,7 +366,7 @@ namespace ospray {
  for (auto vol : volChildren) {
  auto volNode = vol->nodeAs<Volume>();
  auto volumeIdentifier = volNode->groupIndex;
  - if (volumeIdentifier < groups.size()) {
  + if (volumeIdentifier >= 0 && volumeIdentifier < groups.size()) {
  auto &group = groups[volumeIdentifier];
  group.setParam(
  "dynamicScene", node.child("dynamicScene").valueAs<bool>());
  @@ -390,6 +395,7 @@ namespace ospray {
  for (auto vol : volChildren) {
  auto volNode = vol->nodeAs<sg::Volume>();
  auto volumeIdentifier = volNode->groupIndex;
  + if (volumeIdentifier >= 0 && volumeIdentifier < groups.size()) {
  auto &group = groups[volumeIdentifier];
  group.setParam(
  "dynamicScene", node.child("dynamicScene").valueAs<bool>());
  @@ -411,6 +417,7 @@ namespace ospray {
  }
  }
  }
  + }
  #if defined(DEBUG)
  std::cout << "number of instances : " << instances.size() << std::endl;
  