Trouble using attribute in Scale parameter of Edit node.

   4096   4   2
User Avatar
Member
10 posts
Joined: Jan. 2016
Offline
Hi guys,

New houdini user here trying to grok attributes but I am stuck on a very simple setup which looks like this:

1) First node is a tube.
2) Second node is a point wrangle where I create an attribute “x” like this: “@x = relbbox(0,@P).y;”
3) Third node is a edit node where I am trying scale some points and modulating the effect of the scale by using the “x” attribute like this “$IV*@x”.

Conceptually I want to do “scale = scale * value_of_attribute_x”.

But “$IV*@x” always evaluates to zero. It seems that any custom attribute that I used inside the parameter expression of scale parameter evaluates to 0. Why is that?

Also I am getting a warning that “Scale cannot be animated or time dependent”.

The docs say that you can use “@attributename” as syntax to access attributes in hscript when using parameter expressions so I am wondering what I am doing wrong here.

I've attached the example file.
Edited by zenmonkey - Feb. 16, 2019 15:58:55

Attachments:
test.hipnc (114.2 KB)

User Avatar
Member
542 posts
Joined: Nov. 2016
Offline
Hey zenmonkey, the point expression [www.sidefx.com] will allow you to drive parameters with attributes. However as the warning is telling you, the Edit node transforms can't be time dependent, so using $IV, which evaluates your f-curve value, won't work. You'll have to use a different node, such as Transform.
Edited by Tanto - Feb. 16, 2019 16:58:57
User Avatar
Member
10 posts
Joined: Jan. 2016
Offline
Tanto
Hey zenmonkey, the point expression [www.sidefx.com] will allow you to drive parameters with attributes. However as the warning is telling you, the Edit node transforms can't be time dependent, so using $IV, which evaluates your f-curve value, won't work. You'll have to use a different node, such as Transform.

Hey Tanto, I tried this in the scale parameter of transform node: $IV * point(“/obj/transform1”,@ptnum,“x”,0) but it evaluates to 0.

Looks like point(“/obj/transform1”,@ptnum,“x”,0) evaluates to 0 again.

Also I am puzzled by the syntax of expressions where you can access built in Houdini attributes with @ syntax but custom attributes via point expression function? Isn't that tedious as hell if the attribute is on the node itself? Why can't I just use @ sytax for custom attributes as well? To access a point attribute on the node itself I have to reference it via a full path? I tried using point(“.”,@ptnum,“x”,0) thinking the attribute is on the node itself so the path would be “.” but it was giving me infinite recursion error message. The whole thing is confusing to me…

Can you indulge me and write the correct point expression in this case? Again conceptually this is basic stuff but I am getting bogged down in syntax..
Edited by zenmonkey - Feb. 16, 2019 20:01:21
User Avatar
Member
542 posts
Joined: Nov. 2016
Offline
Hey zenmonkey, you can't access a point attribute on the transform node, since it's currently being evaluated (also you're missing a level in your path). You have to access it on its input, with its full or relative path (“../attribwrangle1”) or by using 0, which indicated the first input of the current node.

However, my bad, this still won't work with a transform node as it looks like it can't apply a different transform on each point. I believe the result of the first point of your group will be applied to all. I think this would call for VEX.
User Avatar
Member
10 posts
Joined: Jan. 2016
Offline
Tanto
Hey zenmonkey, you can't access a point attribute on the transform node, since it's currently being evaluated

I don't understand this. By the time transform node evaluation has started it should have attributes from upstream nodes, right?

Tanto
However, my bad, this still won't work with a transform node as it looks like it can't apply a different transform on each point. I believe the result of the first point of your group will be applied to all.

My understanding was that each node is evaluated for every point in every frame (with background optimizations to evaluate it in a lazy manner). Are there nodes that don't follow this? Didn't see a mention of that in the docs…Is there a good primer on how the node graph is evaluated?

Tanto
I think this would call for VEX.

I did end up using VEX in a wrangle node and abandoning transform/edit node approach. I wanted to use transform or edit because it provides UI handles.
  • Quick Links