| 99 | } |
| 100 | |
| 101 | void Renderer::onLoad(RenderContext* pRenderContext) |
| 102 | { |
| 103 | // Load all plugins |
| 104 | PluginManager::instance().loadAllPlugins(); |
| 105 | |
| 106 | mpExtensions.push_back(MogwaiSettings::create(this)); |
| 107 | if (gExtensions) |
| 108 | { |
| 109 | for (auto& f : (*gExtensions)) mpExtensions.push_back(f.second(this)); |
| 110 | gExtensions.reset(); |
| 111 | } |
| 112 | |
| 113 | auto regBinding = [this](pybind11::module& m) {this->registerScriptBindings(m); }; |
| 114 | ScriptBindings::registerBinding(regBinding); |
| 115 | |
| 116 | // Load script provided via command line. |
| 117 | if (!mOptions.scriptFile.empty()) |
| 118 | { |
| 119 | if (mOptions.deferredLoad) |
| 120 | { |
| 121 | loadScriptDeferred(mOptions.scriptFile); |
| 122 | } |
| 123 | else |
| 124 | { |
| 125 | loadScript(mOptions.scriptFile); |
| 126 | } |
| 127 | // Add script to recent files only if not in silent mode (which is used during image tests). |
| 128 | if (!mOptions.silentMode) mAppData.addRecentScript(mOptions.scriptFile); |
| 129 | } |
| 130 | |
| 131 | // Load pyscene provided via command line. |
| 132 | if (!mOptions.sceneFile.empty()) |
| 133 | { |
| 134 | loadScene(mOptions.sceneFile); |
| 135 | // Add scene to recent files only if not in silent mode (which is used during image tests). |
| 136 | if (!mOptions.silentMode) mAppData.addRecentScene(mOptions.sceneFile); |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | void Renderer::onOptionsChange() |
| 141 | { |
nothing calls this directly
no test coverage detected