Skip to content

Commit ff5aee6

Browse files
committed
LiveScene: Fix bug/crash when we have an empty LiveScene ( no input connection )
1 parent 5095445 commit ff5aee6

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/IECoreNuke/LiveScene.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ void LiveScene::path( Path &p ) const
347347
Imath::Box3d LiveScene::readBound( double time ) const
348348
{
349349
Imath::Box3d bound;
350+
bound.makeEmpty();
350351
IECoreScene::SceneInterface::Path rootPath, currentPath;
351352
for( unsigned i=0; i < objects( &time ); ++i )
352353
{

test/IECoreNuke/LiveSceneKnobTest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ def testNameAndLabel( self ) :
5050
self.assertEqual( k.name(), "scene" )
5151
self.assertEqual( k.label(), "Scene" )
5252

53+
def testEmptyScene( self ) :
54+
import imath
55+
56+
n = nuke.createNode( "ieLiveScene" )
57+
liveScene = n.knob( "scene" ).getValue()
58+
59+
self.assertEqual( liveScene.childNames(), [] )
60+
self.assertEqual( liveScene.readTransform( 0 ).value.transform, imath.M44d() )
61+
self.assertEqual( liveScene.readBound( 0 ), imath.Box3d() )
62+
self.assertTrue( isinstance( liveScene.readObject( 0 ), IECore.NullObject ) )
63+
5364
def testAccessors( self ) :
5465

5566
n = nuke.createNode( "ieLiveScene" )

0 commit comments

Comments
 (0)