How to get correct transform values for VDB in UE?

I have exported an animation from unreal (in world space), and then parented a simulation to it in EG. When I import the vdb sequence back into UE, I can’t figure out how to position and scale the vdb correctly.

It seems that the world space coordinates of the animation get ruined by the “scale and center to fit” button in the Import node in EG.

But at the same time, it seems like I am forced to use that button, because the coords of my animation are something like 29000, -20000, 1400. So the animated mesh is very far from the origin point, which makes it difficult to work with in EG without using the “Scale and center to fit” button.

Not to mention this button also changes the scale of the mesh, which I cant figure out how to fix in UE.

I have also tried to attach the transform slot of the Import node to the VDB export node, but this does not seem to work either.

My goal is to be able to set the VDB sequence world space coordinates inside UE to 0,0,0 and have the vdb be aligned with the animation.

Is this possible? Thanks for any intel!

Hey thanks for reaching out about this. You can accomplish this by connecting the Transform pin of the import node to the Transform pin of the VDB Export node. This should allow you to import the VDB exactly where it should go relative to the imported mesh. Let me know if this helps!

Thanks Will! This does not seem to work. I also saw in a previous post that I needed to change the transform mode to Z up Left handed for Unreal engine, which I did, and still does not work. The vdb still does not line up. In fact, after re exporting, i couldnt find the vdb at all in my scene, although I am guessing this is because it is very small and very far out of place in a very large scene.

Is there anything else you can think of that might be throwing off the positioning and/or scale here?

Also, what does the scale and center to fit button actually do? Is it modifying the geometry in some way? Or is it just moving the sim domain to the geo in the viewport?

Also, in the Transform section of the Import node, when I click scale and center to fit, I get a scale value of something like 132.551%. Is that in addition to the x10 default scale value? Does this scale value get applied to the VDB export? Do I need to inverse this scale value in UE to get it to match up again?

You can see here that when I reimport the vdb, its close, but still off. positioning it manually, I can tell that the vdb is off by about 2000cm x1800 cm x 190 cm, and about 9 degrees Z-rotationally off. I can’t figure out where this discrepency is coming from.

Also, as a test I brought the animation and vdb into blender and can confirm that its also misaligned and mis-scaled there as well.

The scale to center and fit button in the import node takes the full scene of the imported mesh and centers + scales it to fit in the simulation bounds based on that.

Do I need to inverse this scale value in UE to get it to match up again?

This is what the Transform pin is for, it should take the transforms of the import node and invert them and apply that to the VDB so that it imports exactly where it should.

Can you send me the files you’re using? I’ll see if i can recreate this on my end.

Yes, thank you for the help! I cannot send you the unreal file due to confidential data but I can give you the animated FBX ive been using and the embergen file. here they are Embergen - Google Drive

Hey Will did you ever have a moment to test this on your end?

Hey sorry for the delay. I was able to use your imported mesh on the default preset and the VDB was lined up in Blender, so I think that the issue lies somewhere in your EmberGen file. I took a look and the shape primitives have a position offset and rotation applied to them, the particle emitter node they’re connected to has its own position offset, and then the simulation node is also offset by a few thousand meters. I tired fixing the file itself but i think it would be best to start from scratch so that you can be sure of the changes you’re making to the simulation.

Try to work with a voxel size between .1 and .5, and then once you have your domain bounds and imported mesh scaled to your liking, then go in and add the emitter elements and use the import controls for the shapes and whatnot. Leave the emitter node and Simulation node transforms at 0 and everything should work as intended. Let me know if you run into any other issues!

Wow this is incredible, thank you so much for helping out. Ill try resetting all those transforms and see if that fixes things. thanks again!

1 Like