Notifications
Clear all

[Closed] Read information about rotation of bones

Hi

I'm trying to write script which help me work on animation. I can read and get information about where is rotation key controller but I can't get rotation of my specific bone.

Here is me code


    for k in $.rotation.controller.keys do
      (
      print k
      format "sliderTime = "
      print k.time
    	format "$.rotation.angle = "
    	format "
"
    	format "$.rotation.axis = "
    	  format "
"
    	  format "
"
      )
    

and this is what is display in my listener


   #Euler XYZ key(1 @ 0f)
   sliderTime = 0f
   $.rotation.angle = 
   $.rotation.axis = 
   
   #Euler XYZ key(2 @ 6f)
   sliderTime = 6f
   $.rotation.angle = 
   $.rotation.axis = 
   
   #Euler XYZ key(3 @ 12f)
   sliderTime = 12f
   $.rotation.angle = 
   $.rotation.axis = 
   
   #Euler XYZ key(4 @ 18f)
   sliderTime = 18f
   $.rotation.angle = 
   $.rotation.axis = 
   

As I said I don’t know how I can get/read/display information of rotation angle and axis of these keyframes where are rotation keys controller – $ is my select bone.

So maybe can help me with that

2 Replies

component controllers (like Position_XYZ, Euler_XYZ, etc.) have keys but their keys don’t have a value. so some way to get it is:

for k in $.rotation.controller.keys do
 (
 	at time k.time 
 	(
 		rot = $.rotation
 		format "time:% rotation:% (angle:%, axis:%)
" k.time rot rot.angle rot.axis
 	)
 ) 

Wow nice. That is what I wanted

Thank you very much