Sometimes shapes have 0 materials?!

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 11 years ago
parent 14aea7acc9
commit 7307d748ea

@ -310,7 +310,7 @@ namespace MaterialEditor
CNelMaterialProxy CNel3DInterface::getMaterial() CNelMaterialProxy CNel3DInterface::getMaterial()
{ {
NL3D::CDynMaterial *mat = NULL; NL3D::CDynMaterial *mat = NULL;
if( !currentShape.empty() ) if( !currentShape.empty() && ( currentShape.getNumMaterials() > 0 ) )
mat = currentShape.getMaterial( subMatId ).getObjectPtr()->getDynMat(); mat = currentShape.getMaterial( subMatId ).getObjectPtr()->getDynMat();
return CNelMaterialProxy( mat ); return CNelMaterialProxy( mat );

Loading…
Cancel
Save