function openFolderIfOptionSelected(folder, guiState, mainObj, options) {
  if (guiState.guiObject) {
    // The GUI state is controlling the folder state.
    return;
  }
  options.forEach((option) => {
    if (mainObj[option] != undefined) {
      folder.open();
      while (folder.parent) {
        folder = folder.parent;
        folder.open();
      }
    }
  });
}
Open a dat.GUI folder and all of its parents if one of the options is present
in the GUI state.
@param {dat.GUI} folder The GUI folder.
@param {Object} guiState GUI state.
@param {Object} mainObj The main object to check options against.
@param {Array<string>} options The options to check.