Skip to content

Commit f07a783

Browse files
committed
Using new changingHierarchy attribute to mark children that appear/disappear over time.
The previous behaviour used scene:visible exclusively for this test, which ran into issues when trying to pass that attribute through from the liveScene.
1 parent 16debfd commit f07a783

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

include/IECoreHoudini/ROP_SceneCacheWriter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class ROP_SceneCacheWriter : public ROP_Node
8080
private :
8181

8282
static const IECore::SceneInterface::Name &visibleAttribute;
83+
static const IECore::SceneInterface::Name &changingHierarchyAttribute;
8384

8485
bool linked( const std::string &file ) const;
8586

src/IECoreHoudini/ROP_SceneCacheWriter.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ PRM_Default ROP_SceneCacheWriter::rootObjectDefault( 0, "/obj" );
8080
PRM_SpareData ROP_SceneCacheWriter::forceObjectsSpareData;
8181

8282
const SceneInterface::Name &ROP_SceneCacheWriter::visibleAttribute( "scene:visible" );
83+
const SceneInterface::Name &ROP_SceneCacheWriter::changingHierarchyAttribute( "sceneInterface:changingHierarchy" );
8384

8485
OP_TemplatePair *ROP_SceneCacheWriter::buildParameters()
8586
{
@@ -387,11 +388,12 @@ ROP_RENDER_CODE ROP_SceneCacheWriter::doWrite( const SceneInterface *liveScene,
387388

388389
if ( time != m_startTime )
389390
{
391+
outChild->writeAttribute( changingHierarchyAttribute, new BoolData( true ), time );
390392
outChild->writeAttribute( visibleAttribute, new BoolData( false ), time - 1e-6 );
391393
}
392394
}
393395

394-
if ( outChild->hasAttribute( visibleAttribute ) )
396+
if ( outChild->hasAttribute( changingHierarchyAttribute ) )
395397
{
396398
outChild->writeAttribute( visibleAttribute, new BoolData( true ), time );
397399
}
@@ -416,6 +418,7 @@ ROP_RENDER_CODE ROP_SceneCacheWriter::doWrite( const SceneInterface *liveScene,
416418
outChild->writeAttribute( visibleAttribute, new BoolData( true ), time - 1e-6 );
417419
}
418420

421+
outChild->writeAttribute( changingHierarchyAttribute, new BoolData( true ), time );
419422
outChild->writeAttribute( visibleAttribute, new BoolData( false ), time );
420423
}
421424
}

0 commit comments

Comments
 (0)