<div dir="ltr">Hi Roman,<div><br></div><div>I'm sorry I haven't had a chance to look at this further. Have you made any more progress on this? I apologize for thinking it would be easy to hack ParaView to better support loading multiple state files - it appears to be more difficult than expected after all.</div><div><br></div><div>Best regards,</div><div>Cory</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 20, 2018 at 12:13 PM, Grothausmann, Roman Dr. <span dir="ltr"><<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannover.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Many thanks Cory for your feedback. Not adding empty (None) properties did not help (<a href="http://github.com/romangrothausmann/ParaView_scripts/commit/d3af645dd1af2a" rel="noreferrer" target="_blank">http://github.com/romangrotha<wbr>usmann/ParaView_scripts/<wbr>commit/d3af645dd1af2a</a>). Anyway, "ForceUseCache" has a vector of value 0 so it seems to me the actual problem still is that ListProperties() returns properties that are not part of the specific object that is calling ListProperties(). E.g. help(repr) does not list a property called "ForceUseCache" but e.g. "Visibility"<br>
<br>
So I decided to only restore the property "Visibility" for a start:<br>
<a href="http://github.com/romangrothausmann/ParaView_scripts/commit/d1c63f2682e834e" rel="noreferrer" target="_blank">http://github.com/romangrothau<wbr>smann/ParaView_scripts/commit/<wbr>d1c63f2682e834e</a><br>
Even though there is no error on execution any more, the resulting PVSM has only the visibilities set for the last loaded PVSM, i.e. the setting of the "Visibility" of representations loaded from former PVSMs did not have any effect.<br>
Is there a need to call some kind of Update() to make the property setting have any effect? I tried some rendering (<a href="http://github.com/romangrothausmann/ParaView_scripts/commit/294ff85a0cc7a" rel="noreferrer" target="_blank">http://github.com/romangrotha<wbr>usmann/ParaView_scripts/<wbr>commit/294ff85a0cc7a</a>), but that did not help either.<span class=""><br>
<br>
<br>
On 20/03/18 06:12, Cory Quammen wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Roman,<br>
<br>
Looking at your original problem with the error:<br>
<br>
<br>
    File "/opt/paraview-5.3.0_GL1/lib/p<wbr>araview-5.3/site-packages/para<wbr>view/servermanager.py", line 375, in SetPropertyWithName<br>
      prop.SetData(arg)<br>
    File "/opt/paraview-5.3.0_GL1/lib/p<wbr>araview-5.3/site-packages/para<wbr>view/servermanager.py", line 1296, in SetData<br>
      self.SMProperty.AddProxy(value<wbr>_proxy)<br>
TypeError: AddProxy argument 1: method requires a VTK object<br>
<br>
<br>
You are hitting this when attempting to set the DataAxesGrid, which is a ProxyProperty. In your dictionary, this entry has value 'None', but it looks like setting a property to value 'None' is not handled correctly in servermanager.py. As a workaround, I suggest filtering out properties from your dictionary that have 'None' as a value, i.e., do not add those property values to your dictionary.<br>
<br>
HTH,<br>
Cory<br>
<br></span><div><div class="h5">
On Mon, Mar 19, 2018 at 12:12 PM, Grothausmann, Roman Dr. <<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannove<wbr>r.de</a> <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a>>> wrote:<br>
<br>
    Hi Cory,<br>
<br>
<br>
    Trying to find out what causes the former problems, I inserted a line that<br>
    just sets the property that got collected so far:<br>
    <a href="https://github.com/romangrothausmann/ParaView_scripts/commit/b8058f774535398da3767048219df12d6354e6c5#diff-2804420278bfff084788b82c715c452eR59" rel="noreferrer" target="_blank">https://github.com/romangrotha<wbr>usmann/ParaView_scripts/<wbr>commit/b8058f774535398da376704<wbr>8219df12d6354e6c5#diff-2804420<wbr>278bfff084788b82c715c452eR59</a><br>
    <<a href="https://github.com/romangrothausmann/ParaView_scripts/commit/b8058f774535398da3767048219df12d6354e6c5#diff-2804420278bfff084788b82c715c452eR59" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ParaView_scripts/<wbr>commit/b8058f774535398da376704<wbr>8219df12d6354e6c5#diff-2804420<wbr>278bfff084788b82c715c452eR59</a>><br>
    It already aborts on the first property encountered (ForceUseCache):<br>
<br>
    <paraview.servermanager.Geomet<wbr>ryRepresentation object at 0x7f7b591fc250><br>
    ForceUseCache 0<br>
    Traceback (most recent call last):<br>
       File "/net/home/paraview/scripts/pv<wbr>sm-multi.py", line 91, in <module><br>
         main()<br>
       File "/net/home/paraview/scripts/pv<wbr>sm-multi.py", line 59, in main<br>
         pvs.SetProperties(repr, **d)<br>
       File<br>
    "/opt/paraview-5.3.0_GL1/lib/p<wbr>araview-5.3/site-packages/para<wbr>view/simple.py",<br>
    line 567, in SetProperties<br>
         raise AttributeError("object has no property %s" % param)<br>
    AttributeError: object has no property ForceUseCache<br>
<br>
    Is ListProperties() returning properties that are not part of the specific<br>
    object that is calling ListProperties()?<br>
<br>
    Many thanks for any help or hints,<br>
    Roman<br>
<br>
    On 21/12/17 16:06, Grothausmann, Roman Dr. wrote:<br>
<br>
        Hi Cory,<br>
<br>
        On 06/12/17 23:06, Cory Quammen wrote:<br>
<br>
            Sorry I failed to follow up. Did you find a solution to this problem?<br>
<br>
<br>
        Many thanks for your reply. No, and I'm still stuck. I tried Your<br>
        suggestion to remove [0]<br>
        (<a href="https://github.com/romangrothausmann/ParaView_scripts/commit/e40d1016d698ee363500bb9bf04f29add89b99dd" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ParaView_scripts/<wbr>commit/e40d1016d698ee363500bb9<wbr>bf04f29add89b99dd</a><br></div></div>
        <<a href="https://github.com/romangrothausmann/ParaView_scripts/commit/e40d1016d698ee363500bb9bf04f29add89b99dd" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ParaView_scripts/<wbr>commit/e40d1016d698ee363500bb9<wbr>bf04f29add89b99dd</a>>),<div><div class="h5"><br>
        which changed the reported error from:<br>
<br>
            File<br>
        "/opt/paraview-5.3.0_GL1/lib/p<wbr>araview-5.3/site-packages/para<wbr>view/servermanager.py",<br>
        line 375, in SetPropertyWithName<br>
              prop.SetData(arg)<br>
            File<br>
        "/opt/paraview-5.3.0_GL1/lib/p<wbr>araview-5.3/site-packages/para<wbr>view/servermanager.py",<br>
        line 803, in SetData<br>
              raise RuntimeError("This property requires %d values." %<br>
        self.GetNumberOfElements())<br>
        RuntimeError: This property requires 3 values.<br>
<br>
        to:<br>
<br>
            File<br>
        "/opt/paraview-5.3.0_GL1/lib/p<wbr>araview-5.3/site-packages/para<wbr>view/servermanager.py",<br>
        line 375, in SetPropertyWithName<br>
              prop.SetData(arg)<br>
            File<br>
        "/opt/paraview-5.3.0_GL1/lib/p<wbr>araview-5.3/site-packages/para<wbr>view/servermanager.py",<br>
        line 1296, in SetData<br>
              self.SMProperty.AddProxy(value<wbr>_proxy)<br>
        TypeError: AddProxy argument 1: method requires a VTK object<br>
<br>
        Any ideas on this?<br>
        Would You say it is a general problem in the py-code or could it be<br>
        caused by the content of the PVSMs I'm trying to combine?<br>
<br>
        Many thanks for looking into this.<br>
        Roman<br>
<br>
<br>
            This line in your script looks funny to me:<br>
<br>
            d[props] = pvs.GetProperty(repr, props[0])<br>
<br>
            Shouldn't props[0] just be props?<br>
<br>
            Thanks,<br>
            Cory<br>
<br>
            On Fri, Nov 10, 2017 at 10:28 AM, Grothausmann, Roman Dr.<br>
            <<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannove<wbr>r.de</a><br></div></div><div><div class="h5">
            <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a>>> wrote:<br>
<br>
                Dear Cory,<br>
<br>
                On 15/09/17 15:27, Grothausmann, Roman Dr. wrote:<br>
<br>
<br>
                    On 15/09/17 15:14, Cory Quammen wrote:<br>
<br>
<br>
                        Put a ** in front of reppro[i], e.g.,<br>
<br>
                        pvs.SetProperties(repr, **reppro[i])<br>
<br>
<br>
                    Hm, I now get:<br>
                    TypeError: SetProperties() argument after ** must be a<br>
                    mapping, not list<br>
                    Do I have to store the dict of object properties in another<br>
                    dict instead<br>
                    of a list?<br>
<br>
<br>
<br>
                With a dict of dicts<br>
                <a href="https://github.com/romangrothausmann/ParaView_scripts/commit/3b309cc603433f02afc3e50656bd99f8b7cd0aa8#diff-2804420278bfff084788b82c715c452e" rel="noreferrer" target="_blank">https://github.com/romangrotha<wbr>usmann/ParaView_scripts/<wbr>commit/3b309cc603433f02afc3e50<wbr>656bd99f8b7cd0aa8#diff-2804420<wbr>278bfff084788b82c715c452e</a><br>
                <<a href="https://github.com/romangrothausmann/ParaView_scripts/commit/3b309cc603433f02afc3e50656bd99f8b7cd0aa8#diff-2804420278bfff084788b82c715c452e" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ParaView_scripts/<wbr>commit/3b309cc603433f02afc3e50<wbr>656bd99f8b7cd0aa8#diff-2804420<wbr>278bfff084788b82c715c452e</a>><br>
<br>
                I get:<br>
<br>
                    File "/net/home/grothama/paraview/s<wbr>cripts/pvsm-multi.py",<br>
                line 64, in main<br>
                      pvs.SetProperties(repr, **reppro[i]);<br>
                    File<br>
                "/opt/paraview-5.3.0_GL1/lib/p<wbr>araview-5.3/site-packages/para<wbr>view/simple.py",<br>
                line 568, in SetProperties<br>
                      setattr(proxy, param, params[param])<br>
                    File<br>
                "/opt/paraview-5.3.0_GL1/lib/p<wbr>araview-5.3/site-packages/para<wbr>view/servermanager.py",<br>
<br>
                line 317, in __setattr__<br>
                      setter(self, value)<br>
                    File<br>
                "/opt/paraview-5.3.0_GL1/lib/p<wbr>araview-5.3/site-packages/para<wbr>view/servermanager.py",<br>
<br>
                line 2528, in setProperty<br>
                      return self.SetPropertyWithName(propN<wbr>ame, value)<br>
                    File<br>
                "/opt/paraview-5.3.0_GL1/lib/p<wbr>araview-5.3/site-packages/para<wbr>view/servermanager.py",<br>
<br>
                line 375, in SetPropertyWithName<br>
                      prop.SetData(arg)<br>
                    File<br>
                "/opt/paraview-5.3.0_GL1/lib/p<wbr>araview-5.3/site-packages/para<wbr>view/servermanager.py",<br>
<br>
                line 803, in SetData<br>
                      raise RuntimeError("This property requires %d values." %<br>
                self.GetNumberOfElements())<br>
                RuntimeError: This property requires 3 values.<br>
<br>
                Any ideas what could still be wrong?<br>
<br>
<br>
                            On 07/09/17 23:37, Cory Quammen wrote:<br>
<br>
<br>
<br>
                                Hi Roman,<br>
<br>
                                It turns out ParaView was not designed for this<br>
                                use case because of<br>
                                certain difficulties discussed here:<br>
<br>
                                <a href="https://gitlab.kitware.com/paraview/paraview/issues/17442" rel="noreferrer" target="_blank">https://gitlab.kitware.com/par<wbr>aview/paraview/issues/17442</a><br>
                                <<a href="https://gitlab.kitware.com/paraview/paraview/issues/17442" rel="noreferrer" target="_blank">https://gitlab.kitware.com/pa<wbr>raview/paraview/issues/17442</a>><br>
<br>
                                In your Python script, you could manually cash<br>
                                all the properties of<br>
                                the existing representations and restore them<br>
                                after loading the most<br>
                                recent state file.<br>
<br>
                                The functions<br>
<br>
                                reprs = GetRepresentations()<br>
                                repr = reprs.values()[0]<br>
                                props = repr.ListProperties()<br>
                                GetProperty(repr, props[0])<br>
<br>
                                would be helpful for this.<br>
<br>
                                Cory<br>
<br>
<br>
                                On Mon, Sep 4, 2017 at 8:42 AM, Grothausmann,<br>
                                Roman Dr.<br>
                                <<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannove<wbr>r.de</a><br></div></div><div><div class="h5">
                                <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a>>> wrote:<br>
<br>
<br>
<br>
                                    Dear mailing list members,<br>
<br>
<br>
                                    It seems that PV (and<br>
                                    paraview.simple.LoadState) by default hides<br>
                                    already<br>
                                    loaded objects (and resets e.g. their<br>
                                    coloring) when another<br>
                                    state-file<br>
                                    is<br>
                                    loaded.<br>
                                    Is there a way to load multiple state-files<br>
                                    after one another without<br>
                                    hiding<br>
                                    and resetting already existent objects? I.e.<br>
                                    a way to concatenate<br>
                                    multiple<br>
                                    state-files and leave their objects in the<br>
                                    state as they got loaded<br>
                                    (e.g.<br>
                                    colored, hidden/visible)?<br>
                                    I do understand that loading a new<br>
                                    state-file will reset the camera,<br>
                                    but<br>
                                    not<br>
                                    the rest.<br>
                                    Here's my initial attempt to achieve this<br>
                                    with pvpython:<br>
<br>
<br>
                                    <a href="https://github.com/romangrothausmann/ParaView_scripts/blob/90eb4ca8499070bed941d50b89ebea82fd6a9e23/pvsm-multi.py" rel="noreferrer" target="_blank">https://github.com/romangrotha<wbr>usmann/ParaView_scripts/blob/9<wbr>0eb4ca8499070bed941d50b89ebea8<wbr>2fd6a9e23/pvsm-multi.py</a><br>
                                    <<a href="https://github.com/romangrothausmann/ParaView_scripts/blob/90eb4ca8499070bed941d50b89ebea82fd6a9e23/pvsm-multi.py" rel="noreferrer" target="_blank">https://github.com/romangroth<wbr>ausmann/ParaView_scripts/blob/<wbr>90eb4ca8499070bed941d50b89ebea<wbr>82fd6a9e23/pvsm-multi.py</a>><br>
<br>
<br>
                                    Any help or hints are very much appreciated<br>
                                    Roman<br>
<br>
                                    --                                     Dr. Roman Grothausmann<br>
<br>
                                    Tomographie und Digitale Bildverarbeitung<br>
                                    Tomography and Digital Image Analysis<br>
<br>
                                    Medizinische Hochschule Hannover<br>
                                    Institut für Funktionelle und Angewandte<br>
                                    Anatomie<br>
                                    OE 4120, Carl-Neuberg-Str. 1, 30625<br>
                                    Hannover, Deutschland<br>
<br>
                                    Tel. <a href="tel:%2B49%20511%20532-2900" value="+495115322900" target="_blank">+49 511 532-2900</a><br></div></div>
                                    <tel:%2B49%20511%20532-2900><br>
                                    <a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannover<wbr>.de</a><br>
                                    <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a>><br>
                                    <a href="http://www.mh-hannover.de/anatomie.html" rel="noreferrer" target="_blank">http://www.mh-hannover.de/anat<wbr>omie.html</a><span class=""><br>
                                    <<a href="http://www.mh-hannover.de/anatomie.html" rel="noreferrer" target="_blank">http://www.mh-hannover.de/ana<wbr>tomie.html</a>><br>
                                    ______________________________<wbr>_________________<br>
                                    Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br></span>
                                    <<a href="http://www.kitware.com" rel="noreferrer" target="_blank">http://www.kitware.com</a>><span class=""><br>
<br>
                                    Visit other Kitware open-source projects at<br>
                                    <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
                                    <<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/openso<wbr>urce/opensource.html</a>><br>
<br>
                                    Please keep messages on-topic and check the<br>
                                    ParaView Wiki at:<br>
                                    <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaV<wbr>iew</a><br>
                                    <<a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/Para<wbr>View</a>><br>
<br>
                                    Search the list archives at:<br>
                                    <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>ParaView</a><br>
                                    <<a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q<wbr>=ParaView</a>><br>
<br>
                                    Follow this link to subscribe/unsubscribe:<br>
                                    <a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/paraview</a><br>
                                    <<a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/mai<wbr>lman/listinfo/paraview</a>><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
                            --                             Dr. Roman Grothausmann<br>
<br>
                            Tomographie und Digitale Bildverarbeitung<br>
                            Tomography and Digital Image Analysis<br>
<br>
                            Medizinische Hochschule Hannover<br>
                            Institut für Funktionelle und Angewandte Anatomie<br>
                            OE 4120, Carl-Neuberg-Str. 1, 30625 Hannover,<br>
                            Deutschland<br>
<br></span>
                            Tel. <a href="tel:%2B49%20511%20532-2900" value="+495115322900" target="_blank">+49 511 532-2900</a> <tel:%2B49%20511%20532-2900><br>
                            <a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannover<wbr>.de</a><br>
                            <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a>><br>
                            <a href="http://www.mh-hannover.de/anatomie.html" rel="noreferrer" target="_blank">http://www.mh-hannover.de/anat<wbr>omie.html</a><span class=""><br>
                            <<a href="http://www.mh-hannover.de/anatomie.html" rel="noreferrer" target="_blank">http://www.mh-hannover.de/ana<wbr>tomie.html</a>><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
                --                 Dr. Roman Grothausmann<br>
<br>
                Tomographie und Digitale Bildverarbeitung<br>
                Tomography and Digital Image Analysis<br>
<br>
                Medizinische Hochschule Hannover<br>
                Institut für Funktionelle und Angewandte Anatomie<br>
                OE 4120, Carl-Neuberg-Str. 1, 30625 Hannover, Deutschland<br>
<br></span>
                Tel. <a href="tel:%2B49%20511%20532-2900" value="+495115322900" target="_blank">+49 511 532-2900</a> <tel:%2B49%20511%20532-2900><br>
                <a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannover<wbr>.de</a><br>
                <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a>><br>
                <a href="http://www.mh-hannover.de/anatomie.html" rel="noreferrer" target="_blank">http://www.mh-hannover.de/anat<wbr>omie.html</a><span class=""><br>
                <<a href="http://www.mh-hannover.de/anatomie.html" rel="noreferrer" target="_blank">http://www.mh-hannover.de/ana<wbr>tomie.html</a>><br>
<br>
<br>
<br>
<br>
<br>
<br>
    --     Dr. Roman Grothausmann<br>
<br>
    Tomographie und Digitale Bildverarbeitung<br>
    Tomography and Digital Image Analysis<br>
<br>
    Medizinische Hochschule Hannover<br>
    Institut für Funktionelle und Angewandte Anatomie<br>
    OE 4120, Carl-Neuberg-Str. 1, 30625 Hannover, Deutschland<br>
<br></span>
    Tel. <a href="tel:%2B49%20511%20532-2900" value="+495115322900" target="_blank">+49 511 532-2900</a> <tel:%2B49%20511%20532-2900><br>
    <a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannover<wbr>.de</a> <mailto:<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-<wbr>hannover.de</a>><br>
    <a href="http://www.mh-hannover.de/anatomie.html" rel="noreferrer" target="_blank">http://www.mh-hannover.de/anat<wbr>omie.html</a><span class=""><br>
    <<a href="http://www.mh-hannover.de/anatomie.html" rel="noreferrer" target="_blank">http://www.mh-hannover.de/ana<wbr>tomie.html</a>><br>
<br>
<br>
<br>
<br>
-- <br>
Cory Quammen<br>
Staff R&D Engineer<br>
Kitware, Inc.<br>
</span></blockquote>
<br><div class="HOEnZb"><div class="h5">
-- <br>
Dr. Roman Grothausmann<br>
<br>
Tomographie und Digitale Bildverarbeitung<br>
Tomography and Digital Image Analysis<br>
<br>
Medizinische Hochschule Hannover<br>
Institut für Funktionelle und Angewandte Anatomie<br>
OE 4120, Carl-Neuberg-Str. 1, 30625 Hannover, Deutschland<br>
<br>
Tel. <a href="tel:%2B49%20511%20532-2900" value="+495115322900" target="_blank">+49 511 532-2900</a><br>
<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannover<wbr>.de</a><br>
<a href="http://www.mh-hannover.de/anatomie.html" rel="noreferrer" target="_blank">http://www.mh-hannover.de/anat<wbr>omie.html</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Cory Quammen<br>Staff R&D Engineer<br>Kitware, Inc.</div>
</div>