<div dir="ltr"><div><div><div><div><div>I would like to use Python declared variables inside new scripts from ProgrammableSource and/or ProgrammableFilter.<br></div><div><br>Why do I want such a thing? I could simply declared these variables in the code of the script.<br>But what if these variables are to be used by several scripts from ProgrammableSource and/or ProgrammableFilter?<br></div><div><br></div>Of course, I can serialize variables and pass the serialized data to the scripts, taking special care for float. But, what if I have large data, that are difficult to serialize?<br></div><br></div><div>So, here is my question:<br></div><div>Is there a mechanism to access already defined data inside the scripts of ProgrammableSource and/or ProgrammableFilter? For example, a global scope dict?<br>Do I have to use an external file to store and access data?<br></div>Below is the example of the Python file I would like to run , where I have defined a 'data' that I want to access inside the script. If I try to directly access 'data', I have a "NameError: global name 'data' is not defined"<br></div><div><br></div><div>My data are in fact transformation matrices that will be used to move objects from a ProgrammableFilter. Using the Animation Keyframes are terribly slow.<br></div><div><br></div>Guillaume<br><br><br><br></div><div>Python script:<br></div><div><br></div>    data = ....<br><br><div>    script="""<br></div><div>    instructions to access "data" at run time<br></div><div>    ...<br>    """<br><br>    scriptRequestInformation="""<br>    ...<br>    """<br><br>    source = ProgrammableSource()<br>    source.OutputDataSetType = 'vtkStructuredGrid'<br>    source.Script = script<br>    source.ScriptRequestInformation = scriptRequestInformation<br>    source.PythonPath = ''<br></div></div>