Skip to content

Commit

Permalink
Merge pull request #350 from davidsminor/mayaSceneNullAttrs
Browse files Browse the repository at this point in the history
stopped IECoreMaya::LiveScene::readAttribute() returning null pointers
  • Loading branch information
andrewkaufman committed Oct 16, 2014
2 parents 296f79c + aa9977c commit f4a0dc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/IECoreMaya/LiveScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ ConstObjectPtr LiveScene::readAttribute( const Name &name, double time ) const
}
return attr;
}
return 0;
return IECore::NullObject::defaultNullObject();
}

void LiveScene::writeAttribute( const Name &name, const Object *attribute, double time )
Expand Down
4 changes: 2 additions & 2 deletions test/IECoreMaya/LiveSceneTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,13 +719,13 @@ def readMyAttribute( node, attr ) :
transformScene = scene.child(str(t))
sphereScene = scene.child('pSphere')
self.assertEqual( scene.attributeNames(), [ "scene:visible", "root" ] )
self.assertEqual( scene.readAttribute("anyAttr", 0.0), None )
self.assertEqual( scene.readAttribute("anyAttr", 0.0), IECore.NullObject.defaultNullObject() )
self.assertEqual( scene.readAttribute("scene:visible", 0.0), IECore.BoolData(True) )
self.assertEqual( scene.readAttribute("root", 0.0), IECore.BoolData(True) )

self.assertEqual( transformScene.attributeNames(), [ IECore.InternedString("scene:visible"), IECore.InternedString("transformAttribute") ] )
self.assertEqual( transformScene.hasAttribute("shapeAttribute"), False )
self.assertEqual( transformScene.readAttribute("shapeAttribute", 0.0), None )
self.assertEqual( transformScene.readAttribute("shapeAttribute", 0.0), IECore.NullObject.defaultNullObject() )
self.assertEqual( transformScene.readAttribute( "transformAttribute", 0.0), IECore.FloatData(5) )
self.assertEqual( sphereScene.attributeNames(), [ IECore.InternedString("scene:visible"), IECore.InternedString('shapeAttribute') ] )
self.assertEqual( sphereScene.readAttribute( "shapeAttribute", 0.0), IECore.StringData("mesh") )
Expand Down

0 comments on commit f4a0dc8

Please sign in to comment.