A user asked:
I want to create a simple expression that will rotate an object based on the current time.
Answer:
You can assign a Float Script Controller to the respective rotation sub-controller and use the currentTime global variable to get the time.
For example,
if you want to rotate the object about its X axis, you should assign a Float Script controller to the .rotation.x_rotation.controller property:
obj = Teapot()
obj.rotation.x_rotation.controller = Float_Script()
obj.rotation.x_rotation.controller.script = "currentTime"
This will rotate the object, but the rotation will be very fast because the time value is taken as radians, causing a full 360 degrees rotation every 6.28 frames!
To take the time as degrees,
you can use
obj.rotation.x_rotation.controller.script = "degToRad currentTime"
This will rotate the object 360 degrees in 360 frames. You can of course multiply the result by any factor to control the exact speed,