From 7307d748eaa6eff3664eb01e0673b9a3b400bb56 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Tue, 3 Sep 2013 20:22:11 +0200 Subject: [PATCH] Sometimes shapes have 0 materials?! --HG-- branch : gsoc2013-dfighter --- .../src/plugins/material_editor/nel3d_interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/nel3d_interface.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/nel3d_interface.cpp index aa44a64ab..d028099bb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/nel3d_interface.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/nel3d_interface.cpp @@ -310,7 +310,7 @@ namespace MaterialEditor CNelMaterialProxy CNel3DInterface::getMaterial() { NL3D::CDynMaterial *mat = NULL; - if( !currentShape.empty() ) + if( !currentShape.empty() && ( currentShape.getNumMaterials() > 0 ) ) mat = currentShape.getMaterial( subMatId ).getObjectPtr()->getDynMat(); return CNelMaterialProxy( mat );