\

\section{Sofa "PythonScriptController" component}

\subsection{Example scene}
\begin{code_bash}
runSofa applications/plugins/SofaPython/examples/ExampleController.scn
\end{code_bash}

\subsection{Component data}
\begin{itemize}
\item \textcode{filename} is the name of the .py script file.
\item \textcode{classname} is the name of the class in the script to instanciate for the controller. NOTE: the class MUST inherit from \textcode{Sofa.PythonScriptController}. See example files.
\end{itemize}

\subsection{Python script entry points}

\begin{itemize}
\item \textcode{onKeyPressed(self,c)}
\item \textcode{onKeyReleased(self,c)}
\item \textcode{onLoaded(self,node)}
\item \textcode{onMouseButtonLeft(self,mouseX,mouseY,isPressed)}
\item \textcode{onMouseButtonRight(self,mouseX,mouseY,isPressed)}
\item \textcode{onMouseButtonMiddle(self,mouseX,mouseY,isPressed)}
\item \textcode{onMouseWheel(self,mouseX,mouseY,wheelDelta)}
\item \textcode{onGUIEvent(self,strControlID,valueName,strValue)}
\item \textcode{onBeginAnimationStep(self,deltaTime)}
\item \textcode{onEndAnimationStep(self,deltaTime)}
\item \textcode{onScriptEvent(self,senderNode, eventName, data)}
\item \textcode{createGraph(self,node)}
\item \textcode{initGraph(self,node)}
\item \textcode{bwdInitGraph(self,node)}
\item \textcode{storeResetState(self)}
\item \textcode{reset(self)}
\item \textcode{cleanup(self)}
\end{itemize}


