Returns a dictionary representation the currently loaded PyMOL session.The session file (.pse) is a compressed version of its output.
WARNING: This API is undocumented API, intended for internal use. Use it only when it is necessary.
# get the session as a dictionary print cmd.get_session()
The returned dictionary has following key-value pairs.
- main: An array encoding window size. For example, [640, 480]
- settings: An array of PyMOL's global settings. They are dumped by SettingAsPyList in layer1/Setting.c. Further details will not be discussed because scripts can access these values from cmd.get API.
- colors: If you have defined color names by Set Color, they are described here. Default color names (red, blue, etc...) will not appear. This dict can also be obtained by cmd.get_color_indices(). To get RGB definition of a color, get its pallet ID by cmd.get_color_index and convert it to RGB tuple by cmd.get_color_tuple.
- view: Same as cmd.get_view()
- version: Version number of PyMOL
- names: This is the most complex but interesting part. Produced by ExecutiveGetNamedEntries, this array describes internal C-objects of the current session. Each element is an array of five elements.
(documentation in progress... Please feel free to expand)