From 4bed96e3461fd650cd80394a7b8a1510170cb6fb Mon Sep 17 00:00:00 2001 From: Paolo Cignoni cignoni Date: Mon, 2 Jul 2012 09:23:44 +0000 Subject: [PATCH] Corrected random bug in filter creation caused by the fact that when creating a mesh on a empy document the current mesh is null and no state should be saved... --- src/meshlab/stdpardialog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/meshlab/stdpardialog.cpp b/src/meshlab/stdpardialog.cpp index a7506c087..753635fc2 100644 --- a/src/meshlab/stdpardialog.cpp +++ b/src/meshlab/stdpardialog.cpp @@ -280,19 +280,19 @@ void MeshlabStdDialog::applyClick() QAction *q = curAction; stdParFrame->readValues(curParSet); - ////int mask = 0;//curParSet.getDynamicFloatMask(); - if(curmask) + // Note that curModel CAN BE NULL (for creation filters on empty docs...) + if(curmask && curModel) meshState.apply(curModel); //PreView Caching: if the apply parameters are the same to those used in the preview mode //we don't need to reapply the filter to the mesh bool isEqual = (curParSet == prevParSet); - if ((isEqual) && (validcache)) + if (curModel && (isEqual) && (validcache)) meshCacheState.apply(curModel); else curmwi->executeFilter(q, curParSet, false); - if(curmask) + if(curmask && curModel) meshState.create(curmask, curModel); if(this->curgla) this->curgla->update();