Vertex Animation Script for Blender 3D Users

No I would not use this method and this method alone to achieve an effect like you’re describing. I’m assuming this sort of effect would be some what complex. I would say it all really depends on the desired scale, style, and fidelity of the effect, as well as the role of the effect in your project.

I have a cube that animates a short distance along the y-axis, nothing complex. The normals have 8 colors (one for each vertex I assume). The animation works, but the shading is clearly wrong. Perhaps I missed a step? I think I have all the proper settings applied to the normal texture.

Make sure you have un-checked the “Tangent Space Normal” option in your materials’ details panel. Also did you export and import normals from blender with the mesh and if so what options did you choose. https://docs.unrealengine.com/Images…n_Normals.webp

hey! thanks a lot for this plugin, i am about to use this to create a butterfly effect for unreal, and i noticed that you advised we use mesh morpher. although i cannot figure out how we are supposed to use mesh morpher? Am i missing the documentation for this somwhere? how is it intended to be used?

Thanks again, I will proceed for now with vertex animations :slight_smile:

Hmm, something didnt work out for me. I thought I followed the steps very closely. No animations happening in unreal.

I suspect it might be something to do with my unreal config, which I’m going to keep working on but does this look right for the images generated by the plugin? I noticed that for some reason I did not get a “morphs” texture, but rather mine was called “offsets” - is that the same thing? its a vertex animation for an extremely simple 12 frame butterfly flapping animation.

Screenshot 2021-01-14 142802.png
Screenshot 2021-01-14 142817.png

Yes, I changed the named of the generated texture to offsets I thought it was more on the nose. The textures look right. It looks like you’re mesh has 10 vertices. Are you using the generated export mesh? The UVs in the images are not from the generated UV channel I can tell that at least. I would really need some screen shots of your mesh settings in Unreal and of your material setup.

[USER=“644194”]Josh Bogart[/USER] I know this is a big thing to ask but is there any chance you’ll consider porting the StaticMeshSkeletalAnimation (in Engine\Extras\3dsMaxScripts) maxscript? Jonathan Lindquist mentioned it was used for the beetles in the UE5 demo and the material side implementation is available in the Niagara content examples. I couldn’t find any documentation on it but from his description it seems to be able to more efficiently store data.

Regardless, thank you for taking the time to port the VertexAnimationTools script for us. Very grateful for that.

Rather interested in this myself now. I’m also curious as to how I can leverage UDIMs for this. I was advised Sub-UV might be a better option but if this 3dsm plugin is anything to go by, it might be what I am looking for.

This is amazing! I have a question, does the shader that handle the world position offset of the animation have any frame step interpolation? I mean the way Skeletal Animations have, where there is a blending between one frame and the other, and it works perfectly in situations where the display framerate is higher than of the animation (mainly in slow motion and higher monitor refresh rates)

Hi! I love your tool it’s really useful. I was wondering if there’s a reason that meshes with hard edges appear smoothed when using the generated normal texture? Is there a way around this? Or have I done something wrong? Thanks!

Edit: I tried it with another mesh and it seems that my normal output always looks a bit weird. I’m not sure if it’s the material function or the texture.

Weird shading:

It’s because the texture and the UVs I’m assuming. The UVs are set up so that the same normal is sampled for each vertex loop. Where in the case of hard edge shading each vertex in a loop would need a separate normal. So the easiest way to go about fixing the issue would be cut the geometry were you wanted a hard edge. It would increase your vertex count and therefore the size of the texture, but it’s the first thing that comes to mind. Although you wouldn’t be able to have complex shading this way. Like a smooth round corner into a flat face you see in a lot of hard surface models. Well you could using the data transfer modifier in blender maybe not sure. I believe there is a modifier that automatically cuts your mesh where there are creases that would do the trick as well.

Thank you for the reply :slight_smile: I’ll have a look at this. For the example I was working on, I just opted not to use the normal texture and it worked in this case. I suppose a case where this wouldn’t work is when I need both soft and hard edges? In which case, your suggestion would be best?

