diff --git a/src/python/magnum/scenegraph.cpp b/src/python/magnum/scenegraph.cpp index 240a6f3..1756ef0 100644 --- a/src/python/magnum/scenegraph.cpp +++ b/src/python/magnum/scenegraph.cpp @@ -39,14 +39,13 @@ template struct PyDrawable: SceneGraph::PyFeatu explicit PyDrawable(SceneGraph::AbstractObject& object, SceneGraph::DrawableGroup* drawables): SceneGraph::PyFeature>{object, drawables} {} void draw(const MatrixTypeFor& transformationMatrix, SceneGraph::Camera& camera) override { - PYBIND11_OVERLOAD_PURE_NAME( - void, - PyDrawable, - "draw", - draw, - transformationMatrix, - camera - ); + py::gil_scoped_acquire gil; + py::function override = py::get_override(static_cast(this), "draw"); + if(!override) { + py::pybind11_fail("Tried to call pure virtual function \"PyDrawable::draw\""); + } + override(transformationMatrix, + py::cast(&camera, py::return_value_policy::reference)); } };