Skip to content

Commit

Permalink
fix loading submesh with their own material
Browse files Browse the repository at this point in the history
  • Loading branch information
iche033 committed May 9, 2019
1 parent f63daba commit 897ef65
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/rendering/SceneManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,7 @@ rendering::VisualPtr SceneManager::CreateVisual(Entity _id,
// Don't set a default material for meshes because they
// may have their own
// TODO(anyone) support overriding mesh material
else if (_visual.Geom()->Type() == sdf::GeometryType::MESH)
{
material = geom->Material();
}
else
else if (_visual.Geom()->Type() != sdf::GeometryType::MESH)
{
// create default material
material = this->dataPtr->scene->Material("ign-grey");
Expand All @@ -248,11 +244,10 @@ rendering::VisualPtr SceneManager::CreateVisual(Entity _id,
material->SetMetalness(1.0);
}
}

// TODO(anyone) set transparency)
// material->SetTransparency(_visual.Transparency());

geom->SetMaterial(material);
if (material)
geom->SetMaterial(material);
}
else
{
Expand Down

0 comments on commit 897ef65

Please sign in to comment.