Make fluid simulation respect obstacle deforms?

I have an object I am using as a fluid obstacle. Alas, the fluid simulation does not respect the lattice deformation of the object.

A great, simple demonstration is shown here.

Is there any way to do this? How else could one possibly simulate say, a winecloth, a sloshing glass, or a fish in a bag?

First off, your example shows container / obstacle made of mesh without thickness. Obstacle object need to have volume to work. Don’t forget to add thickness.

About the Lattice, since lattice object is a parent of obstacle object, fluid simulation doesn’t see it. You know, lattice has no surface to react to.

Try to experiment with Shape key or Simple deform modifier.

On the obstacle object, in its fluid obstacle settings, check the box marked “Export Animated”.