help with simple KF animation

Hi All,
I want to rotate the cube around the sphere. See white line path. I set the 3d cursor to the Sphere’s center. I then set the cube object to the sphere’s cursor (see pic note) But upon Kfing the animation although when using the command “R” rotate “Z” on Z axis mouse moves as desired. But when KFing I do the same move move cursor down time line to desired spot. I get my cube spinning on it’s axis as noted in orange.
Why or how do I instruct the Kfing to follow what I did with my mouse?

I tried to use “I” for location and rotation, then seprately. When using location too, I get a cube that moves straight across instead of half way around the sphere as I did with “R” and “Z” and mouse move…


Yep that is how it works, keyframe object ALWAYS rotate around their own axes, unless someone wants to prove me wrong… - tomorrow I will post you a driver to make the cube orbit around the sphere, if you can’t wait, you need to use a sine/cosine driver based upon the centre location of the sphere and the radius to the cube - sorry been out on the vino tonight, just a little bit sozzled and need some sleep. But I do know how to do this…

Cheers. Clock.

Awesome I will wait for the magic man. Thanks appreciate the head up. I always think it is me doing something wrong but once in a while…you need to restart Blender, or have a good Samaritan write code to make it happen. Thanks again
NC

Being Blender there are of course many ways - three in the enclosed blend file:

sphere-cube.blend (613 KB)

They are:

Using positional Drivers so the cube itself does not rotate. (you could of course make it rotate on its own axis, the other way with a separate driver!
Using an Armature and single bone, cube itself rotates.
Using a parented empty, cube itself rotates.

To see the drivers go to Graph Editor and select Driver Mode. To see the animation, press Play (ALT-A). The drivers are based upon doing one complete revolution every 180 frames and take the form " ((frame-1) * pi )/ 90 " without the quotes, rotations in Drivers are in Radians (there are 2 * pi radians in one revolution), so we use the pi function to get to degrees, so in this case the object would rotate 1/2 turn in 90 frames. To make it go faster, simply reduce the 90 figure. Hope this all makes sense.

If you have any questions, let me know here and I’ll try to answer them.

Cheers. Clock.

PS. I forgot to say, with the first method the scripted driver expression for Z position is: " sphere_z + (cos((frame-1) * pi / 90) * 4) " the 4 figure is the distance of the cube from the sphere, and sphere_z is a Transform Space variable based on the Z position of the sphere. The scripted driver expression for X position is: " sphere_x + (sin((frame-1) * pi / 90) * 4) ", sphere_x is the X position of the sphere. The sub-section; (frame-1), is used so the cube is at 0 degrees rotation, or 0 axis offset, on frame 1 of the animation. Strictly of course this means that the animation should stop at frame 361 not 360 so it does a complete set of revolutions - but that’s just me being a bit picky with myself!

Thanks Clock, Downloading now and will play with it. Humbling the math and those (like you) who just explain it like you are pulling a can of soup of the shelf, opening it and warming it up. Thank you for the time you took to share this with me. Math scares me off a bit. I do like the idea of using an empty to parent the object to, and then move it around as desired. Prob because I have already have done both previously.

You don’t have to understand it - just mimic it. It’s easy to copy and paste the driver from one location to another - just RMB the purple variable, like X-Rotation ,for example and select Copy Driver, the RMB another object’s variable and select Paste Driver. To speed it up just change the 90 bit to something smaller, or sort to slow it down use a bigger. number. You can always pose your problem here and I can do the maths.

Cheers. Clock.

Clock,
Right got it on the cut and paste. that is how I learned HTML. LOL that is an expression you created as I use them in After Effects. Not that I know what each icon or value means… But you did share with what they are here. Thank you.
I am not getting any animation on the blend file you sent?
I have used play and tried ALT+“A” to start it. Selected each object and hit play but not seeing any rotation?


Did you enable “Auto run Python Scripts” in User Preferences first?


That would be a big Negative there Clock. I will do that.
How to diffuse a Bomb
Cut the yellow wire, blue wire and then the black wire. You will see a mercury switch hooked to a battery. At this point you can now disconnect the battery. But do not cut the other wires before cutting the red wire though…LOL!
Thanks man appreciate the time you shared.

You’re welcome and I hope the helped you solve your problem. I meant what I said about the maths, I actually enjoy this aspect of modelling…:yes:

Just so you know - scripted expressions require this option to be activated - weird but true.