The adventures of Piston - a devlog if you will

Chapter 1: Epiphany

It all starts with an idea: “Hey, it would be cool if ”

So in a very similar fashion, I decided to animate a piston and add into UEFN so I can test Blender animations and educate myself on the workflow, but oh boy did I know where I was getting (or rather falling) into. It will easy they said. It will be fun they said.

So, I started by building the mesh. That part was relatively easy. Model with 7 different parts, a base that allows space for the rotation to take place, a couple of little notches to give depth to the piston head, and the interior part of the piston which I didn’t know was shaped like that (had to look up a couple pistons out there)

So far, so good. Now, on to the fun part! Animating!

I 've never animated in Blender before, so I had no idea what to do or where to start.
So I googled Piston animation and found a cool guy that had a similar piston to me, and showed how you can create “object constraints” to animate something based on “rules” you can set the object to follow. Some examples are setting the piston base as the parent
of the base bolts, or limiting the left or right the piston head can move, so it can only move up and down. Pretty fun stuff, the possibilities with these are endless when making mechanical parts.

At the end, object constraints allowed me to end up with a fully working piston, that only required the “rotator” to turn and activate the full thing:

blender_WOp7WQhh6w

Perfect! Now I had the model, the animation, and set the material slots that I will use in our UEFN game. Alright, time for export!

chrome_2sV7WUpp0j

What is this? I will just ignore all these settings, UEFN knows better than me, I guess they ll get it right. Right?

Alright, it imported! I even see my materials (that doesn’t always happen mind you).

Alright, cool. How do we see animations? Where is the animation?

As I was wondering that, the ground beneath me started to vibrate and crumble. A low rumble earthly sound could be heard. Dust started rising. The rabbit hole was opening.

Chapter 2: Cacophony

The animation was nowhere to be found. I searched all over the place in UEFN, but nothing. Step 2 was to look it up, see what others on the internets are fiddling with. Strange, no mention of mechanical animations; everything is about humanoid models or limbs. Hmm, let’s start with the basics then:
My goal is to make an animation from Blender and send it to UEFN. Cool, let’s start with the animation then.

Turned out it was pretty easy. I set the rotator in 4 different parts clockwise and that made the rest follow perfectly:

Cool, now let’s save that and send to UEFN. Export again, make sure you get the right animation options enabled, good to go!

This time I am more prepared! I know I have to enable “Skeletal mesh” so “import animations” show, yay. Let’s do that.

Blip.

Bunch of cool stuff imported. Only I have no clue what to do with those (+ still no animation, huh?). Why are they broken down now, hmm.

UnrealEditorFortnite-Win64-Shipping_dBnFGKJ524

Don’t mind me, I ll just enable “Combine meshes”. Right? RIGHT?

That setting doesn’t exist if I enable skeleton import. But if I don’t, I don’t get an animation import (?). But hey, at least I got a can opener out of it.

Alright, cool. There has to be a way. How does all this cool machinery out there get made? I am probably really close.

Back to Blender. Let me google how to import from Blender to Unreal an animation. More human hands. Why is always human hands? Oh wait, this guy said “…object constraints from Blender are not supported in Unreal Engine…”

chrome_2evJ1fmMum

Well, that sucks. How am I going to do this then?

While my body was still falling at the endless newly found pit that emerged below my feet, I thought to myself “What if the animation didn’t contain any object constraints, but instead had the motion keyframes?”

That’s gotta be it! And with a swift turn I turned into the falling computer again and start clicking things. Google is my friend in this falling times “How to make an animation into keyframes Blender plz halp”. Alright, this girl said something about baking the animation, sounds like what I need! Let’s do that.

chrome_XGbOY2PeLu
(probably wrong use of this meme, but hey)

Oh what is this? An endless sea of keyframes I see

Leeeet’s import to UEFN again and se…

z057Fc305u

chrome_JXkeRDESzQ

At this point, I am being trolled. Where do I even begin? The fact that this is 347437242370 files long, or the fact that each animation… wait, is that an animation? Hey I imported animations in UEFN from Blender! I DID IT!!!

They look… uhmm
UnrealEditorFortnite-Win64-Shipping_OvTPjmVMlv
UnrealEditorFortnite-Win64-Shipping_I0CzzbKCBI
UnrealEditorFortnite-Win64-Shipping_m1O1SGwOda
UnrealEditorFortnite-Win64-Shipping_pkkurRCSQG

OK then.
UnrealEditorFortnite-Win64-Shipping_VnHIawKgyv

Goodbye devil spawn.

Chapter 3: Epiphany

I then decided to make rotating cogs using the sequencer.

Moral of the Story (Press me)

Moral of the story: Animating pistons will allow you to make cool rotating cogs.

Great stuff.

4 Likes

Unfortunately, I’m not able to help with the blender side of things, but I’ll share a test I did with Maya.

Maya
In Maya, I created a small hierarchy of the piston:

Animating the second box results in this motion
maya_2022-11-03_11-08-40

Here are the FBX Export settings I used from Maya:

Going into Unreal
Here are the FBX Import settings I used in UEFN:

  1. These settings will treat the mesh hierarchy as a Bone hierarchy, and treat the animation on the mesh as bone animation
  2. Setting the Skeleton to None will tell UE to create a new skeleton
  3. Import the Meshes inside the hierarchy
  4. Import the Animation onto the newly-created Skeleton

Resulting imported files:
image

Opening the animation in UE:
piston_ue

Another way – Control Rig
To go another direction, here is what a similar setup would look like using Control Rig in Unreal.

2 Likes