Jump to content

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


Recommended Posts

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.

Link to comment
Share on other sites

  • 8 years later...

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

Link to comment
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?

Link to comment
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.

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
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

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