Skip to content

Commit fbf6b92

Browse files
Merge branch 'RB-10.5'
2 parents 1a46e37 + 63a5328 commit fbf6b92

File tree

4 files changed

+49
-10
lines changed

4 files changed

+49
-10
lines changed

Changes

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,25 @@ Breaking Changes
3737
- IECoreNuke : Removed.
3838
- Removed support for `IECORE_RTLD_GLOBAL` environment variable.
3939

40-
10.5.x.x (relative to 10.5.15.1)
40+
10.5.x.x (relative to 10.5.15.2)
4141
========
4242

4343

4444

45+
10.5.15.2 (relative to 10.5.15.1)
46+
=========
47+
48+
Fixes
49+
-----
50+
51+
- VDBObject : Fixed worldBound() result when bbox metadata not already present.
52+
53+
API
54+
---
55+
56+
- SConstruct : Install "private" headers.
57+
- VDBObject : Marked metadata() as deprecated.
58+
4559
10.5.15.1 (relative to 10.5.15.0)
4660
=========
4761

SConstruct

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,6 +1641,7 @@ if doConfigure :
16411641
# source list
16421642
imageSources = sorted( glob.glob( "src/IECoreImage/*.cpp" ) )
16431643
imageHeaders = sorted( glob.glob( "include/IECoreImage/*.h" ) + glob.glob( "include/IECoreImage/*.inl" ) )
1644+
imagePrivateHeaders = glob.glob( "include/IECoreImage/Private/*.h" )
16441645
imagePythonHeaders = sorted( glob.glob( "include/IECoreImageBindings/*.h" ) + glob.glob( "include/IECoreImageBindings/*.inl" ) )
16451646
imagePythonSources = sorted( glob.glob( "src/IECoreImageBindings/*.cpp" ) )
16461647
imagePythonModuleSources = sorted( glob.glob( "src/IECoreImageModule/*.cpp" ) )
@@ -1664,10 +1665,12 @@ if doConfigure :
16641665

16651666
# headers
16661667
imageHeaderInstall = imageEnv.Install( "$INSTALL_HEADER_DIR/IECoreImage", imageHeaders )
1668+
imagePrivateHeaderInstall = imageEnv.Install( "$INSTALL_HEADER_DIR/IECoreImage/Private", imagePrivateHeaders )
1669+
16671670
if env[ "INSTALL_CREATE_SYMLINKS" ] :
16681671
imageEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreImage", lambda target, source, env : makeSymLinks( imageEnv, imageEnv["INSTALL_HEADER_DIR"] ) )
1669-
imageEnv.Alias( "install", imageHeaderInstall )
1670-
imageEnv.Alias( "installImage", imageHeaderInstall )
1672+
imageEnv.Alias( "install", [ imageHeaderInstall, imagePrivateHeaderInstall ] )
1673+
imageEnv.Alias( "installImage", [ imageHeaderInstall, imagePrivateHeaderInstall ] )
16711674

16721675
# python headers
16731676
imagePythonHeaderInstall = imageEnv.Install( "$INSTALL_HEADER_DIR/IECoreImageBindings", imagePythonHeaders )
@@ -1724,6 +1727,7 @@ scenePythonModuleEnv = corePythonModuleEnv.Clone( IECORE_NAME="IECoreScene" )
17241727

17251728
sceneSources = sorted( glob.glob( "src/IECoreScene/*.cpp" ) )
17261729
sceneHeaders = glob.glob( "include/IECoreScene/*.h" ) + glob.glob( "include/IECoreScene/*.inl" )
1730+
scenePrivateHeaders = glob.glob( "include/IECoreScene/private/*.h" )
17271731
scenePythonModuleSources = sorted( glob.glob( "src/IECoreScene/bindings/*.cpp" ) )
17281732
scenePythonScripts = glob.glob( "python/IECoreScene/*.py" )
17291733

@@ -1752,10 +1756,11 @@ if doConfigure :
17521756

17531757
# headers
17541758
sceneHeaderInstall = sceneEnv.Install( "$INSTALL_HEADER_DIR/IECoreScene", sceneHeaders )
1759+
scenePrivateHeaderInstall = sceneEnv.Install( "$INSTALL_HEADER_DIR/IECoreScene/private", scenePrivateHeaders )
17551760
if env[ "INSTALL_CREATE_SYMLINKS" ] :
17561761
sceneEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreScene", lambda target, source, env : makeSymLinks( sceneEnv, sceneEnv["INSTALL_HEADER_DIR"] ) )
1757-
sceneEnv.Alias( "install", sceneHeaderInstall )
1758-
sceneEnv.Alias( "installScene", sceneHeaderInstall )
1762+
sceneEnv.Alias( "install", [ sceneHeaderInstall, scenePrivateHeaderInstall ] )
1763+
sceneEnv.Alias( "installScene", [ sceneHeaderInstall, scenePrivateHeaderInstall ] )
17591764

