Jump to content

point expression counter


arjanM

Recommended Posts

Hi, I am new to this forum and very new to houdini.

I have a question about creating an expression for the point node in houdini.

I am trying to recreate something I made in maya with the soup nodes.

In the soup version of the point node in maya, you can create a variable in the start block, so that I can store values to it for every point.

So I can for example create the variable X in the start block and have an expression on the weight parameter like this;

if lvar("TX")>2:

X=0

X=X+1

So this way the X varable will start counting from 0 when the point went above the value of 2.

Is there a way to do this with the point node in houdini?

I hope this makes any sense and somebody can help me with this.

thanks

Arjan

Link to comment
Share on other sites

could you provide some example usage of that expression? what you want to do with that counting variable X ?

If you are adding variable per frame, you could use for e.g. sop solver

Edited by tmdag
Link to comment
Share on other sites

Hi Albert,

I am trying to create a simple building generator. It is something for a personal project of mine, but also a way to learn the program.

So it will probably be really inefficient.

I want to distribute building parts over a curve. I have an inner corner, outer corner, 3 unit long windows part and a 1 unit long part.

I am using the copy node with the stamp function to drive a switch node, where all the building parts are connected with.

The weight attribute of the points on the curve drive the switch. Now the outer and inner corners have a different weight value.

But between the corners I want to distribute the 3 unit long part as much as will fit and fill the rest with 1 unit long parts.

So that is why I want to count the points from every corner so I can divide the counter with the total length between the corners, so I know how many 1 and 3 unit long parts to place.

I hope this makes a bit sense to you.

Link to comment
Share on other sites

Guest mantragora

Can't you just separate corners and do separate operation on them? just group corners in one group and rest of the points in another and work with this instead.

Edited by mantragora
Link to comment
Share on other sites

I do have a group for all the corners and a group for the inner and outer corners and use them to set the weight value.

But to simplify my question, lets say I have 1 line with a variable amount of points. And I want to distribute 2 different objects on this line.

1 object is 3 units long and the other is 1 unit long. So for instance when my line has 10 points, I want to copy the 3 unit long object to point number 1, 4 and 7 and the 1 unit long object on point 10.

What would be a simple approach to achieve this?

Link to comment
Share on other sites

Guest mantragora

This is perfectly doable but not with just one node. Probably mix of Vops and Sops. Maybe some of the guys sitting in procedural modeling have some ready solution for this problem.

Do you want to copy all those elements in a random order or do you plan to copy them in some specific way later?

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