Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

RealFlow’s interface provides several tools for opening files from your local or network hard disks, and also allows you to select various nodes from a list. These tools can also be used for your own GUI windows. You have full access to these pickers and they offer full functionality, like filtering certain file or node types. There is a fixed code structure for opening the file picker dialogue: 

 

Code Block
themeEclipse
languagepython
linenumberstrue
files = GUIFilePickerDialog.new()
path = files.show(FILE_PICKER_LOAD, "PATH", "*.tif;*.tga", "Load Maps")

...

 

The files.show() statement contains a series of arguments. The first statement, FILE_PICKER_LOAD, opens the file loader. If you want to save files, replace it with FILE_PICKER_SAVE. The next part specifies the path of directory that will be opened. This path has to be adjusted to your own needs, of course. With the next argument it is possible to restrict the file list to a certain type. In this case only TIFFs and TGAs are displayed. If you want to show all files, use the  *.* notation. Finally you can apply a name to your window. It is just entered between quotation marks, like any other string.

...

Code Block
themeEclipse
languagepython
linenumberstrue
dialog = GUINodesPickerDialog.new()
nodes = dialog.show( TYPE_EMITTER | TYPE_DAEMON )

for single_node in nodes:
    scene.message(single_node.getName())

...

 

With TYPE_NODE it is possible to restrict the displayed nodes to a certain type:

...