17601765
# python module
17611766
scenePythonModuleEnv.Append( LIBS = os.path.basename( sceneEnv.subst( "$INSTALL_LIB_NAME" ) ) )
@@ -1990,11 +1995,13 @@ if env["WITH_GL"] and doConfigure :
19901995
glEnv.Alias( "installLib", [ glLibraryInstall ] )
19911996

19921997
glHeaders = glob.glob( "include/IECoreGL/*.h" ) + glob.glob( "include/IECoreGL/*.inl" )
1998+
glPrivateHeaders = glob.glob( "include/IECoreGL/private/*.h" )
19931999
glHeaderInstall = glEnv.Install( "$INSTALL_HEADER_DIR/IECoreGL", glHeaders )
2000+
glPrivateHeaderInstall = glEnv.Install( "$INSTALL_HEADER_DIR/IECoreGL/private", glPrivateHeaders )
19942001
if env[ "INSTALL_CREATE_SYMLINKS" ] :
19952002
glEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreGL", lambda target, source, env : makeSymLinks( glEnv, glEnv["INSTALL_HEADER_DIR"] ) )
1996-
glEnv.Alias( "install", glHeaderInstall )
1997-
glEnv.Alias( "installGL", glHeaderInstall )
2003+
glEnv.Alias( "install", [ glHeaderInstall, glPrivateHeaderInstall ] )
2004+
glEnv.Alias( "installGL", [ glHeaderInstall, glPrivateHeaderInstall ] )
19982005

19992006
glslHeaders = glob.glob( "glsl/IECoreGL/*.h" )
20002007
glslHeaderInstall = glEnv.Install( "$INSTALL_GLSL_HEADER_DIR/IECoreGL", glslHeaders )

include/IECoreVDB/VDBObject.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ class IECOREVDB_API VDBObject : public IECoreScene::VisibleRenderable
8282

8383
Imath::Box3f bound() const override;
8484

85+
// \deprecated
86+
// Not threadsafe ( it computes statistics if not present and stores them on the grids ).
87+
// Instead, use the VDB api, for example:
88+
// findGrid( name )->beginMeta() to iterate the metadata,
89+
// or
90+
// findGrid( name )->evalActiveVoxelBoundingBox() or activeVoxelCount() to compute statistics
8591
IECore::CompoundObjectPtr metadata( const std::string &name );
8692

8793
//! Are the grids in this VDBObject unmodified from the vdb file in filename?

src/IECoreVDB/VDBObject.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,23 @@ namespace
5757
template<typename T>
5858
Imath::Box<Imath::Vec3<T> > worldBound( const openvdb::GridBase *grid, float padding = 0.50f )
5959
{
60-
openvdb::Vec3i min = grid->metaValue<openvdb::Vec3i>( grid->META_FILE_BBOX_MIN );
61-
openvdb::Vec3i max = grid->metaValue<openvdb::Vec3i>( grid->META_FILE_BBOX_MAX );
60+
openvdb::CoordBBox vdbBbox;
61+
try
62+
{
63+
vdbBbox.min() = openvdb::Coord( grid->metaValue<openvdb::Vec3i>( grid->META_FILE_BBOX_MIN ) );
64+
vdbBbox.max() = openvdb::Coord( grid->metaValue<openvdb::Vec3i>( grid->META_FILE_BBOX_MAX ) );
65+
}
66+
catch( ... )
67+
{
68+
// If we don't have metadata available, then hopefully it's because the vdb was freshly created and
69+
// hasn't been saved to file yet, which should mean it's fully loaded, and we can call
70+
// evalActiveVoxelBoundingBox.
71+
// \todo : Can we guarantee that every VDB either is loaded, or has metadata?
72+
vdbBbox = grid->evalActiveVoxelBoundingBox();
73+
}
6274

6375
openvdb::Vec3d offset = openvdb::Vec3d( padding );
64-
openvdb::BBoxd indexBounds = openvdb::BBoxd( min - offset, max + offset );
76+
openvdb::BBoxd indexBounds = openvdb::BBoxd( vdbBbox.min() - offset, vdbBbox.max() + offset );
6577
openvdb::BBoxd worldBounds = grid->transform().indexToWorld( indexBounds );
6678
openvdb::Vec3d minBB = worldBounds.min();
6779
openvdb::Vec3d maxBB = worldBounds.max();

0 commit comments

Comments
 (0)