Jump to content

How to know attribute value at a given time ?


ben

Recommended Posts

Hi ,

I'm studing houdini on my spare time for 3 weeks now.

To test and improve my knowledge I'm trying to set up a basic crowd sim, and I could use some help...

1)

Let's say I need to know what was the value of an attribute 5 frame back.

How can I do that ?

2)

I have particles moving snapped (ray SOP) to ground (grid + mountain).

I need to know if they are moving up the surface, and if so decrease their Velocity.

Any idea ?

As you can see on the attached picture the purpose is to decrease velocity (walk) when climbing and increase velocity (run) when moving down.

Of course animations blend are driven by velocity

blue : idle

green : walk

yellow : jog

red : run

Any advice welcome

thanks

ben

post-5378-126442823449_thumb.jpeg

Edited by ben
Link to comment
Share on other sites

CHOP's that's quite interesting. I was thinking about a VOP's solution.

If you create a series of attributes like cd-first, cd second, cd-thirth ect. And adjust these in a little network in VOP's which passes the value on each frame from the second to the thirth, the first to the second, and the current to the first. You'll end up with attributes holding the cd value of the previous 3 frames.

The down side of this is that you need to add more nodes and you'll and up with a linear growth of processing when you want to sample further in history.

I used this method on particles, I wasn't aware of the CHOP's method. I wonder would it work on particles, probably only when there cached?

Link to comment
Share on other sites

i think a pretty straight forward way is to use a timeshift SOP, and put in $F-5. Then use a point() expression to lookup the value from the timeshift, or feed the original pts into an attrCopy SOP and the timeshift into the second input.

Link to comment
Share on other sites

Timeshift SOP feed my needs for now.

But I've dive into CHOP also, watching for the slope thing, and it's quite amazing.

Thanks for all your good advices

One thing I forgot to mention is that if you are using the timeshift on something like a bgeo/geo sequence, you will probably need to clamp your values in the timeshift SOP between your written out frame range. For example, if your bgeo seq starts at frame 1, your time shift will be trying to read frame -4.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

×
×
  • Create New...