Hydra code cleanup #81

Merged
Bogdan Nagirniak merged 7 commits from hydra-code-cleanup into hydra-render 2023-08-01 21:35:28 +02:00
3 changed files with 9 additions and 1 deletions
Showing only changes of commit e1806a7ea0 - Show all commits

View File

@ -117,12 +117,13 @@ static PyObject *engine_view_draw_func(PyObject * /*self*/, PyObject *args)
} }
ViewportEngine *engine = static_cast<ViewportEngine *>(PyLong_AsVoidPtr(pyengine)); ViewportEngine *engine = static_cast<ViewportEngine *>(PyLong_AsVoidPtr(pyengine));
bContext *context = pyrna_to_pointer<bContext>(pycontext, &RNA_Context);
CLOG_INFO(LOG_HYDRA_RENDER, 3, "Engine %p", engine); CLOG_INFO(LOG_HYDRA_RENDER, 3, "Engine %p", engine);
/* Allow Blender to execute other Python scripts. */ /* Allow Blender to execute other Python scripts. */
Py_BEGIN_ALLOW_THREADS; Py_BEGIN_ALLOW_THREADS;
engine->render(); engine->render(context);
Py_END_ALLOW_THREADS; Py_END_ALLOW_THREADS;
Py_RETURN_NONE; Py_RETURN_NONE;

View File

@ -287,6 +287,12 @@ void ViewportEngine::render()
} }
} }
void ViewportEngine::render(bContext *context)
{
context_ = context;
render();
}
void ViewportEngine::notify_status(float /*progress*/, const std::string &info, void ViewportEngine::notify_status(float /*progress*/, const std::string &info,
const std::string &status) const std::string &status)
{ {

View File

@ -38,6 +38,7 @@ class ViewportEngine : public Engine {
using Engine::Engine; using Engine::Engine;
void render() override; void render() override;
void render(bContext *context);
protected: protected:
void notify_status(float progress, const std::string &title, const std::string &info) override; void notify_status(float progress, const std::string &title, const std::string &info) override;