Jump to content
Sign in to follow this  
Gigglebooster

Changing torus radius with attribute from copy to points?

Recommended Posts

Hi,

I've been stuck on this issue for awhile. I have a line and I'm giving each point a float attribute called test, it goes from 0-1. Then, I'm copying torus on to those points, but I want to make the y radius of the torus equal to the @test attribute of the point it's being copied to. So one end would have a radius of 0 and the end would have. I'm trying to use a point function to do this but can't get it to work, here's the function I'm using in the radius y parameter of the torus - point("../OUT_POINTS/", 0, "test", 0)

Any help would be appreciated, thanks. 

 

question.hiplc

Share this post


Link to post
Share on other sites
Posted (edited)

I really do not know what you are trying to do looking at your file. Do you want to do something like this?

houdini_BRIqpSTWUS.png.626bb3c63b996953a989e28e72511f8c.png

Edited by Sepu

Share this post


Link to post
Share on other sites

Yes, that's what I'm doing for. How did you do that? Basically, I'm trying to make the radius change based on the float attribute of the point it's being copied to. The float attribute in my scene is called @test, so I'm trying to set the radius y as the @test attribute so that one would have a radius of 0, and then the next .1, and the next .2.  

helpscreenshot2.JPG

Share this post


Link to post
Share on other sites
Posted (edited)

You do not need to do that. Think in pts. f@pscale (uniform scale) is the attribute that you use to affect the torus that way, and delete the point function in the torus.

There is a lot of different attributes that you can give to your pts before the copy to points, which reads these attributes. 

I would recommend going through this. 

https://www.sidefx.com/docs/houdini/model/attributes.html

houdini_siuixRpYPv.png

Edited by Sepu

Share this post


Link to post
Share on other sites

Hi thanks for the reply. I understand what you are doing now, but I'm still not getting how to reference the parameter of the the geo being copied. I understand that pscale can be adjust on the points before it's being copied to effect the overall size, but for what I'm trying to do I only want to effect the y radius or y scale of the torus and not the entire size. Also, I want to plug that into a point VOP and setup a ramp so that I can control the attribute that is effecting the radius size. That's why I wanted to create the test attribute and use that, so that I could then use @test in a VOP and control that. Is there no way to directly reference the attribute of a point it's being copied to? 

Share this post


Link to post
Share on other sites

That's exactly what I needed Noobini ty! I didn't realize you had to add the node you are referencing to a for loop like this 

Share this post


Link to post
Share on other sites
16 minutes ago, Gigglebooster said:

That's exactly what I needed Noobini ty! I didn't realize you had to add the node you are referencing to a for loop like this 

well your null is nicer to get to, is all, it would still work if instead of the null, you use "foreach_begin1" instead, cos each loop, it's processing 1 point (point 0), with the @test you setup beforhand.

Share this post


Link to post
Share on other sites

Ah gotcha. What I meant was that I didn't realize you needed a loop at all for this, I was just trying to reference the null without one and it wouldn't work. Good to know too tho thx!

 

Share this post


Link to post
Share on other sites

You could also use the setup you had originally, but the issue there is that the torus node doesn't know anything about what's further down in the chain, so it doesn't know what point it's going to be copied to and can't set anything per copy.

The trick is to replace your 'copy to points' node with a 'copy stamp'. This node lets objects that are going to be copied access information about the points they're being copied onto. (you may already know the following but I'm putting it in for peeps that need it later)

Turn on 'Stamp Inputs' under the 'Stamp' tab, and put your test variable and a reference name for it into the variables. (I always use capitals for reference names to make them distinct from variable names, but you don't have to)

image.png.b147f24fe29960b1c6e2a9cd434ac9fb.png

Then in your torus node, put the following into the parameter you want to control (assuming your copy stamp node is called 'copy1'): "stamp("../copy1", "TEST", 2)"

The syntax for this is "stamp(<node you're referencing that does the copying>, <reference name for variable you want to pick up>, <default value if we can't find the variable>)". I always set the default value to something that will be obvious if it hasn't worked, hence the 2 in this example.

image.png.d980f6f3a8cb0c02df057fd16e55c31d.png

You can use this to set more or less anything on your copies, but beware that it can get very heavy when you're copying to huge numbers of points and you may need a different sort of solution. In that case it would depend a lot on your setup.

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
Sign in to follow this  

×