diff --git a/doc/python.tex b/doc/python.tex index 775c1c3e..27e4bad3 100644 --- a/doc/python.tex +++ b/doc/python.tex @@ -1,14 +1,21 @@ \section{Python integration} \label{sec:python} -A recent feature of Mitsuba is a simple Python interface to the renderer API. +A recent feature of Mitsuba is a Python interface to the renderer API. While the interface is still limited at this point, it can already be used for many useful purposes. To access the API, start your Python interpreter and enter \begin{python} import mitsuba \end{python} +\paragraph{Mac OS:} For this to work on MacOS X, you will first have to run the ``\emph{Apple Menu}$\to$\emph{Command-line access}'' menu item from within Mitsuba. +In the unlikely case that you run into shared library loading issues (this is +taken care of by default), you may have to set the \code{LD\_LIBRARY\_PATH} +environment variable before starting Python so that it points to where the +Mitsuba libraries are installed (e.g. the \code{Mitsuba.app/Contents/Frameworks} +directory). +\paragraph{Windows and Linux:} On Windows and \emph{non-packaged} Linux builds, you may have to explicitly specify the required extension search path before issuing the \code{import} command, e.g.: \begin{python} @@ -29,6 +36,9 @@ os.environ['PATH'] = 'path-to-mitsuba-directory' + os.pathsep + os.environ['PATH import mitsuba \end{python} +In rare cases when running on Linux, it may also be necessary to set the +\code{LD\_LIBRARY\_PATH} environment variable before starting Python so that it +points to where the Mitsuba core libraries are installed. For an overview of the currently exposed API subset, please refer to the following page: \url{http://www.mitsuba-renderer.org/api/group__libpython.html}. @@ -64,8 +74,8 @@ classes, function, or entire namespaces when running an interactive Python shell ... \end{shell} The docstrings list the currently exported functionality, as well as C++ and Python signatures, but they -don't document what these functions actually do. The web API documentation is the preferred source for -this information. +don't document what these functions actually do. The web API documentation is +the preferred source of this information. \subsection{Basics} Generally, the Python API tries to mimic the C++ API as closely as possible. diff --git a/src/mtsgui/mainwindow.cpp b/src/mtsgui/mainwindow.cpp index f983982c..716848c0 100644 --- a/src/mtsgui/mainwindow.cpp +++ b/src/mtsgui/mainwindow.cpp @@ -1593,7 +1593,7 @@ void MainWindow::on_actionStartServer_triggered() { void MainWindow::on_actionEnableCommandLine_triggered() { if (QMessageBox::question(this, tr("Enable command line access"), - tr("
If you proceed, Mitsuba will create symbolic links in /usr/bin and /Library/Python/{2.6,2.7}/site-packages, " + tr("
If you proceed, Mitsuba will create symbolic links in /usr/bin and /Library/Python/{2.6,2.7}/site-packages, as well as an entry in .bashrc, " "which enable command line and Python usage. Note that you will have to " "repeat this process every time the Mitsuba application is moved.
" "Create links?
"), diff --git a/src/mtsgui/symlinks_auth.cpp b/src/mtsgui/symlinks_auth.cpp index 13f6fe37..a0bf914b 100644 --- a/src/mtsgui/symlinks_auth.cpp +++ b/src/mtsgui/symlinks_auth.cpp @@ -4,6 +4,7 @@ #include