Revision: 6115 http://sourceforge.net/p/smartbody/code/6115 Author: arishapiro Date: 2015-06-18 21:45:39 +0000 (Thu, 18 Jun 2015) Log Message: ----------- Added SBInterfaceListener interface to allow snippet of Python code to be written that responds to mouse and keyboard clicks. Functions include: onMouseClick(), onMouseRelease(), onMouseDrag(), onMouseMove(), onKeyboardPress(), onKeyboardRelease() Also, added two functions with the SBInterfaceManager: SrVec convertScreenSpaceTo3D(int x, int y, SrVec ground, SrVec upVector); std::string getSelectedObject(); Will likely add more interface functions as needed.
Sample code snippet for writing Python interfaces: import GUIInterface class test(GUIInterface.SBInterfaceListener): def onMouseClick(self, x,y,button): print str(x) + " " + str(y) + " " + str(button) return False t = test() m = GUIInterface.getInterfaceManager() m.addInterfaceListener(t) Modified Paths: -------------- trunk/core/smartbody/sbgui/src/RootWindow.cxx trunk/core/smartbody/sbgui/src/fltk_viewer.cpp trunk/core/smartbody/sbgui/src/pythonbind/SBPythonAutoRig.h trunk/core/smartbody/sbgui/src/pythonbind/SBPythonAutorig.cpp trunk/core/smartbody/sbgui/src/sbm_main.cpp trunk/core/smartbody/sbgui/visualc9/sbgui.vcxproj trunk/core/smartbody/sbgui/visualc9/sbgui.vcxproj.filters Added Paths: ----------- trunk/core/smartbody/sbgui/src/SBInterfaceListener.cpp trunk/core/smartbody/sbgui/src/SBInterfaceListener.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ _______________________________________________ Smartbody-svn mailing list Smartbody-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/smartbody-svn