Jump to content
tanzola

[SOLVED] Problem transferring code from point wrangle to primitive wrangle

Recommended Posts

Posted (edited)

EDIT: Problem was an error in logic on my part.. Solution at end.

Hello,

On some frames I want to remove a point from a piece of geometry that has just one primitive. I can do this with a point wrangle and there are no problems. However as the project grew it made more sense to do this with a primitive wrangle instead. I rewrote the vex to serve primitives instead of points but now there is a problem: it seems like not all points are being considered in the frame after a point is removed.

Points are created at one end of a line and move a little bit each frame towards the end of the line, then they're deleted once they've traveled the length of the line. Each point's @P attrib is set each frame with the same wrangle that might delete it if it reaches the end.

When I use the prim wrangle (or a detail wrangle) instead of a point wrangle there's a noticeable stutter due to the lack of movement the frame after points are removed. The point that had just been created (which happens to be the same frame another point was removed) moves as much as it should, but the others do not. I have checked that there remains to be only one primitive.

I'm at a loss.. Thanks for taking a look!! FYI I'm still pretty new to Houdini. Project file is attached and there are point and prim wrangles in the solver for comparison.

SOLVED: I have another attrib @amt_cycle informing @P. When transferring to a prim wrangle instead of a point wrangle, I only removed the '@' symbol of @amt_cycle to turn the attrib into a regular variable in the code but I didn't recognize that the attribute was also being updated on that same line. To fix I just added a line for 'setpointattrib' to update the attrib.

ptprimwrangles.hipnc

Edited by tanzola
clarity, "create/remove" to "remove", solved, title

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

×