Revision: 2616
          http://smartbody.svn.sourceforge.net/smartbody/?rev=2616&view=rev
Author:   arishapiro
Date:     2011-11-10 20:38:13 +0000 (Thu, 10 Nov 2011)
Log Message:
-----------
Added ability to run arbitrary Python scripts in SmartBody, see SBScript class.
SBScene now has: addScript(), removeScript(), getNumScripts(), getScriptNames() 
functions

Usage example:

class MyScript(SBScript):
        
        def start(self):
                print "Starting MyScript..."
                
        def stop(self):
                print "Stopping MyScript..."
        
        def update(self, time):
                pawn = scene.getPawn("camera")
                x = sin(time)
                y = sin(time)
                x = x * 100
                y = y * 100
                pos = pawn.getPosition()
                pos.setData(0, x)
                pos.setData(1, y)

s = MyScript()
scene.addScript("test", s)

Modified Paths:
--------------
    trunk/core/smartbody/smartbody-lib/src/sbm/SBPython.cpp
    trunk/core/smartbody/smartbody-lib/src/sbm/SBScene.cpp
    trunk/core/smartbody/smartbody-lib/src/sbm/SBScene.h
    trunk/core/smartbody/smartbody-lib/src/sbm/SBSimulationManager.cpp
    trunk/core/smartbody/smartbody-lib/src/sbm/SBSimulationManager.h
    trunk/core/smartbody/smartbody-lib/src/sbm/mcontrol_util.cpp
    trunk/core/smartbody/smartbody-lib/src/sbm/time_regulator.cpp
    trunk/core/smartbody/smartbody-lib/src/sbm/time_regulator.h
    trunk/core/smartbody/smartbody-lib/visualc9/smartbody-lib.vcproj
    trunk/data/sbm-common/scripts/default-init.py

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Smartbody-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/smartbody-svn

Reply via email to