diff --git a/src/IECoreHoudini/ROP_SceneCacheWriter.cpp b/src/IECoreHoudini/ROP_SceneCacheWriter.cpp index f33828a502..d7905c570d 100644 --- a/src/IECoreHoudini/ROP_SceneCacheWriter.cpp +++ b/src/IECoreHoudini/ROP_SceneCacheWriter.cpp @@ -42,6 +42,7 @@ #include "PRM/PRM_Parm.h" #include "PRM/PRM_SpareData.h" #include "ROP/ROP_Error.h" +#include "SOP/SOP_Node.h" #include "UT/UT_PtrArray.h" #include "UT/UT_StringMMPattern.h" @@ -271,6 +272,30 @@ ROP_RENDER_CODE ROP_SceneCacheWriter::renderFrame( fpreal time, UT_Interrupt *bo } } } + else + { + UT_String msg; + std::string messages = "Re-rooting flat geo failed."; + node->getErrorMessages( msg ); + if ( msg != UT_String::getEmptyString() ) + { + messages += "\n\nErrors from " + nodePath.toStdString() + ":\n" + msg.toStdString(); + } + + if ( SOP_Node *sop = node->getRenderSopPtr() ) + { + sop->getErrorMessages( msg ); + if ( msg != UT_String::getEmptyString() ) + { + sop->getFullPath( nodePath ); + messages += "\n\nErrors from " + nodePath.toStdString() + ":\n" + msg.toStdString(); + } + } + + addError( 0, messages.c_str() ); + progress->opEnd(); + return ROP_ABORT_RENDER; + } if ( reRoot ) { @@ -279,7 +304,11 @@ ROP_RENDER_CODE ROP_SceneCacheWriter::renderFrame( fpreal time, UT_Interrupt *bo } ROP_RENDER_CODE status = doWrite( m_liveScene, outScene, writeTime, progress ); - executePostFrameScript( time ); + if ( status != ROP_ABORT_RENDER ) + { + executePostFrameScript( time ); + } + progress->opEnd(); return status; } diff --git a/test/IECoreHoudini/SceneCacheTest.py b/test/IECoreHoudini/SceneCacheTest.py index 5f76334eb0..19239d24cf 100644 --- a/test/IECoreHoudini/SceneCacheTest.py +++ b/test/IECoreHoudini/SceneCacheTest.py @@ -1,6 +1,6 @@ ########################################################################## # -# Copyright (c) 2013, Image Engine Design Inc. All rights reserved. +# Copyright (c) 2013-2014, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -2106,6 +2106,21 @@ def testRopFlattenedAndHidden( self ) : self.assertTrue( child.isInstanceOf( IECore.TypeId.MeshPrimitive ) ) self.assertEqual( root.childNames(), [] ) + def testRopFlattenedWithErrors( self ) : + + self.writeSCC() + geo = self.geometry() + geo.parm( "expand" ).pressButton() + rop = self.rop( geo ) + rop.parm( "rootObject" ).set( geo.path() ) + rop.parm( "trange" ).set( 1 ) + rop.parmTuple( "f" ).set( ( 1, 10, 1 ) ) + geo.renderNode().parm( "file" ).set( "fake.scc" ) + rop.parm( "execute" ).pressButton() + self.assertNotEqual( rop.errors(), "" ) + self.assertTrue( geo.renderNode().path() in rop.errors() ) + self.assertTrue( geo.renderNode().errors() in rop.errors() ) + def testRopLinked( self ) : self.writeTaggedSCC()