diff --git a/setpath.sh b/setpath.sh index 08d93218..b7e3a9c6 100755 --- a/setpath.sh +++ b/setpath.sh @@ -7,6 +7,16 @@ # source setpath.sh for Zsh or Bash # +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + echo "The setpath.sh script must be sourced, not executed. In other words, run\n" + echo "$ source setpath.sh\n" + echo "If you wish to use the Mitsuba Python bindings, you should also specify" + echo "your Python version /before/ sourcing setpath.sh, e.g.\n" + echo "$ export MITSUBA_PYVER=3.3" + echo "$ source setpath.sh" + exit 0 +fi + if [ "$BASH_VERSION" ]; then MITSUBA_DIR=$(dirname "$BASH_SOURCE") export MITSUBA_DIR=$(builtin cd "$MITSUBA_DIR"; builtin pwd) diff --git a/src/libpython/render.cpp b/src/libpython/render.cpp index 3f718c9a..80fdadb3 100644 --- a/src/libpython/render.cpp +++ b/src/libpython/render.cpp @@ -75,7 +75,11 @@ static bp::tuple shape_getNormalDerivative(const Shape *shape, const Intersectio return bp::make_tuple(dpdu, dpdv); } -static ref loadScene(const fs::path &filename, const StringMap ¶ms) { +static ref loadScene1(const fs::path &filename) { + return SceneHandler::loadScene(filename); +} + +static ref loadScene2(const fs::path &filename, const StringMap ¶ms) { SceneHandler::ParameterMap pmap; for (StringMap::const_iterator it = params.begin(); it != params.end(); ++it) pmap[it->first]=it->second; @@ -256,7 +260,8 @@ void export_render() { .def("request2DArray", &Sampler::request2DArray); bp::class_("SceneHandler", bp::no_init) - .def("loadScene", &loadScene, BP_RETURN_VALUE) + .def("loadScene", &loadScene1, BP_RETURN_VALUE) + .def("loadScene", &loadScene2, BP_RETURN_VALUE) .staticmethod("loadScene"); BP_CLASS(RenderJob, Thread, (bp::init()))