Commits

Steven Peters  committed 6e305a0

Remove lights sent by server, clone sdf of lights in scene, and save to sdf

  • Participants
  • Parent commits 242dbb1
  • Branches issue_346

Comments (0)

Files changed (1)

File gazebo/gui/MainWindow.cc

       next = world->GetElement("light");
       while (next)
       {
-        current = next;
-        next = next->GetNextElement("light");
-        current->ClearElements();
+        next->RemoveFromParent();
+        next = world->GetElement("light");
       }
 
       // Get lights from current scene.
       {
         sdf::ElementPtr elem;
         light = scene->GetLight(i);
-        gzwarn << light->GetName() << '\n';
+        // Clone light sdf and insert into world
         elem = light->CloneSDF();
-        gzwarn << elem->ToString("");
-        // Insert elem into world
+        world->InsertElement(elem);
       }
 
       msgData = sdfParsed.root->ToString("");