This open me the GUI of Paraview and execute some operations like loading geometry and perform some post processing. And also load some home made python libraries with post-processing functions like plot line at location of interest if wanted by the user.
With ParaView 5.4, after the script finished, I can write command inside Python shell to execute these post processing functions. With ParaView 5.6, when I click on Python shell, I’ve got a kind of reset of script and the post-processing functions are thus not available. I need to launch again the script by using Run Script button inside Python shell, which is not expected (the use of --script in command line is supposed to replace the Run Script button)
Data loaded after python script run from command line
Welcome to ParaView, @aspsgge. It looks to me like you can’t set the active point arrays because none of the arrays have names in the GUI. I believe that is the root cause of your problem.
Thank you for your quick answers. (the array names were hidden, that’s why there is no array name). I will explain better my issue.
Here is an example of script :
#### BEGIN ######
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# create a new 'Sphere'
sphere1 = Sphere()
sphere1.ThetaResolution = 20
sphere1.PhiResolution = 20
# get active view
renderView1 = GetActiveViewOrCreate('RenderView')
# uncomment following to set a specific view size
# renderView1.ViewSize = [1618, 480]
# show data in view
sphere1Display = Show(sphere1, renderView1)
import numpy as np
a = np.linspace(0,1,10)
##### END #####
The Python shell is now executing in a separate context, so you’ll just need to import stuff again. Just do import numpy as np again in the shell and it’d be fine.
So there is no real solution except running the script again. :-/
For my use, it’s not just one line like import numpy as np, but a lot of lines… This was for a simple example.
I see that in Paraview 5.7, there is no more option “–script=” for executing paraview. This features of launching a python script at the opening is now not supported?