diff --git a/src/osgPlugins/mdl/MDLReader.cpp b/src/osgPlugins/mdl/MDLReader.cpp index 85c7c3abf..2667be23a 100644 --- a/src/osgPlugins/mdl/MDLReader.cpp +++ b/src/osgPlugins/mdl/MDLReader.cpp @@ -420,7 +420,7 @@ ref_ptr MDLReader::readMaterialFile(std::string materialName) material->setEmission(Material::FRONT_AND_BACK, Vec4(0.0, 0.0, 0.0, 1.0) ); material->setAlpha(Material::FRONT_AND_BACK, alpha); - stateSet->setAttributeAndModes(material, StateAttribute::ON); + stateSet->setAttributeAndModes(material.get(), StateAttribute::ON); // Add the texture attribute (or disable texturing if no base texture) if (texture != NULL)