parameters: (statefile, data_directory = None, restrict_to_data_directory = False,
          filenames = None, *args, **kwargs)
docstring: Load PVSM state file.
  
      This will load the state specified in the `statefile`.
  
      ParaView can update absolute paths for data-files used in the state which
      can be useful to portably load state file across different systems.
  
      If `data_directory` is not None, then ParaView searches for files matching
      those used in the state under the specified directory and if found, replaces
      the state to use the found files instead. If `restrict_to_data_directory` is True,
      if a file is not found under the `data_directory`, it will raise an error,
      otherwise it is left unchanged.
  
      Alternatively, `filenames` can be used to specify a list of updated
      filesnames explicitly. This must be list of the following form:
  
          [
              {
                # either 'name' or 'id' are required. if both are provided, 'id'
                # is checked first.
                "name" : "[reader name shown in pipeline browser]",
                "id"   : "[reader id used in the pvsm state file]",
  
                # all modified filename-like properties on this reader
                "FileName" : ...
                ....
              },
  
              ...
          ]
  
      Presence of other positional or keyword arguments is used to indicate that this
      invocation uses the legacy signature of this function and forwards to
      `_LoadStateLegacy`.
docstring_summary: Load PVSM state file.
docstring_tokens: Load PVSM state file .
function: def LoadState(statefile, data_directory = None, restrict_to_data_directory = False,
          filenames = None, *args, **kwargs):
      """
      Load PVSM state file.
  
      This will load the state specified in the `statefile`.
  
      ParaView can update absolute paths for data-files used in the state which
      can be useful to portably load state file across different systems.
  
      If `data_directory` is not None, then ParaView searches for files matching
      those used in the state under the specified directory and if found, replaces
      the state to use the found files instead. If `restrict_to_data_directory` is True,
      if a file is not found under the `data_directory`, it will raise an error,
      otherwise it is left unchanged.
  
      Alternatively, `filenames` can be used to specify a list of updated
      filesnames explicitly. This must be list of the following form:
  
          [
              {
                # either 'name' or 'id' are required. if both are provided, 'id'
                # is checked first.
                "name" : "[reader name shown in pipeline browser]",
                "id"   : "[reader id used in the pvsm state file]",
  
                # all modified filename-like properties on this reader
                "FileName" : ...
                ....
              },
  
              ...
          ]
  
      Presence of other positional or keyword arguments is used to indicate that this
      invocation uses the legacy signature of this function and forwards to
      `_LoadStateLegacy`.
      """
      if kwargs:
          return _LoadStateLegacy(statefile, *args, **kwargs)
  
      RemoveViewsAndLayouts()
  
      pxm = servermanager.ProxyManager()
      pyproxy = servermanager._getPyProxy(pxm.NewProxy('options', 'LoadStateOptions'))
      if pyproxy.PrepareToLoad(statefile):
          pyproxy.LoadStateDataFileOptions = pyproxy.SMProxy.USE_FILES_FROM_STATE
          if pyproxy.HasDataFiles():
              if data_directory is not None:
                  pyproxy.LoadStateDataFileOptions = pyproxy.SMProxy.USE_DATA_DIRECTORY
                  pyproxy.DataDirectory = data_directory
                  if restrict_to_data_directory:
                      pyproxy.OnlyUseFilesInDataDirectory = 1
              elif filenames is not None:
                  pyproxy.LoadStateDataFileOptions = pyproxy.SMProxy.CHOOSE_FILES_EXPLICITLY
                  for item in filenames:
                      for pname in item.keys():
                          if pname == "name" or pname == "id":
                              continue
                          smprop = pyproxy.FindProperty(item.get("name"), int(item.get("id")), pname)
                          if not smprop:
                              raise RuntimeError("Invalid item specified in 'filenames': %s", item)
                          prop = servermanager._wrap_property(pyproxy, smprop)
                          prop.SetData(item[pname])
          pyproxy.Load()
  
      # Try to set the new view active
      if len(GetRenderViews()) > 0:
          SetActiveView(GetRenderViews()[0])
function_tokens: def LoadState ( statefile , data_directory = None , restrict_to_data_directory = False , filenames = None , * args , * * kwargs ) : if kwargs : return _LoadStateLegacy ( statefile , * args , * * kwargs ) RemoveViewsAndLayouts ( ) pxm = servermanager . ProxyManager ( ) pyproxy = servermanager . _getPyProxy ( pxm . NewProxy ( 'options' , 'LoadStateOptions' ) ) if pyproxy . PrepareToLoad ( statefile ) : pyproxy . LoadStateDataFileOptions = pyproxy . SMProxy . USE_FILES_FROM_STATE if pyproxy . HasDataFiles ( ) : if data_directory is not None : pyproxy . LoadStateDataFileOptions = pyproxy . SMProxy . USE_DATA_DIRECTORY pyproxy . DataDirectory = data_directory if restrict_to_data_directory : pyproxy . OnlyUseFilesInDataDirectory = 1 elif filenames is not None : pyproxy . LoadStateDataFileOptions = pyproxy . SMProxy . CHOOSE_FILES_EXPLICITLY for item in filenames : for pname in item . keys ( ) : if pname == "name" or pname == "id" : continue smprop = pyproxy . FindProperty ( item . get ( "name" ) , int ( item . get ( "id" ) ) , pname ) if not smprop : raise RuntimeError ( "Invalid item specified in 'filenames': %s" , item ) prop = servermanager . _wrap_property ( pyproxy , smprop ) prop . SetData ( item [ pname ] ) pyproxy . Load ( ) # Try to set the new view active if len ( GetRenderViews ( ) ) > 0 : SetActiveView ( GetRenderViews ( ) [ 0 ] )