Commit 1c599d39 authored by Michael Migliore's avatar Michael Migliore
Browse files

Fix OBJ importer

parent dc393df4
Pipeline #203051 running with stage
......@@ -381,11 +381,13 @@ int vtkOBJPolyDataProcessor::RequestData(vtkInformation* vtkNotUsed(request),
{
this->MTLFileName = mtlname;
}
else
{
vtkErrorMacro(<< "The default MTL file could not be found");
return 0;
}
}
}
else
{
if (!vtksys::SystemTools::FileExists(this->MTLFileName))
{
vtkErrorMacro(<< "The MTL file " << this->MTLFileName << " could not be found");
}
}
......
......@@ -488,7 +488,13 @@ void bindTexturedPolydataToRenderWindow(
actor->GetTexture()->SetTransform(tf);
}
mapper->ScalarVisibilityOff();
// When the material is created from a MTL file,
// the name is different than the default "x" name.
// in this case, we disable vertex coloring
if (raw_mtl_data->name != "x")
{
mapper->ScalarVisibilityOff();
}
properties->SetDiffuseColor(raw_mtl_data->diff);
properties->SetSpecularColor(raw_mtl_data->spec);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment