test.py 820 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import Blender
  2. def PrintMatR( matrix ):
  3. for i in range(0, 4):
  4. print "[",
  5. for j in range(0, 4):
  6. f = round( matrix[j][i], 5)
  7. if f >= 0 :
  8. print " %04f" % f,
  9. else:
  10. print "%04f" % f,
  11. print "]"
  12. print "\n\n----"
  13. obj = Blender.Object.GetSelected()[0]
  14. arm = obj.getData(0,1)
  15. act = obj.getAction()
  16. ipo = act.getAllChannelIpos()["down"]
  17. print ipo.curves
  18. print ipo.curves[5].__getitem__(3)
  19. print
  20. kframes = obj.getAction().getFrameNumbers()
  21. print kframes
  22. for frame in kframes:
  23. Blender.Set( "curframe", frame )
  24. Blender.Redraw()
  25. pb_names = obj.getPose().bones.keys()
  26. for pb_nam in pb_names:
  27. pb = obj.getPose().bones[ pb_nam ]
  28. if pb_nam == "up":
  29. print "HEAD ", pb.head
  30. print "TAIL ", pb.tail
  31. print
  32. PrintMatR( pb.localMatrix )
  33. print