hey @Josh_Bogart , I’m trying your tool and it kinda works, but the result is a bit…weird. Do you know what could cause this issue? I’ve been checking all the settings mentioned and it seems correct. Thank you!!
vertex_animation_wip01|video
Edit: the left one is the vertex animation version, right one is the skeletal mesh from Mixamo.

Quick update: it looks like it depends on the source mesh, I tried with different meshes, and some work, some don’t. Still investigating.

Edit: never mind, I tried to re-export the original mesh that had an issue, and it seems to work. No idea what went wrong…

You are a god send bro. Thanks for being a cool person!

can’t seem to get this to work, i think it’s on the blender end of things? i did an export and ran it in a trial demo of 3dsmax and it did end up working. i noticed the morphs export from blender was a lot darker and had some sorta different colors than the 3dsmax one.

Blender 2.93.1 seems to crash in some cases when I open the “Browse Image to be linked” in the textures tab to access the generated texture files.


NVIDIA_Share_yhBTFUBYxH

I can see they are there, but Blender seems to crash half a second later.

This was my process:

  1. Download a humanoid model
    1.5. If the model came with a skeleton, I exported just the mesh out of it first (to remain as close to the process that worked for the other model)
  2. Upload it to Mixamo
  3. Download it from Mixamo with a skeleton and an animation
  4. Import it to Blender
  5. Add keyframes for the mesh using the transform values provided by the animation applied to the skeleton
  6. Use the Vertex Animation Script on the mesh
  7. Select the newly created mesh and go to the textures section to attempt to access the newly created textures
  8. Assuming it didn’t crash, I then export those textures, add a material slot to the mesh and export it too

Now this process worked for this mesh with no skeleton, but not these models that came with skeletons

The ExceptionCode backtrace from the crash logs of blender is “EXCEPTION_ACCESS_VIOLATION” if that helps.

Any idea what could be going wrong here?

Just a note regarding my previous comment:
I swapped back to Blender 2.83 LTS version, and it’s working fine now.

I’ve been using VertexAnimated Static Meshes with multiple animations in UE’s Instanced Static Mesh Components, where the animation is chosen by PerInstanceCustomData driven by a blueprint. This is working fine, but for some reason whenever I rotate the mesh instances to a non-zero rotation value, the mesh stretches and distorts. This does not happen with a single Static Mesh placed in a level and rotated, only with instances.

Here is an image of what I mean
The image depicts an Actor with 2 components on the same hierarchy level: an ISM and a standard StaticMesh.
Characters from left to right:

  • single static mesh rotated about 90 degrees: works fine
  • ISM instance rotated about 90 degrees: stretched and distorted
  • ISM instance with rotation of 0: works fine

I’m using animations from Mixamo placed on a single animation track back to back. It seems like the first animation doesn’t cause a problem, but all the following animations do.

Some uneducated speculation I might give is that this could be due to some missing vertex data or something like that. Vertices that have no recorded data for some property on any given frame might default to the mesh’s default properties, which is created from the first frame, which is maybe why the first animation doesn’t seem to be messed up when rotated. I might be completely off-base, I don’t fully understand how blender’s animation system or this script work.

Also of note, the generated offset texture looks a bit off, no pun intended. Maybe it’s not, but the colors for the second animation look very different despite the poses in both animations being fairly similar…
The generated offset texture looks like this

Any helpful advice would be appreciated.

Edit:
Actually, the images I linked were of my latest attempt at different ways to record keyframes and the second animation was actually made by duplicating and editing a few keyframes from the first animation. That was my attempt to rule out the possibility that the problem was with using multiple different animations exported from Mixamo separately, but it made no difference. So everything I said still applies.

Hey OneNot, not sure what could cause this issue I’m not very familiar with instanced static meshes. All though I believe any static mesh particle system would be using them which this is the ended purpose of the script. Any transforming of the vertices is happening via world position offset so it definitely should be taking into account any prior transforms. It’s also strange that it’s only certain vertices or at least skewed. From what I can tell by the image anyway. The offset image just tells each vertex how far they should move from their original position each frame. Each vertex would just have a new initial transform after you’ve rotated them it shouldn’t matter.