//----------------------------------------------------------------------------// bool CMaterialLibraryCandidate::CreateFromInterfaceFromMaxscriptCall() { // clear current content Clear(); // get the number of materials of the mesh CMaxInterface* imax = static_cast<CMaxInterface*>(theExporter.GetInterface()); // allocate a new material candidate CMaterialCandidate *pMaterialCandidate; pMaterialCandidate = new CMaterialCandidate(); if(pMaterialCandidate == 0) { theExporter.SetLastError("Memory allocation failed!", __FILE__, __LINE__); return false; } // create the new material candidate if(!pMaterialCandidate->Create(imax->GetBaseMatFromMaxscript())) return false; // add material candidate to the material candidate vector m_vectorMaterialCandidate.push_back(pMaterialCandidate); //Select it SetSelectedMaterialCandidate(pMaterialCandidate); return true; }