Skip to content

Commit e4024bf

Browse files
committed
LiveScene: Avoid throwing for hash API.
We don't want to throw for hashing API that can be expected by external client code and we simply ignore hashing for the feature we dont support yet ( attributes, sets... )
1 parent 4267b66 commit e4024bf

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/IECoreNuke/LiveScene.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,17 +252,16 @@ void LiveScene::writeTransform( const Data *transform, double time )
252252

253253
bool LiveScene::hasAttribute( const Name &name ) const
254254
{
255-
throw Exception( "IECoreNuke::LiveScene does not support hasAttribute()." );
255+
return false;
256256
}
257257

258258
void LiveScene::attributeNames( NameList &attrs ) const
259259
{
260-
throw Exception( "IECoreNuke::LiveScene does not support attributeNames()." );
261260
}
262261

263262
ConstObjectPtr LiveScene::readAttribute( const Name &name, double time ) const
264263
{
265-
throw Exception( "IECoreNuke::LiveScene does not support readAttribute()." );
264+
return IECore::NullObject::defaultNullObject();
266265
}
267266

268267
void LiveScene::writeAttribute( const Name &name, const Object *attribute, double time )
@@ -272,12 +271,11 @@ void LiveScene::writeAttribute( const Name &name, const Object *attribute, doubl
272271

273272
bool LiveScene::hasTag( const Name &name, int filter ) const
274273
{
275-
throw Exception( "IECoreNuke::LiveScene does not support hasTag()." );
274+
return false;
276275
}
277276

278277
void LiveScene::readTags( NameList &tags, int filter ) const
279278
{
280-
throw Exception( "IECoreNuke::LiveScene does not support readTags()." );
281279
}
282280

283281
void LiveScene::writeTags( const NameList &tags )
@@ -287,12 +285,12 @@ void LiveScene::writeTags( const NameList &tags )
287285

288286
SceneInterface::NameList LiveScene::setNames( bool includeDescendantSets ) const
289287
{
290-
throw Exception( "IECoreNuke::LiveScene::setNames not supported" );
288+
return SceneInterface::NameList();
291289
}
292290

293291
IECore::PathMatcher LiveScene::readSet( const Name &name, bool includeDescendantSets, const IECore::Canceller *canceller ) const
294292
{
295-
throw Exception( "IECoreNuke::LiveScene::readSet not supported" );
293+
return IECore::PathMatcher();
296294
}
297295

298296
void LiveScene::writeSet( const Name &name, const IECore::PathMatcher &set )
@@ -302,7 +300,6 @@ void LiveScene::writeSet( const Name &name, const IECore::PathMatcher &set )
302300

303301
void LiveScene::hashSet( const Name& setName, IECore::MurmurHash &h ) const
304302
{
305-
throw Exception( "IECoreNuke::LiveScene::hashSet not supported" );
306303
}
307304

308305
bool LiveScene::hasObject() const
@@ -487,5 +484,7 @@ SceneInterfacePtr LiveScene::scene( const Path &path, MissingBehaviour missingBe
487484

488485
void LiveScene::hash( HashType hashType, double time, MurmurHash &h ) const
489486
{
490-
throw Exception( "Hashes currently not supported in IECoreNuke::LiveScene objects." );
487+
Path p;
488+
path( p );
489+
h.append( &( p[0] ), p.size() );
491490
}

0 commit comments

Comments
 (0)