Jump to content

Sequential animation from CHOPs?


Recommended Posts

I have a simple audio react animation that is conneceted to a CHOP network, just a few polygons with a simple extrude based on an audio trigger.  However I want the objects to extrude sequentially; on the first audio trigger primitive 0 will extrude, then on the second prim 1 will extrude, so on and so forth, but have it be sequential and based on the audio trigger from chops.

I attached a simple hip file, any help would be greatly appreciated

Chops_sequential_ODFORCE.hip

Link to comment
Share on other sites

Ah that is perfect, exactly what I was looking for thank you!

 

Not 100% totally sure what is happening with that wrangle node, I just started learning chops for this project.  But trying to wrap my head around it -

So you have x amount of channels coming in through the geo node stored in an array

the wrangle processes each incoming data stream in parallel for each index (channel) in the geo array at each time step (or sample in chops terms)

when the current channel to process is the incoming channel from the count node, it sets the value of the current sample to the value from the trigger channel, which is 0-1, applies it to the currently processed geometry, spits it out and moves on to the next sample

From here I am sort of fuzzy though... so the count value increases by 1 each time the trigger changes, so each time the count increments does the geo index increase as well? Or does the count channel multiply its value against the geo index and divide by the trigger value or something? Or are they all just offset in time somehow, which is really what it looks like in the motion graph

 

Either way thank you for the help!  I was definitely stuck on this one

Link to comment
Share on other sites

The technique is a little hacky, but it works. 

First I setup a simple trapezoid trigger waveform; short attack, sustain for a bit, short release. This gets cycled 20 times, so its a looping square wave (or blunt triangle wave, take your pick)

This is fed to a count chop, set to detect as soon as the incoming waveform gets above 0, ie, it counts right at the start of each loop. So now we have a trigger channel, and a count channel.

Finally we have a geo chop, which is reading each packed prim and its height attribute. They're not animated at all, so they're all flatlining at 0. One channel is generated for each incoming bit of geo, so there's 18 flat channels.

The geo chop, trigger, counter channels are all fed into a channel wrangle, with this code:

float trigger = chinput(1, 0, I);
float counter = chinput(2, 0, I);
if (C == counter) {
 V = trigger;
}

chinput takes a wrangle input, a channel number, a time, and returns the value at that time. Here I get the value of the trigger channel and the counter channel at the current interval. 

Each channel is numbered, stored as attribute C. For the trigger and counter there's only one channel, with an id of 0, but from the geo chop there are 18 channels (again one for each prim), numbered 0 to 17.

In the if block, I compare the counter to the channel id. If they match, I set the value (V) of the current channel to the trigger channel.

Chops are weird, but fun. :)

-matt

 

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...