What I just now noticed is that if the LIC plugin gets loaded before other plugins the problem goes away! So something about loading other plugins after the LIC makes LIC's attributes disapear. I sent a script that illustrates by loading the SLAC tools plugin. If you swap the loads the script will run.
On 07/06/2011 04:28 PM, Utkarsh Ayachit wrote:
Burlen, Are you sure the plugin is loaded? Utkarsh On Wed, Jul 6, 2011 at 4:29 PM, Burlen Loring<blor...@lbl.gov> wrote:Hi, I am able to use a script written from python trace to render a LIC but when I try to change any of the LIC parameters also from python trace I get attribute errors (below). In the python shell launched from PV a dir shows these attributes, however dir run from in the script shows they are missing. How do I get the LIC attributes to be seen in a python script? Thanks Burlen Traceback (most recent call last): File "test4.py", line 60, in<module> DataRepresentation2.LICNumberOfSteps = 12 File "/work/ext/ParaView/PV3-3.10.0/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py", line 207, in __setattr__ "to add this attribute.") AttributeError: Attribute LICNumberOfSteps does not exist. This class does not allow addition of new attributes to avoid mistakes due to typos. Use add_attribute() if you really want to add this attribute. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
try: paraview.simple except: from paraview.simple import * paraview.simple._DisableFirstRenderCameraReset() # # Swap the order of the plugin load to get this script to work. # LoadPlugin('/work/ext/ParaView/PV3-3.10.0/bin/libSLACTools.so',False,globals()) LoadPlugin('/work/ext/ParaView/PV3-3.10.0/bin/libSLACTools.so',False,globals()) LoadPlugin('/work/ext/ParaView/PV3-3.10.0/bin/libSurfaceLIC.so',False,globals()) LoadPlugin('/work/ext/ParaView/PV3-3.10.0/bin/libSurfaceLIC.so',True,globals()) rankineXY_0_vti = XMLImageDataReader( FileName=['rankineXY_0.vti'] ) rankineXY_0_vti.PointArrayStatus = ['vi'] AnimationScene2 = GetAnimationScene() RenderView3 = GetRenderView() Delete(RenderView3) a2DRenderView1 = CreateRenderView() a2DRenderView1.CompressorConfig = 'vtkZlibImageCompressor 0 9 3 0' a2DRenderView1.RemoteRenderThreshold = 0.0 a2DRenderView1.ViewTime = 0.0 a2DRenderView1.LODResolution = 50.0 a2DRenderView1.NonInteractiveRenderDelay = 1 a2DRenderView1.ImageReductionFactor = 3 a2DRenderView1.LODThreshold = 0.0 a3_vi_PVLookupTable = GetLookupTableForArray( "vi", 3 ) DataRepresentation3 = Show() DataRepresentation3.ColorArrayName = 'vi' DataRepresentation3.LookupTable = a3_vi_PVLookupTable AnimationScene2.ViewModules = a2DRenderView1 Delete(a2DRenderView1) Delete(DataRepresentation3) RenderView4 = CreateRenderView() RenderView4.CameraParallelScale = 21.920310216782973 RenderView4.CompressorConfig = 'vtkZlibImageCompressor 0 9 3 0' RenderView4.UseLight = 1 RenderView4.CameraPosition = [15.5, 15.5, 84.693575034635202] RenderView4.LightSwitch = 0 RenderView4.RemoteRenderThreshold = 0.0 RenderView4.CameraClippingRange = [83.846639284288855, 85.963978660154723] RenderView4.ViewTime = 0.0 RenderView4.UseOffscreenRenderingForScreenshots = 0 RenderView4.LODResolution = 50.0 RenderView4.NonInteractiveRenderDelay = 1 RenderView4.CameraFocalPoint = [15.5, 15.5, 0.0] RenderView4.ImageReductionFactor = 3 RenderView4.CenterAxesVisibility = 0 RenderView4.LODThreshold = 0.0 RenderView4.CenterOfRotation = [15.5, 15.5, 0.0] DataRepresentation4 = Show() DataRepresentation4.EdgeColor = [0.0, 0.0, 0.50000762951094835] DataRepresentation4.ScalarOpacityFunction = [] DataRepresentation4.ColorArrayName = 'vi' DataRepresentation4.ScalarOpacityUnitDistance = 4.4425831231883501 DataRepresentation4.SelectLICVectors = ['POINTS', 'vi'] DataRepresentation4.LookupTable = a3_vi_PVLookupTable DataRepresentation4.Representation = 'Surface LIC' DataRepresentation4.InterpolateScalarsBeforeMapping = 0 AnimationScene2.ViewModules = RenderView4 a3_vi_PVLookupTable.RGBPoints = [0.0, 1.0, 0.0, 0.0, 56.56854249492612, 0.0, 0.0, 1.0] WriteImage('del.png') Render()
rankineXY_0.vti
Description: Binary data
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview