So i have started learning unreal and imported my first character to work in the game with texture expressions using Drivers
Right now i have made my Eye Bone Driver to move 0.5 on the x axis from Frame 22 to 23 to skip to the next expression image,
So in blender i can see It as a Snap
While in unreal from frame 22 to 23 the Bone transitions smoothly,
which causes my texture expression to scroll to another image instead of change immediately
As i noticed in the timeline , Unreal timeline plays in Float values and not integer, causing the sudden movement to seem otherwise smooth
I tried interpolating the animation curve for the bone drivers to be Constant in Blender, but it still transitions smoothly
What?
this is nuts.
don’t get me wrong, its also kinda cool but sort of very pointless.
First thing first, you have a very simple model. there is really no reason to make such a complex rig with the eye blink for what is essentially a texture swap.
If you are trying to do other things with it - maybe. But even then you would be better off working with Morph Targets for facial expressions so they can be completely separate from any animation and added in as simple curves.
As far as blinking goes.
adding a material sot for the eye is probably cheaper than adding a bone to the skeletal mesh. (Extra draw call vs a skin computation and and extra bone).
Or using a texture atlas which I think is a mix of what you are saying you are doing now.
Regardless of this, you can probably fix the issue of scrolling by flooring or ceiling the scalar value for the UV before use within the material.
if the idea is to move it in full pixel steps you may have to do some more work, but if you have .5 and you need a full 1, then using a Ceil node will do just that.
Personally, because the model is low poly, and because of the extreme simplicity of it, I would look into using different decals for the eye expressions.
animating a decal is bound to be cheaper then the bone on the mesh overall. Even if it is at least one extra draw call.
The benefit of the decal is that you can move it, rotate it, and animate it complete separate. Also the background color of the eye can be changed on the fly without having to mess with multiple materials.
If, on the other hand, you are not using a decal or texture, and the eye is somehow skinned - which is nuts because that’s literally a ton of tris on an otherwise low poly model but whatever.
Then the interpolation between blender and unreal is completely different. Bone tracks in unreal are always made “fluid” because of the way the engine steps from frame rate to framerate.
That is: the bone track value between 2 frames is always decimal if the frame before and after value are different integers.
To work around that you may be able to force the value to he more then. 5 quicker by giving the frame after a bigger integer value. This will however overshoot the eye blink probably so it’s not really a solution…
Hey, thanks for responding,
I did not know this kind of rig would be complex,
essentially this is a Morph Target that is Driven by the Bone Controller that changes the Uv Coordinates of the Eye texture
I tried this system as every other little resource i find here and there show how to animate the Texture in Unreal instead of in the 3d Software, making adding more blueprints, Notifs etc
Yes the eye expressions are a Texture atlas and is a Separate material , and is just 2 Planes of a mesh.
The problem arose as u stated, is when unreals transitions into decimal value from one frame to the other , instead of an integer value, like every other 3d software, causing a fast Scroll effect instead of a Snap, even if i make the interpolation curve of the bones into a constant Curve in blender and export to unreal, it still gives a smooth transition effect between every frame
the only other solution i found is to not animate the eye bone in blender, and animate in unreal and change the curve between the frames to constant in the anim sequence track, defeating the purpose of a smoother blender workflow.
The most easiest solution would be for me is that if there was a way to make unreals animation flow in integers and not in decimals, if there’s no way around this, then i would probably try to use blueprints to detect if the Bone is between the value of 0.4 to 0.6 and texture swap instead of using atlases, so animating using atlas in blender but assigning separate textures in unreal to swap when the bone has reached certain value. The only problem there is when i do get socket location, it gives the world location value and not Local value , so i dunno how to get that for now
With the curve you can change the value to scale in steps like you want.
the morph target will be what you end up using to move the material.
Anim-curves can specifically be used to power materials so this should work out of the box for you in a 1:1 fashion even it it’s not as inventive as your approach.
the only way you could change how the animation interpolated in UE4 is to edit the source and change that - afaik. I doubt there is a setting of some kind to do otherwise.
However if you are taking the bone curve value and using it in a material currently, ceil on the material input or before you pass it along may just work for ya.
I just think you’ll have a much easier time with simple morphs/anim curves. Particularly because you can edit both in the blender file and within the engine if you don’t feel like updating the blender file.
Btw you can put the value in local by subtracting the actor location from it.
World LOC - actor LOC is always a local coordinate to the actor.
But you are literally just adding complexity over something that should be pretty simple…