Revision: 5788 http://sourceforge.net/p/smartbody/code/5788 Author: arishapiro Date: 2014-08-18 06:24:18 +0000 (Mon, 18 Aug 2014) Log Message: ----------- Added a scriptable controller that allows read/write access to channel data. Here's some sample code:
I've added a scriptable controller interface that will let you put the logic that exists in the Maya rig into SmartBody. Here is some sample Python code that opens the mouth every time the eye blinks: --------------------------------------------- # create a controller class MyController (PythonController): def init(self, pawn): # indicate which channels are going to be affected by this controller self.addChannel("au_45_left", "XPos") self.addChannel("open", "XPos") def evaluate(self): # every time step, get the value from one channel and then modify another val = self.getChannelValue("au_45_left") self.setChannelValue("open", val) # instantiate this controller once for each character myc = MyController() # get the character character = scene.getCharacter("ChrBrad") # run this controller in position 15 (I can explain more about this) character.addController(15, myc) # you can enable/disable the controller like this: #myc.setIgnore(True) Modified Paths: -------------- trunk/core/smartbody/SmartBody/src/controllers/me_controller.cpp trunk/core/smartbody/SmartBody/src/controllers/me_controller.h trunk/core/smartbody/SmartBody/src/sb/SBCharacter.cpp trunk/core/smartbody/SmartBody/src/sb/SBCharacter.h trunk/core/smartbody/SmartBody/src/sb/SBController.cpp trunk/core/smartbody/SmartBody/src/sb/SBController.h trunk/core/smartbody/SmartBody/src/sb/SBPython.cpp trunk/core/smartbody/SmartBody/src/sb/SBPythonCharacter.cpp trunk/core/smartbody/SmartBody/src/sb/SBVersion.hpp 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