How can I animate an engine?

Hello,
i tried to do ad you said i disconnected my cam from gears just to see is it working properly so i diectly used copyrotation constraint on cam shaft my camshaft is in form of lots of different objects and all of them are parented with front object near to gear so i copied rotation and made it invert and influence to 0.5 but still it is having same problem, can you please take a look at my file i have put some rotation animation value just hit play and please let me know what is the issue.
https://drive.google.com/file/d/1i0LH_aQ9N6x8tbAJocPNURL1-yBsX44U/view?usp=sharing

It will open just fine in 2.92…just make sure to turn off load UI ( under the upper R gear icon) …I just opened it and all is fine…

2 Likes

Hey, Sorry for the delay. Do not use ‘Copy Rotation’ constraint on camshaft stuff (If I told you todo so, that is my mistake), as I said in earlier post, it will rotate it 180 degrees before it snaps back, if influence is set to anything other than 100 percent, USE driver for this.
I am posting this in regards to your previous file - but will apply to current also.
You have “Armature” object that has ‘un-applied’ scale and rotation = that must be applied first. You have “piston1ar, 2ar,3ar,4ar” as seperate armatures which is not good and ‘un-applied’ scale and rotation = that must be applied first. Select those 4 objects together then shift+select “Armature” > CTRL+J to join them, now all your bones are in 1 armature, you add bones in ‘EDIT’ mode.
You need ONE armature with multiple bones, not multiple armatures. PIC of how yours looks:


Turn OFF all IK constraints before this,
Now (Edit Mode) so your set-up looks good for the first and last cylinders, but #2 and #3 need to have the same bone lengths as #1 and #4, you can modify them or delete them and copy #1’s bones (Cyl, Piston and Rod only), the bones I call ‘Stroke’ are good. When you accomplish this you will have a gap between “Rod” bone and its “Stroke” bone on #2 and #3, the IK constraint will fix this. Name all bones appropriatly, Add “Crank” bone and re-position and duplicate it for the “Cam” bone and place, set ‘Bone Roll’ on both to global +Z (0). Select all “Stroke” bones then Shift+Select the “CrankShaft” bone > CTRL+P = Keep Offset. This will be it for ‘Edit’ mode, again add bones to your armature in ‘EDIT’ mode. PIC how it should look:

Now (Pose Mode) Select ALL bones and while holding down the ALT key, change your ‘rotation’ mode of your bones (bone tab) to ‘XYZ’ - there is no need for quaternion. Re-enable your IK’s, now the gap is gone between “Stroke” and “Rod” bone since you set up ‘stretch’ on the correct bone. Those bones(#_Cyl) will never get anything ‘parented’ to them. Add driver to camshaft bone ‘Y’ rotation to target CrankShaft ‘Y’ rotation - modify with Fcurve modifier or use scripted expression with [var/2]. Camshaft rotates at one half crankshaft speed.

1 Like

you can use a curve with a depth factor, with the “add curve extra objects” addon (bundled) there is a spiral option to make springs. Then by adding a shape key you can compress the spring by simply scaling all segments on the z axis.

1 Like

That is how I created the spring (I’m lazy, LoL) But the problem comes from scaling, which does just that to the object - That pic shows just how little the dimensions changed, I did the scaling thing then measured it - it was un-acceptable to me.

1 Like

I see the measurements, but you have lost me a bit was that difference intensional? If you leave the curve as a curve the depth factor should be constant even if you select all segments and scale on z.

No, probly my mistake or just one of those things, when I did it , I had came up with a formula and well there may have been a mistake or two. But back to the scaling on Z, it distorts the spring and shrinks the wire diameter.

1 Like

Not if you do the shape key on the curve vertices


The depth stays constant, I set it to 0.15

1 Like

YES, you are correct about that. My misunderstanding came about when you thru me a Curve, LoL really. My pic is of a mesh object - valve springs are ground flat on the ends so they can distribute its force equally - that is why I don’t choose the curve method.

1 Like

Hello,
Omg thank you this is very detailed definitely i will change these things and finally this is solved i can animate it properly, i was using drivers at first but it was snapping as you said and same was happening in copy rotation too. I don’t know why but this time using driver on my cam i choosed armeture rotating cam instead of crankshaft mesh and it’s working very well.

Thank you very much you really helped me out i really appreciate it. Thank you again :smiley:

No problem, I wanted to learn Blender to do just what your doing - some 15+ years ago.
As far as your newest file you posted goes:
On Armature.001.springbone set that stretch to constraint to 1.00 influence.
On Gear.012, the drivers expression should be [-var / 0.5] (divide) not [*] (multiply) - change that to fix the flipping.
Gear.008 The crankshaft - if you have a good look at it down its ‘X’ axis (Right Ortho) and rotate its ‘X’ value, you will see the wobble / out of round, it is. I tried a couple of quick fixes on it, but sadly it looks like its going to be much more involved to fix it - I suspect its due to the way your approaching modelling these parts, nothing wrong , but you MUST get in the habit of ‘Apply’ scale and rotation before parenting or even joining parts together, Curves are some what of the exception depending on the circumstance. As far as fixing the crankshaft, that’s up to you.
After that bad news, I just want to say your doing a great job over all, and good job on figuring out the drivers on the Gears - Let me know how else I can help you

1 Like

Thank you, if i devide var by 0.5 i think it will increase the speed so i should use devide by 2 right?
And i made my first animation with it today in evee of course, because i am using laptop and it’s not very high end it can’t even run gta san andreas smoothly :upside_down_face:,
I am very involved in engines and other mechanical things and i know about them and situation is extremely bad here in India so i was home quarantine and decided to download blender 17 days ago and in just 17 days i made working engine and that’s really huge for me, and i learned lots of things from here and youtube but i had to repeat it lots of time due to my weak English, finally now i will model engine again with good mesh and do all things as you mentioned. Thank you very much you are really kind, helping dumb like me in blender, thank you again i will come up with more problems in future because i am not gonna leave blender now. :slightly_smiling_face:

1 Like

I overlooked that detail!

Raj_Agravat You are doing very well welcome to the community. This is an interesting thread I have been reading it. I look forward to seeing your engines! :slight_smile:

Edit: I corrected my grammer!

1 Like

Yes, good catch

That is fantastic !! Nice job

1 Like

Thank you.