Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More polishing.
  • Loading branch information
pshriwise committed Feb 16, 2026
commit f79e2bb1f8a851a036f3cddffa79fe876827ec76
34 changes: 19 additions & 15 deletions openmc_plotter/main_window.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import copy
from functools import partial
import importlib.util
import os
from pathlib import Path
import pickle
import sys
Expand Down Expand Up @@ -844,11 +843,25 @@ def showRendererDialog(self):
msg_box.setWindowTitle("Experimental Renderer")
msg_box.setText(
"The render widget is experimental.\n\n"
"Complex models may cause the plotter application to lag."
"Complex models may cause the plotter application to lag or, in some cases, crash."
)
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec()

if not self._hasSolidRayTracePlot():
msg_box = QMessageBox(self)
msg_box.setIcon(QMessageBox.Warning)
msg_box.setWindowTitle("Renderer Unavailable")
msg_box.setText(
"This OpenMC installation is missing:\n"
"openmc.lib.capi.SolidRayTracePlot\n\n"
"Install an OpenMC build that provides SolidRayTracePlot "
"to use the render widget."
)
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec()
return

if self._render_dialog is not None:
self._render_dialog.raise_()
self._render_dialog.activateWindow()
Expand Down Expand Up @@ -914,8 +927,7 @@ def _loadRendererClasses(self):
renderer_python_dir = self._findRendererPythonDir()
if renderer_python_dir is None:
raise FileNotFoundError(
"Could not locate openmc_renderer/Python. "
"Set OPENMC_RENDERER_PATH to the renderer repository root."
"Could not locate bundled renderer_core directory."
)

renderer_python_dir_str = str(renderer_python_dir)
Expand All @@ -938,19 +950,11 @@ def _findRendererPythonDir(self):
if local_runtime.is_dir():
return local_runtime

env_path = os.environ.get("OPENMC_RENDERER_PATH")
if env_path:
candidate = Path(env_path) / "Python"
if candidate.is_dir():
return candidate

for parent in Path(__file__).resolve().parents:
candidate = parent / "openmc_renderer" / "Python"
if candidate.is_dir():
return candidate

return None

def _hasSolidRayTracePlot(self):
return getattr(openmc.lib, "SolidRayTracePlot", None) is not None

def _getRendererDomainData(self, view=None):
if view is None:
view = self.model.activeView
Expand Down