Here's an example using a task function that should capture an object before and after removing it:
Code:
import viz
import viztask
viz.go()
dojo = viz.addChild('dojo.osgb')
ball = viz.addChild('beachball.osgb', pos=[0,1.8,2])
def screenCaptureTask():
viz.window.screenCapture('Before.png')
yield viztask.waitFrame(1)
ball.remove()
viz.window.screenCapture('After.png')
viztask.schedule( screenCaptureTask() )