diff --git a/include/IECore/SceneInterface.h b/include/IECore/SceneInterface.h index d9a4e970bc..724c61626a 100644 --- a/include/IECore/SceneInterface.h +++ b/include/IECore/SceneInterface.h @@ -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 @@ -93,7 +93,7 @@ class SceneInterface : public RunTimeTyped /// Utility variable that can be used anytime you want to refer to the root path in the Scene. static const Path &rootPath; /// Name of the visibility attribute - static const Name visibilityName; + static const Name &visibilityName; /// Create an instance of a subclass which is able to open the file found at "path". /// Files can be opened for Read, Write, or Append depending on the derived classes. diff --git a/include/IECoreHoudini/ROP_SceneCacheWriter.h b/include/IECoreHoudini/ROP_SceneCacheWriter.h index 22b99f6598..b78f7b525c 100644 --- a/include/IECoreHoudini/ROP_SceneCacheWriter.h +++ b/include/IECoreHoudini/ROP_SceneCacheWriter.h @@ -79,7 +79,7 @@ class ROP_SceneCacheWriter : public ROP_Node private : - static const IECore::SceneInterface::Name &visibleAttribute; + static const IECore::SceneInterface::Name &changingHierarchyAttribute; bool linked( const std::string &file ) const; diff --git a/src/IECore/SceneInterface.cpp b/src/IECore/SceneInterface.cpp index 56312a45c3..b6692da76c 100644 --- a/src/IECore/SceneInterface.cpp +++ b/src/IECore/SceneInterface.cpp @@ -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 @@ -42,7 +42,7 @@ IE_CORE_DEFINERUNTIMETYPEDDESCRIPTION( SceneInterface ) const SceneInterface::Name &SceneInterface::rootName = IndexedIO::rootName; const SceneInterface::Path &SceneInterface::rootPath = IndexedIO::rootPath; -const SceneInterface::Name SceneInterface::visibilityName( "scene:visible" ); +const SceneInterface::Name &SceneInterface::visibilityName( "scene:visible" ); class SceneInterface::CreatorMap : public std::map< std::pair< std::string, IndexedIO::OpenModeFlags >, CreatorFn> { diff --git a/src/IECoreHoudini/ROP_SceneCacheWriter.cpp b/src/IECoreHoudini/ROP_SceneCacheWriter.cpp index 1cca584bc1..f33828a502 100644 --- a/src/IECoreHoudini/ROP_SceneCacheWriter.cpp +++ b/src/IECoreHoudini/ROP_SceneCacheWriter.cpp @@ -79,7 +79,7 @@ PRM_Default ROP_SceneCacheWriter::fileDefault( 0, "$HIP/output.scc" ); PRM_Default ROP_SceneCacheWriter::rootObjectDefault( 0, "/obj" ); PRM_SpareData ROP_SceneCacheWriter::forceObjectsSpareData; -const SceneInterface::Name &ROP_SceneCacheWriter::visibleAttribute( "scene:visible" ); +const SceneInterface::Name &ROP_SceneCacheWriter::changingHierarchyAttribute( "sceneInterface:changingHierarchy" ); OP_TemplatePair *ROP_SceneCacheWriter::buildParameters() { @@ -387,13 +387,14 @@ ROP_RENDER_CODE ROP_SceneCacheWriter::doWrite( const SceneInterface *liveScene, if ( time != m_startTime ) { - outChild->writeAttribute( visibleAttribute, new BoolData( false ), time - 1e-6 ); + outChild->writeAttribute( changingHierarchyAttribute, new BoolData( true ), time ); + outChild->writeAttribute( IECore::SceneInterface::visibilityName, new BoolData( false ), time - 1e-6 ); } } - if ( outChild->hasAttribute( visibleAttribute ) ) + if ( outChild->hasAttribute( changingHierarchyAttribute ) ) { - outChild->writeAttribute( visibleAttribute, new BoolData( true ), time ); + outChild->writeAttribute( IECore::SceneInterface::visibilityName, new BoolData( true ), time ); } ROP_RENDER_CODE status = doWrite( liveChild, outChild, time, progress ); @@ -403,7 +404,7 @@ ROP_RENDER_CODE ROP_SceneCacheWriter::doWrite( const SceneInterface *liveScene, } } - // turn visibleAttribute off if the child disappears + // turn visibility off if the child disappears SceneInterface::NameList outChildren; outScene->childNames( outChildren ); for ( SceneInterface::NameList::iterator it = outChildren.begin(); it != outChildren.end(); ++it ) @@ -411,12 +412,13 @@ ROP_RENDER_CODE ROP_SceneCacheWriter::doWrite( const SceneInterface *liveScene, if ( !liveScene->hasChild( *it ) ) { SceneInterfacePtr outChild = outScene->child( *it ); - if ( !outChild->hasAttribute( visibleAttribute ) ) + if ( !outChild->hasAttribute( IECore::SceneInterface::visibilityName ) ) { - outChild->writeAttribute( visibleAttribute, new BoolData( true ), time - 1e-6 ); + outChild->writeAttribute( IECore::SceneInterface::visibilityName, new BoolData( true ), time - 1e-6 ); } - outChild->writeAttribute( visibleAttribute, new BoolData( false ), time ); + outChild->writeAttribute( changingHierarchyAttribute, new BoolData( true ), time ); + outChild->writeAttribute( IECore::SceneInterface::visibilityName, new BoolData( false ), time ); } } diff --git a/src/IECorePython/SceneInterfaceBinding.cpp b/src/IECorePython/SceneInterfaceBinding.cpp index 18731d79c5..b0eb663cf2 100644 --- a/src/IECorePython/SceneInterfaceBinding.cpp +++ b/src/IECorePython/SceneInterfaceBinding.cpp @@ -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 @@ -268,7 +268,7 @@ void bindSceneInterface() .def( "create", SceneInterface::create ).staticmethod( "create" ) .def( "supportedExtensions", supportedExtensions, ( arg("modes") = IndexedIO::Read|IndexedIO::Write|IndexedIO::Append ) ).staticmethod( "supportedExtensions" ) - .add_static_property( "visibilityName", make_getter(&SceneInterface::visibilityName, return_value_policy() ) ) + .def_readonly("visibilityName", &SceneInterface::visibilityName ) ; }