SLOPES for Dummies

   6817   7   4
User Avatar
Member
132 posts
Joined: July 2005
Offline
Squid here :shock:

I'm setting up an example file to show the company I work for how Houdini's digital assets can work as part of a smooth pipeline. I want to show how an OTL can be made in a Master file and then used in Houdini Select files by beginner artists.

I'm setting up a pyroclastic simulator that uses very simple principles to create the look of pyroclastics. The system works without any dynamics and utilizes Houdinis' unique copy/stamp function to achieve a really neat looking result. I've proven that the method works really well and am in the process of turning my setup into a nice OTL.

I want to have a speed multiplier so an animator can easily choose the speed these clouds form at. Easy enough. All of my animation is based off $F. I can slow everything down by multiplying $F by a value with no problem. HOWEVER, the problem is I want to animate this slow down…

$F = 1 2 3 4 5 6 7 8 9 10
$Anim Curve = 10 9 8 7 6 5 4 3 2 1
=========================
Evaluates to 10 18 24 28 30 30 28 24 18 10

Uh oh! Thats not a linear slowdown! That's a wave!

So the question is, how do I get a multiplier in my OTL controls that can be animated to affect my curve? I really want the animation to be there all the time regardless of keyframes. The only time i want to have to key anything is if I want it 3 times faster, 1/3 as fast, etc.

I've tried CHOPs… maybe didnt spend enough time looking for a solution there. A friend suggested I write something in VOPs but I didnt really know where to start.

Basically… ideally I need an animation which increments every consecutive frame but doesnt reflect the frame number. so I set a speed at 5 and it adds 5 units each increment. Then I could animate the 5 down to 1 so it adds less and less per increment. Any ideas?
User Avatar
Member
2199 posts
Joined: July 2005
Online
Not entirely sure I follow what you what to do, but I think there might be two answers.

1. Look at the warp chop. Note that chops are only available in master and escape not select. But I think Sesi are offering a free upgrade from select to escape. ( don't quote me on this though)

2. Look at using the chf and cht functions which will allow you to reference a graph at a particular frame.

If this doesn't help, post an example file of what you want to do over on odforce and I or someone else will take a look. I 100% sure what you want to do is doable.
The trick is finding just the right hammer for every screw
User Avatar
Member
7028 posts
Joined: July 2005
Offline
I'd go with the chf() function like Simon says. Basically, you create a channel that's your control channel, the one that you want people to edit, let's call it “control” then you reference it in the animation channel(s) that you want to modify.

So, in your animatin channels, you'd have something like

chf(“control”,XXX) * cubic() or whatever.

where XXX is a lookup value, possibly as simple as $F for 1 to 1 (if that's the case, you don't need chf() you can just use ch().

The default for “control” is 1 at all keys, so if you don't need it, it just mults 1 in, obviously changing nothing.

If you wanted to get trickier, you could set your “control” channel to go from 0 to 100, then you could use this as a percentage of the length of the channels. However, XXX would be a more complex expression (possibly $FF/$NFRAMES) or would have to refer to a CHOP (since I can't seem to find an Hscript expression that returns the length of another channel!!)

Cheers,

Peter B
User Avatar
Member
132 posts
Joined: July 2005
Offline
The basic idea of this is I need to have 1 channel rotating at all times. For example, I need to have $F*45 in my transform of the object I'm affecting. I also want to be able to key a speed up or speed down on top of that animation. So I would want $F*(45*ch(“…”)) and then I'd want ch(“..”) to be the channel animated so that animating from 0->1 would create a gradual speed up in rotation. But once it hit 1, I would no longer need to key anything as the object would still be rotating due to $F*45 or whatever. The problem is… if I have $F*1 as the constant rotation, and I want to animate a speed down over time with my ch(“..”) multiplier, the math looks like this:

ch(…) = 10 9 8 7 6 5 4 3 2 1

$F = 1 2 3 4 5 6 7 8 9 10

This multiplies out to:

10 18 24 28 30 30 28 24 18 10

The result is a rotation that looks like sin($F)*45 would. Its a nice little bobbing motion but not what I want.

I did some more work on this and came up with a solution :idea: I'm not sure I will use, but its fun nonetheless. Take an Add sop and make a single point. Attach a particle Sop to that Adds output and emit a single particle on frame 1. Go to the objects rotation channel you want to affect, and add the position in TZ of the particle to the $F function. So it looks like $F+point(“../particle1”,0,“P”,2). Then key the particle sops windz channel between 0 and 1 or whatever to add rotation speed to the object you want to affect. The result is a nice gradual speedup and slow down thats keyeable. How this will work with the setup I really want, I'm not quite sure yet :? The idea of this setup was to simulate what looks like a dynamic simulation without using dynamics. This method would cause me to cheat…. but I'd still stay out of pops and chops for hselect users 8)
User Avatar
Member
306 posts
Joined: July 2005
Offline
Hi Squid,

I'd look at the area chop.. You pipe a constant into the area chop and it will return a slope… ie. you put in a rate and it returns the amount so far. If you put in an animated value, it treates it like a rate and accumulates at that animated rate… that make sense?

Basically, you can say spin at speed 5, then slow down to 2, and it won't spin backwards. It will just spin slower.

Think back to calculus. It's returning the are underneath the graph.

Beers,
r.
“First things first – but not necessarily in that order”
– The Doctor
User Avatar
Member
154 posts
Joined: July 2005
Online
hey the_squid

i'd go with Simon and post the file online, or maybe just part of it, and let us take a look at it. :wink:

aracid
User Avatar
Member
387 posts
Joined: July 2005
Offline
Hey,

I just scanned your post pretty quick, so i might not understand, especially as it seems my solution is too simple: Just add a “spare channel” which will be some floating point value between 0 and 1.

eg. Let's call the channel “slowdown”. You can find the Add Spare Channel option in the Operator Menu on any Houdini Pane. Then, where-ever you've been using $F now use $F*ch(“../slowdown”). If slowdown is set to 0.5 then you'll be running at half the speed. Nb. You might need to change the “..” bit to be the fullpath to where you created the channel. ie: /obj/model/slowdown or whatever.

ALternately, if this is an OTL, then you can create a Float type parameter in the interface and then use this as the divisor for $F.

I hope this idea gets you back on track.

cheers,
ben.
Edited by - Nov. 1, 2004 15:38:18
''You're always doing this: reducing it to science. Why can't it be real?'' – Jackie Tyler
User Avatar
Member
132 posts
Joined: July 2005
Offline
You're right, that works for a static change in motion. But once you animate that ch(“”) multiplier you wont get a smooth speed up or slow down.

If I knew how to upload houdini files on this site I'd post an example. Try it though… animate the spare channel over time. Animate it speeding up, and slowing down.
  • Quick Links