MadMax50 Posted May 22 Share Posted May 22 Hey everyone, I want my RBD sim to scale to 0 when it gets close to an object in DOPS and stay at 0 pscale regardless of the object animation later on . The problem is that to sphere moves at the end and the pscale goes back to normal. How can I make the RBD pscale stay 0 . I am using a min function to try and help me but I am doing something wrong. I thought the sop solver was supposed to remember the previous frame. Someone please help ? Thank you sop_solver_pscale_based_On_dist.hip Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted May 23 Share Posted May 23 (edited) Hi, @dist attribute is calculating by ray sop and @pscale is overriding by remapped @dist each timestep. "IF" condition only works when @pscale < 0.1 so @pscale has a value from 1 to 0.1 then back from 0.1 to 1. To make your setup work you have to set @pscale = 1 in SOP on packed geo before simulation and use this code in the attribute wrangle inside Sop Solver DOP: float pscaleNew= fit(@dist, 0, ch("max_distance"), 0, 1); @pscale=min(@pscale,pscaleNew); if(@pscale<0.1) @pscale=0.1; Edited May 23 by vicvvsh 1 Quote Link to comment Share on other sites More sharing options...
MadMax50 Posted May 24 Author Share Posted May 24 @vicvvsh much thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.