Vertex Animation Script for Blender 3D Users

Forgive me but I’m very new to Blender but saw that this want something that would work great for me. The problem I keep getting is that the offset is a solid black bar most of the time. I’m not sure what I’m doing wrong but I do have a mesh that transforms into another shape over the course of several keyframes.
Several questions i have would be:
Do I use shape keys to make the different shapes of the mesh?

Do I use have to set keyframes for the time?

If I use shape keys do I select just the one object I have all the shape keys on when I hit the Process Anim Meshes?

If I don’t have to use Shape keys can I just have copied the mesh several times and changed each one for the different frames?

After all that I found that after running through this and the doc that’s listed I get a un-moving material. Any help would be appreciated.

If you’re using shape keys to animate your mesh or meshes, but using the vertex animation script (talking about an offset texture I’m assuming so) yes you definitely need to set key frames the mesh needs to be animated. The script will look at the difference in vertex positions from their original position which is stored in the texture. If you’re getting a black texture there would be no movement. No color means vertices are not being offset.

Hi,

I tried to utilize your script but failed:

1, I need to bake vertex animation but preserve the object’s pivot point. Your script just applies all transforms and creates duplicate mesh with pivot in the world origin.

2, Your script duplicates target object and gives it wonky name. So name based export pipeline won’t work.

3, Your script just straight up destroys UV Map channel 2 if there’s some existing, without even asking.

Even with these unacceptable limitations I still at least wanted to try if it works, so I followed the guide (both yours and UE4 docs one) to the letter, but the mesh came in completely wrecked:


How it should look for comparison:

And the morph animation value then just spins around the broken normals, while vertex positions don’t move at all.

The problem occurred for me when using the 0.01 metric unit scale in Blender (as required by the script), then scaling up the mesh in the Blender export again (by 100).

[edit] To fix it, I have to use a scaling of 1,1,1 for the ISMs. In the MS_VertexAnimationTools_MorphTargets function in the material I multiplied the WPO output by 100 to offset the 0.01 scaling. There has to be a cleaner solution tho.
image

1 Like

If you only need flat shading, a solution I found is to use a DDX / DDY function to completely replace the normal texture.

Well, correction. The proper scale wasn’t the issue. Not sure what I was smoking.
In any case, I couldn’t find a fix. If anybody does, please ping me as well.

Hi folks!
Those tools work pretty well for me. Respect and prosper to authors!
One thing I can’t solve. Normals looking incorrect.
As you can see normals on animated mesh looking wrong. I’ve made all assets by guide from Epic Docs. All textures have proper settings. I’ve checked a lot of times.
But normals on mesh with VAT shader look too dark in comparison with simple static mesh.

upd: I did not use color management in Blender. (filmic etc)

Hi, thanks for converting this script Josh. I am able to use it in Blender 3.1.2. But if I use it with Geometry Nodes, I get the error “Objects with Nodes modifiers are not allowed!”. Is there a way to get the script to output from geometry nodes?

How were you able to use it in 3.12 or any versions? I’ve tried installing the addon but it won’t even show up. Do I need to have Unreal Tools as well? If so where would I even find it? it seems like all download locations are gone or broken.

Look like that script not works with a generate geometry. When count of vertex is changing.
So geometry must have unchanged topology during transformations.

For anyone struggling to figure this out in 2022, watch this video blender vertex animation texture unreal engine - YouTube by
Ash Oakenfold. Thank you very much!

2 Likes

I can´t get this to work in UE5.03. My static mesh flickers / flashes and turn invisible, even without any kind of material applied to it. Even in the UE5 mesh viewer. When it is selected in the viewport, the flickering stops (?) . Anybody else having problems with VAT in UE5?

I also recently tried to install this and found that the plugin simply didn’t show up in the list of plugins afterwards, and no side tab was visible. I’ll maybe dig in a bit deeper at some point, but for the time being here’s a jank workaround:

You can copy/paste the script contents into a text editor view in Blender, run the script manually, and it should work from there.

@Josh_Bogart Hi, thanks so much for making this script.

Is there any chance the 8192 vertex limit can be removed? as we now have nanite and wpo support in UE5.1?

Hope you are doing well.

Thanks

2 Likes

you can update the script and update the material:
currently vertices are stored in one line, texture limit is 8k x 8k, so you have limit in 8192 vertices. but you can store vertices in 2-3-4-or-more lines. After that you will have a new limit of 8k height :wink:

1 Like

@BerdVlad Hi, I am trying what you said but I am not too sure how to go about doing it.

I can update the script by removing the 8192 limit or increasing the number and Blender creates the texture with a higher number but doesn’t work in ue5 as it seems ue5 vertex animation node is also capped at 8192.

I am not sure how to setup the script to ‘‘store vertices in 2-3-4-or-more lines’’. Also how do you update the ue5 material? :slightly_smiling_face:

I did the same for my goal:
write a custom python script that writes values to 1+ lines. as a result i got textute 8192xN
In Unreal create a material that scales the texcords according to the number of lines per deformation (I store many deformations in one texture)

In a Python script, you need to write all the values into a single list, and then write that list into a texture (since technically a texture is also a list of values)
But remember that the values in the texture are written/stored from the bottom left corner to the top right corner, and the step for each pixel of the texture is equal to 4 elements of the list (since 0 is R, 1 is G, 2 is B, 3 is A)

Is it possible to use this with cloth? The plugin warns me that cloth is not allowed, I tried exporting my cloth to alembic and the plugin warns me that mesh sequence caches are not allowed either

So I made some modifications to the script and was able to export meshes animated with the cloth and collision modifiers like I needed, I’m not sure why not all modifiers are allowed by default?

1 Like

I apologize, when I first wrote the script I was a bit heavy handed when I ruled out modifiers. I didn’t allow any I thought might change vertex order or count.