Don't call newMaterial() every time we load a (sub)material.

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 11 years ago
parent dbd5185de1
commit 390d1bb156

@ -258,9 +258,15 @@ namespace MaterialEditor
if( !xml.init( file ) )
return false;
newMaterial();
NL3D::CDynMaterial *mat = currentShape.getMaterial( subMatId ).getObjectPtr()->getDynMat();
mat->clear();
if( mat != NULL )
mat->clear();
else
{
currentShape.getMaterial( subMatId ).getObjectPtr()->createCleanDynMat();
mat = currentShape.getMaterial( subMatId ).getObjectPtr()->getDynMat();
}
mat->serial( xml );
file.close();

Loading…
Cancel
Save