Jump to content
tveda

Houdini 15 Point SOP

Recommended Posts

Stephen, you mean for a tangent direction? Surely, Polyframe SOP is much easier/faster for that

Not exactly the same.

Put down a point sop, and turn on "Add Edge Force" under the Force tab and take a look at the edge_dir attribute that gets created.  It creates an attribute that points to the next point in the curve as opposed to a tangent.

On a curve with 1,000,000 points it also takes 74ms on my computer, whereas the polyframe takes 140ms. So it doesn't break the bank in those very rare situations I've needed it.

Edited by Allegro
  • Like 1

Share this post


Link to post
Share on other sites

@N = @P - point(0,'P',@ptnum+1);

 

 

1,077,794 points

 

wrangle:   0.13ms

point sop: 33.5ms

 

No I didn't get the decimal place wrong.

 

:)

 

post-7292-0-68749100-1454627574_thumb.jp

 

Edited by mestela

Share this post


Link to post
Share on other sites

Right but...

 

 

When I test it on 100 points  (which is much more likely if I'm bothering to create this particular attribute:
- the point sop takes 0.16ms
- the wrangle takes 0.17ms

- it takes more time to type the expression than to click the option from a drop down (maybe you type much faster :)

- Assuming I don't want to overwrite N, but create a new vector attribute I then need to either :

-- write additional script to convert my edge_dir to a true v rather than a 3v
-- or use an attribute create beforehand to set it up as a true v

-- I also have to write a condition in there so that point 0 gets an attribute.

Edited by Allegro

Share this post


Link to post
Share on other sites

Heh, right, bullet counterpoints:

 

-with performance that close, I'd definitely go the wrangle; the more vex I write, the better I get, and I know performance will never be an issue if shot complexity scales

-yeah i type fast. you can also save it in a preset or in the vexpressions.txt file so it appears in the dropdown, but see the previous point. :)

-It's not locked to @N, it was just a lazy way for me to visualise that the expression worked. As such:

--type v@name to assign to an arbitrary vector of your choosing:   v@myvec = @P - point(0,'P',@ptnum+1);

--it doesn't have to be pre-created, the wrangle will create the attribute if it doesn't exist

--Edge cases are boring, true. Could throw ^0 onto the group, but again, I like to practice my vex whenever possible, so I'd probably wrap it in an if statement:

if (@ptnum != 0 && @ptnum != @numpt-1) {
   v@myvec = @P - point(0,'P',@ptnum+1);
}

Share this post


Link to post
Share on other sites

but v@myvec doesn't create a vector, it creates a 3f, so you need to use http://www.sidefx.com/docs/houdini15.0/vex/functions/setattribtypeinfoas well.

It's not a matter of practice at this point, it's you creating more work for yourself because you want to. Which is ok, but I personally try not to exert more effort on a task than I save by doing it "the right way".

Edited by Allegro

Share this post


Link to post
Share on other sites

Yeah, 3f vs 3fv is a little irritating, would be nice to have a @ shortcut for that in future.

 

Practice is one thing, I still prefer wrangles for performance and versatility, but a big thing for me is clarity.

 

Point sops, and even vop networks over 10 nodes don't read at a glance; you have to hope you've named the node clearly, otherwise it takes a bit of hunting to know exactly what you're doing. Worse if it's a hip from someone else.

 

Most wrangles are under 10 lines, and they're quick to read and understand. Well, mine are anyway. :)

Share this post


Link to post
Share on other sites

You could request that you be added to RFE ID# 66570 if you'd like to help nudge them into improving the 3f vs v which was originally added by Rob East :)

Share this post


Link to post
Share on other sites

Not exactly the same.

Put down a point sop, and turn on "Add Edge Force" under the Force tab and take a look at the edge_dir attribute that gets created.  It creates an attribute that points to the next point in the curve as opposed to a tangent.

On a curve with 1,000,000 points it also takes 74ms on my computer, whereas the polyframe takes 140ms. So it doesn't break the bank in those very rare situations I've needed it.

 

That´s very nice. I didn´t know this trick. I always used edge Force just for particle situations, specially back with the old POP system.

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

×