Jump to content
mzo

Flip sim driven by 2D animation

Recommended Posts

Hi, I'm kind of stuck with something I'm trying to achieve. If anybody could point me in the right direction, that would be fantastic. I'm trying to combine two techniques in the same shot.

I have an image that drives a flip simulation. Image has two colors and each color will become a different fluid that interacts/mixes with the other one. Initially, this image was still and it was easy for me to achieve that with attributesfrommap and mapping Cd to viscosity and density.

Now I need the underlying image to be an animation (only the character moves, the rest is still). I got the character animation driving the particles representing its shape using the volume optical flow technique. However, I'm struggling to find a way to merge these two systems together and basically add the character movement to the fluids mixing together generated from image Cd. 


This is a test project folder, which includes the images to drive the sim. 
 

motionFromAnim.zip

Share this post


Link to post
Share on other sites

You could be overthinking it and may be able to just do what you're after in a single system.  Since you're sourcing from points for all the parts you want already, try transferring the velocity of the character points to your background image points (attribute transfer or copy and blur, etc.) and/or add some custom velocities timed with the motion of the character as well to create the swirling you want (don't worry about creating a specific system itself, everything is a cheat - whatever gets you the end look is valid).

Share this post


Link to post
Share on other sites
1 hour ago, ryew said:

You could be overthinking it and may be able to just do what you're after in a single system.  Since you're sourcing from points for all the parts you want already, try transferring the velocity of the character points to your background image points (attribute transfer or copy and blur, etc.) and/or add some custom velocities timed with the motion of the character as well to create the swirling you want (don't worry about creating a specific system itself, everything is a cheat - whatever gets you the end look is valid).

Thanks, this makes sense. I will try to add the velocity computed from the optical flow to the mixing fluid from image data and see if that works. Regarding adding custom velocities to create the swirling, etc., could you point me to some example HIP file where I can study how that works? I normally do procedural modeling in Houdini, so working with sim and velocities is something I'm a little rusty about.

Share this post


Link to post
Share on other sites
Posted (edited)

Try this series of videos out from HoudiniSimon, he explains things pretty well and provides some .hip files

 

 

Edited by ryew

Share this post


Link to post
Share on other sites
1 hour ago, ryew said:

Try this series of videos out from HoudiniSimon, he explains things pretty well and provides some .hip files

 

 

That's great, thanks. I had a quick look already, and it seems very useful. Later today, I will follow it step by step to learn better. In the meantime, I have a quick question about the method you suggested yesterday. I put it together in one sim. I used volume rasterize before attribute transfer to get the velocity from the flat volume slice (originating from volume optical flow) and copied it into a 3D box filled with points representing my 2d image. It seems to work as the velocity vectors match the character, including its thickness. For the rest of the attributes (viscosity and density), I assigned them manually to the points depending on their color (I have only two colors). However, once I dive into DOP and start the sim, I disable the gravity, so I only see the velocity influence, and this changes from outside DOP. The movement inside the sim is different, and also the vectors look different. Why is this happening? Thanks

 

Screenshot from 2022-05-05 12-36-52.png

Screenshot from 2022-05-05 12-35-35.png

Screenshot from 2022-05-05 12-35-13.png

Share this post


Link to post
Share on other sites

At a guess, your density and viscosity settings might be dampening the input velocity - try leaving them at default values to see what effect your input velocities are having unless you specifically need to modify them; if it's still an issue, try adding a multiplier to your velocity to scale it up.  If it's still the same project, feel free to upload the .hip file on its own and I'll take a look when I have a moment.

Share this post


Link to post
Share on other sites
14 hours ago, ryew said:

At a guess, your density and viscosity settings might be dampening the input velocity - try leaving them at default values to see what effect your input velocities are having unless you specifically need to modify them; if it's still an issue, try adding a multiplier to your velocity to scale it up.  If it's still the same project, feel free to upload the .hip file on its own and I'll take a look when I have a moment.

Thanks, I tried all of those things already but had no luck so far. Here is the hip file. Please take a look when you have a minute. Thanks 

Anim1.hiplc

Share this post


Link to post
Share on other sites

The new scene didn't work for me, but here's a quick modification of the first one with viscosity and density modifications disabled; the velocities match between input and sim. 

 

motionFromAnim_mod.hiplc

Share this post


Link to post
Share on other sites
On 5/9/2022 at 10:41 AM, ryew said:

The new scene didn't work for me, but here's a quick modification of the first one with viscosity and density modifications disabled; the velocities match between input and sim. 

 

motionFromAnim_mod.hiplc

Thanks for this. Yes, I can see the velocity is now correct in terms of moving in the sim as in the animation. I'm trying to understand what I was doing wrong. Was there a specific step that was preventing it from working?

Share this post


Link to post
Share on other sites

I couldn't say; I wasn't able to run your later file and didn't try to debug it since the previous file worked and seemed enough to go by

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×