Oscillating attribute

   1658   5   1
User Avatar
Member
385 posts
Joined: July 2018
Offline
i'm trying to oscillate an attribute using a sine function, with a specific frame count as period (50 frames). At the midpoint of each oscillation i want my attribute to hold its value (from 0 to max(hold n frames) back to 0). Any tips on how to accomplish that?

Attachments:
sine_wave_attribute.hip (86.8 KB)

User Avatar
Staff
31 posts
Joined: June 2018
Offline
I don't have Houdini in front of me but I remember doing something similar in RSL ages ago. You use two smooth expressions/functions. You subtract one from the other. You'd need a modulo function to take care of the repitition. So if you wanted a period of 50 and 10: smooth($FF%50,0,20)-smooth($FF%50,30,50)
User Avatar
Member
2038 posts
Joined: Sept. 2015
Offline
You can do stuff like that with chops if you want.

I've added a chop network to drive your ‘maxvalue’ parameter.

You can see your sinewave in the Motion FX window. From there you can shape that sine wave anyway you want to affect the motion you want.

In your case have a hold(stop) for certain amount of frames.

You can use a combination of the Trim, Sequence(Combine), Extend and Shift Nodes to accomplish multiple variations along your Frame Range.

Attachments:
Chop Driven Parameter.hiplc (105.5 KB)

User Avatar
Member
385 posts
Joined: July 2018
Offline
ok i tried the first method and works fine i think! the second one seems really promising but it is a bit tricky for me right now. Here is the file for anyone interested!
Edited by papsphilip - May 6, 2019 13:57:56

Attachments:
Oscillating_attribute.hip (181.9 KB)

User Avatar
Member
2038 posts
Joined: Sept. 2015
Offline
I've wrapped some of that up into embedded assets within the chop.

Should be easier to manage and use.

For each time you want a hold, drop down an asset to tweak how long to hold, where to hold, and adjust joining existing motion.

Attachments:
Chop Driven Parameter.hiplc (121.9 KB)

User Avatar
Member
385 posts
Joined: July 2018
Offline
BabaJ
I've wrapped some of that up into embedded assets within the chop.

Should be easier to manage and use.

For each time you want a hold, drop down an asset to tweak how long to hold, where to hold, and adjust joining existing motion.

thanks Babaj!
  • Quick Links