検索 - User list
Full Version: Created points are not in proper order
Root » Houdini Indie and Apprentice » Created points are not in proper order
CynthiaDesgagne
I'm making a little Digital Asset that adds a variable number of windows to a primitive. I do this by adding segments to the primitive, creating central points for each segment and using copy to points to place my windows. This works great.

I recently added a parameter to add empty segments on either side and I used an attribute wrangle to simply remove the extra points. It works, except when I want the rightmost space empty (centerOffset = 1), because when I create a central point for each wall segment, the rightmost one isn't the last one as one would expect.

I could cheat it, but I would rather find an elegant solution to this problem, so I'm open to suggestions.
BabaJ
If you posted a hip file, a number of people are likely to return a hip with different solutions you can choose from that you feel suits your overall purpose the best.

Having said that, in most cases doing more 'prework' before your operations like assigning windows or deleting center points can help much.

In this case you can assign an attribute id number like i@Center_Id = @ptnum; before any operation or some other number other than @ptnum based on your own routine like say position in relation to your planned model space or whatever. Then create a second attribute like i@Gets_Window = -1;

After, you can use something like a multiparm to assign windows to specific i@Center_Id, i.e. choose a i@Center_Id number and reassign it's value to something other than it's existing -1 value.

After, any point which still has a -1 value automatically gets deleted and any remaining points that don't have -1 get a window copied too.

This example is more complicated than needs to be, but should give you an idea of how pre-work set up can help you down the line for other operations. And again, post a hip and I'm sure someone will be able to offer a simpler solution other than my suggestion or what you currently have after being able to look through what you have done in more detail than a screen shot.
CynthiaDesgagne
Thank you BabaJ for your answer. I removed all the irrelevant stuff from my file, so I hope my files can be useful, as you suggested. For simplification's sake, I am simply adding a box in lieu of the window, and some parameters for my asset have been removed.
To see my issue, swap between -1 (correct) and 1 (incorrect) for Central Offset on the AddWindows node. Values of more than 2 are also correct.
animatrix_
Hi,

The culprit is the Edge Divide SOP. So you can just sort the primitives to get them to be ordered properly:

CynthiaDesgagne
Thank you animatrix_, the Sort Node makes a lot of sense. Looking at the documentation, I'll use sort "by attribute" with the distance between the point and the first point. It should now always be perfect.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB