def test_point2Joint_Motion(): mmFilePath = '../samples/physics2_WalkSameSame01.mm' pointMotion = yf.readMMFile(mmFilePath) frameTime = 1. / 30. pointMotion[0].pointMap['lFoot'][1] -= 0.1 # pointMotion = pointMotion[0:1] jointMotion = point2Joint_Motion(pointMotion, 'root') pointMotion2 = joint2Point_Motion(jointMotion) print 'pointMotion.skeleton', pointMotion[0].skeleton.links print pointMotion[0].pointMap.keys() print 'jointMotion.skeleton', jointMotion[0].skeleton.joints.keys() print 'pointMotion2.skeleton', pointMotion2[0].skeleton.links print pointMotion2[0].pointMap.keys() motionSystem = ym.MotionSystem() motionSystem.addMotion(pointMotion) motionSystem.addMotion(jointMotion) renderers = [] # renderers.append(yr.PointMotionRenderer(pointMotion)) renderers.append(yr.PointMotionRenderer(pointMotion2)) renderers.append( yr.JointMotionRenderer(jointMotion, (0, 255, 0), yr.LINK_LINE)) viewer = yv.Viewer2(100, 100, 800, 650, None, motionSystem, renderers) viewer.startTimer(frameTime) viewer.show() Fl.run()
def test_point2Joint_Motion(): mmFilePath = '../samples/physics2_WalkSameSame01.mm' pointMotion = yf.readMMFile(mmFilePath) frameTime = 1./30. pointMotion[0].pointMap['lFoot'][1] -= 0.1 # pointMotion = pointMotion[0:1] jointMotion = point2Joint_Motion(pointMotion, 'root') pointMotion2 = joint2Point_Motion(jointMotion) print 'pointMotion.skeleton', pointMotion[0].skeleton.links print pointMotion[0].pointMap.keys() print 'jointMotion.skeleton', jointMotion[0].skeleton.joints.keys() print 'pointMotion2.skeleton', pointMotion2[0].skeleton.links print pointMotion2[0].pointMap.keys() motionSystem = ym.MotionSystem() motionSystem.addMotion(pointMotion) motionSystem.addMotion(jointMotion) renderers = [] # renderers.append(yr.PointMotionRenderer(pointMotion)) renderers.append(yr.PointMotionRenderer(pointMotion2)) renderers.append(yr.JointMotionRenderer(jointMotion, (0,255,0), yr.LINK_LINE)) viewer = yv.Viewer2(100, 100, 800, 650, None, motionSystem, renderers) viewer.startTimer(frameTime) viewer.show() Fl.run()
def test_MotionViewer(): import Motion.ysMotion as ym import Resource.ysMotionLoader as yf import Renderer.ysRenderer as yr mmFilePath = '../samples/physics2_WalkSameSame01.mm' pointMotion = yf.readMMFile(mmFilePath) frameTime = 1. / 30. motionSystem = ym.MotionSystem() motionSystem.addMotion(pointMotion) renderers = [] renderers.append(yr.PointMotionRenderer(pointMotion)) viewer = MotionViewer(100, 100, 600, 400) # viewer = Viewer(100, 100, 800, 650, motionSystem, renderers) viewer.startTimer(frameTime) viewer.show() Fl.run()
def test_MotionViewer(): import Motion.ysMotion as ym import Resource.ysMotionLoader as yf import Renderer.ysRenderer as yr mmFilePath = '../samples/physics2_WalkSameSame01.mm' pointMotion = yf.readMMFile(mmFilePath) frameTime = 1./30. motionSystem = ym.MotionSystem() motionSystem.addMotion(pointMotion) renderers = [] renderers.append(yr.PointMotionRenderer(pointMotion)) viewer = MotionViewer(100,100,600,400) # viewer = Viewer(100, 100, 800, 650, motionSystem, renderers) viewer.startTimer(frameTime) viewer.show() Fl.run()