Why fit expression work to reverse scrolling ?

Recommended Posts

Hello.

If i play simulation forward fit expression doesn't work, but if play reverse fit expression work normal.

WhyNotSmooth.hip

Share on other sites

Hi Izoper.

I think the reason is

Attrib liff == \$AGE*24. When \$VY becomes zero \$AGE doesn't remain constant it keeps increasing.

if(\$VY == 0,fit(\$FF,\$LIFF,\$LIFF+24,0,180),0)

so in the above expression \$LIFF is not a certain fixed number but keeps on changing as you play on that is why it is not working.

As you are using POP when you play reverse there is no change in output unless you reach first frame, POP will reset then. As there is no change in values of LIFF (refer the detail view) while playing reverse you expression is working as LIFF values are constant.

One of the solution is to find out max ty pos of each particle when frame no is equal to \$NFRAMES, you can use timeshift sop for this.

and create some attrib with value equal to

\$TY/point("ADDRESS of timeshift node",\$PT,"P",1) - this value will change from 0 to 1. Multiply this by 180 to get 180 degrees rotation and stamp this value in the rotation of the box.

Share on other sites

I apologize, but I do not fully understand how to implement it.

TimeShift calculates everything up and the attribute value does not change with time or had to write another expression for something like this "\$F + 1"

WhyNotSmooth02.hip

Share on other sites

Hi Izoper.

If you write \$NFRAMES in timeshift sop it will give you the output of the last frame irrespective of which frame currently you are on(assuming that particles would have reached max ty pos by then). By the last frame particles would have reached their rest position so even if you are on frame 1 you can access the output of last frame by timeshift sop .

1)Apply timeshift node after pop and write \$NFRAMES in it(or any frame no by which all the particles have reached their rest pos).

2) Connect attrib create sop after pop (dont connect after timeshift, create seperate chain from pop), name of attrib - test

3) Value of this attrib - \$TY/point("ADDRESS of timeshift node",\$PT,"P",1)

4)\$TEST will change from 0 to 1. Multiply it by 180

5)Create stamp variable using test attrib and stamp this value in the transform node after the geometry you want to copy.

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.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×