Jump to content
chaindriver

Get min/max value of an animated OBJ-level parameter

Recommended Posts

Hi,

I have a parameter in the OBJ level that is animated.

How do I get the min/max value of that curve? Is it by an expression or maybe CHOPs? :unsure:

Share this post


Link to post
Share on other sites

I'm like 90% sure this is a CHOP issue because it's history and future dependent. I don't exactly know how to do but you will likely how to send the output to a file and then load it in again as a static file. Each time the animation changes you'll have to cook the file again.

Unless there is some short cut expression that can do this. I think that's the only way.

Share this post


Link to post
Share on other sites

Use a Fetch CHOP to fetch the channel. Now append an Expression CHOP and use the icmax() expression.

Share this post


Link to post
Share on other sites

Hi, I know this is a super old thread, but I'm trying to accomplish the same thing with no luck.

I attached a simple example file. I'm trying to have CHOPS overwrite the speed attribute with the maximum speed that each point reaches over the course of the animation. Ultimately, I'd like to know the maximum value any of the points reaches.

I'd appreciate if anyone could point me to what I'm doing wrong.

Thanks!

chop_help.hipnc

Share this post


Link to post
Share on other sites

If you change In method button to Animated you get Values .

Share this post


Link to post
Share on other sites

I do get values, but they change every frame, so clearly they're not the values I'm looking for. I need to get the maximum value the attribute reaches at any time over the course of the animation.

Share this post


Link to post
Share on other sites

Thanks for your help with the file! But the values here are still changing every frame, so it's not quite what I'm after. If I understand this correctly, what this setup seems to be doing is mapping the current speed of the points on the current frame to a range of 0 to 1, with respect to the maximum speed attained at any time. What I need is every point's actual maximum speed value, not a 0-1 mapping of it. Do you maybe have another idea how to get this data?

Share this post


Link to post
Share on other sites

I really appreciate your help, it's just still not quite what I'm after (I hope I'm not asking too much). The speed attribute here is still changing per frame. I'll try to be as clear as I can:
Let's assume that point X has @speed=1 in the beginning of the animation, @speed=5 in the middle, and @speed=3 in the last frame. I want to generate the attribute @max_speed=5. This value would be different per point, but would be constant throughout the animation, because every point has a definite maximum speed that it reaches.

There are actually many situations where I find this info would be useful. Any time I'm modifying values with ramps, clamps and the like in VOPS and need some precision, rather than eyeballing it by plugging into the Cd output.

Share this post


Link to post
Share on other sites
Posted (edited)

But now all the points have the same value, that can't be right. I think the Combine Channels operation on the Math node makes it take the maximum value any of the points reaches, and applies that value to all of them.

Look here at the info on the Geometry node - these are the values I want to extract per-point. Is there a way to turn these values into attributes on the points themselves?

5f75915154238_CHOPSMaxValues.thumb.jpg.6a0a3d4e44f62962859f4e98f7cbb5b2.jpg

So, for point 0, @max_speed = 2.1371527. For point 1, @max_speed = 2.371021, etc...

I'm trying all sorts of approaches and can't get it to work. I found the function chinputlimits in the documentation, maybe that's the key? I'm just so inexperienced in CHOPS I don't seem to be using this function correctly in my attempts.

Edited by jamesearnest244

Share this post


Link to post
Share on other sites

I added the simplest use case I can think of to the last file you attached - deleting all points that exceed a certain speed at any time. But I don't want to delete them only when they reach that speed - if they are going to exceed it at any point in the future, then delete them right from the beginning (that way the point count remains consistent).

The last file you attached does assign consistent values to the points, but they're not the actual speed values. I'm not sure what they are. So the wrangle I put in doesn't do what it's supposed to.

CHOPS_UseCase.hipnc

Share this post


Link to post
Share on other sites

I finally figured it out!

I had to write icmax(0, $C) in the expression CHOP. When writing icmax(0,0) it was using the 0th channel's data and applying it to all the channels, instead of evaluating per channel. So writing $C in an expression CHOP is kind of like writing @ptnum in point wrangles.

I'm attaching the file in case anyone else runs into this in the future.

Thanks @Librarian for sticking around!

Chops_MaxValue_Solution.hipnc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×