Get Scene from application context, trainer, or operation context
| 554 | |
| 555 | // Get Scene from application context, trainer, or operation context |
| 556 | lfs::core::Scene* get_scene_internal() { |
| 557 | // Priority 1: Application scene (persistent, works from background threads) |
| 558 | if (auto* app_scene = lfs::python::get_application_scene()) { |
| 559 | return app_scene; |
| 560 | } |
| 561 | // Priority 2: Current trainer (headless mode during hooks) |
| 562 | if (g_current_trainer) { |
| 563 | return g_current_trainer->getScene(); |
| 564 | } |
| 565 | // Priority 3: Operation context (short-lived, for capability invocations) |
| 566 | return lfs::python::get_scene_for_python(); |
| 567 | } |
| 568 | |
| 569 | } // namespace |
| 570 |
no test coverage detected