diff --git a/kernel/PlotRoutines/ita_plot_mesh.m b/kernel/PlotRoutines/ita_plot_mesh.m index 7d714dbdfd7d777988e7a4021ba9292b402c089e..23256fbd506f5df9452f58172d4cf0f04d5265c4 100644 --- a/kernel/PlotRoutines/ita_plot_mesh.m +++ b/kernel/PlotRoutines/ita_plot_mesh.m @@ -88,8 +88,10 @@ if handleMode && ~meshOnly % h = unvFilename; if isfield(get(h),'FaceVertexCData') nodeIDs = get(h,'UserData'); - elseif isfield(get(h),'Children') && isfield(get(h,'Children'),'FaceVertexCData') + elseif isfield(get(h),'Children') && isfield(get(get(h,'Children')),'FaceVertexCData') nodeIDs = get(get(h,'Children'),'UserData'); + else + error('Could not find meta data, was this a mesh plot before?'); end else nodes = Mesh.nodesForElement(Mesh.shellElements); @@ -146,7 +148,7 @@ end if handleMode if isfield(get(h),'FaceVertexCData') set(h,'FaceVertexCData',plotData); - elseif isfield(get(h),'Children') && isfield(get(h,'Children'),'FaceVertexCData') + elseif isfield(get(h),'Children') && isfield(get(get(h,'Children')),'FaceVertexCData') set(get(h,'Children'),'FaceVertexCData',plotData); end else @@ -167,7 +169,6 @@ else end %% set title - if meshOnly title('Mesh plot'); set(h,'EdgeAlpha',edgeAlpha,'EdgeColor',edgeColor,'FaceColor',faceColor); @@ -195,7 +196,6 @@ axis equal; axis off; %% Return the handle - varargout(1) = {h}; %end function