Jump to content

Finding the average Y Velocity of points


Recommended Posts

Hey all,

I would like to get the average of all the Y velocities of a group of points inside a foreach SOP. I am really trying to find out if a rotating object (out of a whole bunch of other, differentially rotating objects) is going up on average based on all the points that make it up.

How might I go about getting all the Y velocities to add up and then return the average? Each object will have a different amount of points so I was figuring I would use a forloop inside a vopsop inside the foreach using the total number of points as the number to iterate through when adding the Y's up and then use it as the dividing number but I am hopelessly stuck.

Any ideas?

Thank you,

David

Edited by barad_dur
Link to comment
Share on other sites

  • 11 months later...

Hi,

I know this thread is super old, but unfortunately it doesn't help me in answering one simple question:

How do I find/access/read one single velocity value of a point. For example, I only want to read the v[y] value.

If I use v in my expression, it only returns v[x], but how do I access the other 2 velocity directions? v[x], v[y], etc. doesnt work somehow :(

I promoted the point velocity into a detail attribute, which still results in 3 detail attributes (x, y, z).

detail("../attribpromote1", "v[y]", 0) just doesn't work and always returns 0.

And somehow, I just can't find ANY documentation about this simple issue anywhere :(.

Thanks,

Chris

Link to comment
Share on other sites

I tried promoting P in a file and it seemed to work ok for me, maybe post your file where your having trouble with it?

Are you having trouble with specifically promoting P or referencing it in a detail expression?

If all else fails you can use fuse sop with a really high threshold to slam all the points together. Reference the fuse sop with point("../fuse1", 0, "P", 1) for the avg Y position.

Link to comment
Share on other sites

I've attached a very simple setup, containing a point grid and an attribute-promote node. I am trying to promote P from points to a detail attribute. Unfortunately, they position attributes don't appear as details. (It worked fine with velocity etc.)

Thanks!

promoteP.hip

Link to comment
Share on other sites

I've attached a very simple setup, containing a point grid and an attribute-promote node. I am trying to promote P from points to a detail attribute. Unfortunately, they position attributes don't appear as details. (It worked fine with velocity etc.)

Thanks!

Looks like it's working for me.

If you rename "P" to "pos" in attributepromote then the detail expression has to change from "P" to "pos" as well.

promoteP_060413.hip

Link to comment
Share on other sites

Strange, it doesn't seem to work for me, even with your file.

The node attribpromote1 doesn't have any detail information (when you check in Detail View) and the node detail_expression seems to output wrong values. All 3 results show 0. y-pos should show at least 5.

Is this different in your Houdini?

Link to comment
Share on other sites

Strange, it doesn't seem to work for me, even with your file.

The node attribpromote1 doesn't have any detail information (when you check in Detail View) and the node detail_expression seems to output wrong values. All 3 results show 0. y-pos should show at least 5.

Is this different in your Houdini?

Yeah, mine has meaningful values H12.5.351 OSX

What build, platform are you on?

Link to comment
Share on other sites

I am using H12.1 Build 185, Windows Vista

you would need to update after 12.5.122

Wednesday, August 1, 2012

Houdini 12.5.122: The Attribute Promote SOP will promote the P attribute as expected.

Or just rename P to pos(or whatever) prior to Attribute Promote SOP to promote it

promoteP_mod.hip

Edited by anim
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...