[Paraview] ProgrammableSource script executed multiple times on Render()

Hal Canary hal at cs.unc.edu
Mon Jun 4 11:53:37 EDT 2012


Hello,

I have the following macro which creates a ProgrammableSource in 
ParaView.  I'm wondering why the script seems to be called three 
separate times:

	script = """
	import time
	print 'Script was called.',
	print time.strftime('%H:%M:%S')+'.%03d'%(time.time()%1.0*1000)
	self.GetImageDataOutput().SetDimensions(100,100,1)
	# ... do something expensive here ...
	"""
	script_request_information = """
	from paraview import util
	util.SetOutputWholeExtent(self, [0, 100, 0, 100, 0, 0])
	"""
	ps = ProgrammableSource(
		OutputDataSetType='vtkImageData',
		Script=script,
		ScriptRequestInformation=script_request_information)
	GetDisplayProperties(ps).Visibility = 1
	Render()

It prints out once when I turn on visibility and two more times when I 
Render().  How can I keep the script from running more than once?

Thanks!

-- 
Hal Canary


More information about the ParaView mailing list