• News

• Industries

• Learning & Support

• Community

• Marketplace

# Vertex Animation Tool in 4.8

So, just saw the twitter post about the new Vertex Animation Tools in 4.8 https://docs.unrealengine.com/latest/INT/Engine/Animation/Tools/VertexAnimationTool/index.html and I had some questions:

1. The doc page only talks about using it with 3Ds Max. Will it eventually be usable for Maya? If so, how far away is that?

2. The example meshes all had the same number of vertices during their animations. Does this still work if the number of vertices changes? (like in a water simulation?)

I just came across the VAT page and wanted to bump this.
I’m interested in trying to create a similar tool within houdini but the docs only explain how to use the script itself and not whats going on underneath. It would be cool to get an explanation of how those 2d maps were created at a basic level, so that anyone interested could potentially make a tool in there dcc of choice. Thanks.

I was going to tackle something like that in Houdini but the lack of reference made me drop it for other things. This has an interesting lead though. We do have this formula for determining the texture resolution which I believe points us in the right direction:

We might be able to image it like this:

[V1] [V2] [V3] … [VX]
[F2] [F2] [F2] … [F2]
[F3] [F3] [F3] … [F3]
… … … … …
[FY] [FY] [FY] … [FY]

Where V is the original vertex location and each F is the vertex in that corresponding frame. So in Houdini, we could do two for-loops:

1. For all vertices, record their locations in the texture’s columns
2. For each frame, repeat step 1 on the corresponding row

That would explain why these textures look really long (all the vertices) and might have only 32 pixels of height (number of captured frames).

Annnnnnd now I want to play with this instead of sleeping.

UPDATE: Based on the algorithm above, I put together some simple parameters and created the right resolution for the texture. But now I’m going in circles from being too worn out and dealing with the color value ordering and whatnot. I’ll have to pick this up again tomorrow

I also wanted to try and tackle this in houdini. I’m pretty new to houdini in general so I’m still not sure how to go about writing out the vert values to pixels in a texture. However I did start to pick apart what the 3d max tool does and wrote down the following notes. Maybe they will be helpful to you guys, who knows

What the Epic tool seems to do:

Writes out a 32 bit floating point EXR

pixels in the X axis correspond to vert numbers
pixels in the Y axis correspond to frames in the timeline

start in top left corner of the image.

first X row seems to be the “default” pose, so all pixel values are 0, and each pixel value in the rows that follow is relative to the first row.

to inspect an image:
open it in the comp window in houdini, set the file node to 32 bit floating point depth and turn off linearize image. right click in the comp view and turn on “inspect”. Run the mouse down each column in the image to see the rgb values, which show you the position offsets per vert/per pixel

3d max vert numbering seems to start at 1, not 0.

so in X:
pixel 0 = vert 1
pixel 1 = vert 2
pixel 3 = vert 3
etc…

exr pixel coords seem to start bottom left
the tool starts writing from top left.

so frame 0 doesnt equal pixel column 0, its reversed.

Forgot to post, I actually got this working in Houdini.

A major gotcha is that I believe the material function reads with the top scanline first. Houdini writes to the bottom scanline first. So if you’re storing the vertex (WHICH IS ACTUALLY THE POINTS IN HOUDINI…ugh) into an array, starting with the last frame and working backwards works.

Something interesting is that the mesh needs a UV1. The 3DSMax tool kind of goes into this. Basically, each UV point is evenly spaced on the U axis and V is set to 0.5: where UV[0…1, 0.5]. The last UV point is set to UV[1,1]. It appears that’s required for the material function, but I’m not entirely sure how. Haven’t broken down the material function yet.

Anyway, video of it working below. Once I do some more testing, I’ll post the HDA some place.

Prety awesome! Anyway to get this working for Maya?

That’s awesome! Can’t wait to try it out Thanks

What I would like to know is why not use FBX’s ability to support the export of point cache data?

I don’t think UE4 supports vertex cache yet, correct me if I’m wrong please. If you look at the roadmap its the highest voted animation feature but no indication they are actually working on it.

Nope you are right we do not support vertex cache data and I have no idea if we will in the future or not.

Cool - it’s great to see that you wrote a Houdini version of the script!

Let me know if you have any questions. I wrote the max version.

The texture is sampled in the following manner :
U: the red channel texture coordinate 1
v: 1/the number of morph target frames (to find the uv value that correlates with 1 pixel) * the current frame number (to find the correct UV V value)

That combination will locate each verts new morph target location.

I imagine there’s probably a way. However, I’m just so deep in Houdini land that I probably won’t get around to it for a while. Unless I get taken in by a Maya-centric studio…that would probably accelerate things

Oh hey! You’re awesome for putting the max one together I have some plans with taking advantage of Houdini’s features and this tool. I think some really cool effects can be made using this, especially larger effects in VR space where sprites don’t really work with depth. That definitely makes sense with how the texture’s being sampled. Whenever I get the chance, I’ll dig through the material function to understand the steps better. I’ll definitely ping you if I have any questions

As for anyone who’s interested in the Houdini version, I’ll make a separate post in the [hopefully] near future with some guidelines and the HDA. Some examples too if I have the time =]

Cool

Yeah, I feel like we’ve barely scratched the surface of what can be done with sampling the morph targets over time. Geometry based motion blur, for instance, is just one of the cool techniques that come out of texture based targets.

Haha! I was playing around with this exact thing today. I should perhaps have searched around before spending the afternoon in houdini Oh well, your videos don’t seem to be up at the moment so I’ll share my work in progress. As it’s early days I still haven’t set up the second UVset or tried to import it into unreal. So far it’s been mostly a learning experience in houdini. It’s so nice getting to a setup where it’s very visual and easy to work with. Most of the work was actually spent setting up useful preview options so it’s simple to get a feel for how it will look if you skip some more frames without having to actually bake it out and test it in engine.

Here’s the video:

Things left to do:
Make sure it’s compatible with the Unreal setup.
Fix the twitch when using interpolation preview.
Make a houdini engine version for Maya.

My current plan is to get more into unreal and making marketplace assets during the fall. Hopefully that’ll mean I can hard test this and work out all the kinks so I can release it into the world, is anyone would want it.

I am also trying to write a quick tool in Houdini to take advantage of this. Not sure what happened with the other peoples efforts. I have the positional data all happy and working, but I can’t quite get the normals behaving correctly. Are the normals written in the image in world space or tangent space? And are they a difference, like the positions, or a raw value from the geometry?

Nevermind I figured it out. The normals are WS remapped from -1 1 to 0 1.

Hey guys,

I posted my version of this tool to allow houdini to export geometry, positional and normal data image files to work with the MS_VertexAnimationTools_MorphTargets material node in unreal. Sorry if I am jumping the gun on anyone else doing this, but the other links seem to have gone stale and I really wanted to get it up and working as I am doing a lot of Houdini<>Unreal work right now. I thought it would be good to share incase anyone stumbles on this thread looking into this workflow like I did. And sorry, I am not working on a Maya version, I know that’s what the post started as.

Here it is: bk_vertexanim_bake

It was a few days of effort to get it all polished and documented. I hope you find it useful! I have so far. Its fun stuff! Feel free to send me a pm if you have questions or run into issues.

-bk