Jump to content

Second Entry And Looping Points In Vop Sop


lisux

Recommended Posts

Hi everybody.

I need to make an effect using VEX and I am going to need some points to drive the effect over every point of the geometry.

So I am going to use two entries in my VOP SOP, the first the geo to modify, and the secong some "guides" points.

these guides points are going to control different centers for ripples, so when I precess a point of the geometry to deform I need to mak eone ripple per guide point and add all the results.

My questions are:

How to access to the points of the second input, position, any attribute, etc

How to loop using the number of points o fthe second input over all the guides points? So i can apply the effect using these guides to my point to be deformed

Thanks

Link to comment
Share on other sites

This really sounds like u could use point clouds here,

That way u can access all the attributes you need and you dont have to have the second input have the same amount of points as the first and

its also nice because u can filter through them, for free using Point Cloud filter, open, iterate etc.

keeping in mind that u might have to either bake out your point cloud as bgeo's or reference the SOP using op:/obj/OUT instead of the file.

however if you have to import the point from the second VEX input, using the import attribute VOP and specifying the OP input index > 0, that being the input number, ie: if ur input is into the second input of the SOP, then ur OP input Index should be 1, because it starts at 0.

hope this helps

Link to comment
Share on other sites

Hey lisux,

Use input() to import an attribute and npoints() to find out how many points the second input has. But if the number of points on the second input will be huge your SOP become very very slow. In this case really better to use point clouds as aracid said. But pcfilter in reality isn't for free. It's the same as using input() and npoints() with one big exception - if you using point clouds you working with a bunch of points in some radius. Points outside that radius are ignored. So the actual number of processed points will be much smaller.

Link to comment
Share on other sites

But pcfilter in reality isn't for free.

yeah sorry about that, when I mean for free: I'm actually not refering to the processing time, but rather just being able to do what you need with very little RND, because the functions availabe using PC are farely easy to use.

sorry about that.

:blink:

Link to comment
Share on other sites

Thanks guys, quite useful, now I am solving other issues but surely I will came back to this sooner.

I think that the point cloud is the best way to, ising this I don't need the second input and the VEX will be cleaner and faster.

Thanks so much.

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