Link with?

   5090   11   1
User Avatar
Member
375 posts
Joined: May 2014
Offline
Hello,
In hou what's the equivalent of Maya's “link with”?
For example :
If the cube rotates from -180 to +180, the sphere will raise from 0 to 5.
Thanks guys.
Gz
Houdini gamboler
User Avatar
Member
41 posts
Joined: Dec. 2016
Offline
I'm sure there are several ways to do it. One way is you can use a parameter expression to reference a transform from a transform node and apply a fit to it.

fit(ch("../../box_object1/transform1/ry"), -180, 180, 0, 5)
User Avatar
Member
77 posts
Joined: Feb. 2017
Offline
C4D's Range Mapper in Xpresso also can be rebuild in Houdini, likes Maya's “link with” add a Ramp.
It's a case - If the cube rotates from -180 to +180, the sphere will raise from 0 to 5…

Attachments:
00.PNG (29.7 KB)
捕获.PNG (20.8 KB)
range_mapper.hipnc (165.1 KB)

My Youtube Channel [www.youtube.com]
User Avatar
Member
375 posts
Joined: May 2014
Offline
hello guys thanks both for your help. Robo's method worked perfectly! So I didn't try Zengchen's method but thanks anyway!
Houdini gamboler
User Avatar
Member
375 posts
Joined: May 2014
Offline
Some more questions:
- I read in another thread that $TY is the global Y position of an object. Is ry the global rotation of an object?
- What are the variables for the local position and rotation of an object? By local, I mean: the objects' parents are the references.
- Where in the docs can I find a list of all useful variables like these ones?
- In which case should I add a dollar sign “$” before the variables?
Houdini gamboler
User Avatar
Member
98 posts
Joined: Aug. 2014
Offline
$TY is Y position of point (vertex in Maya), dollar sign belongs to hscript expressions, gradually phased out from H.
Local and global expression variable is about Houdini structure, how Houdini handles the data, it's not about transforms. Let's say global expression variable $F is current frame.
When it comes transforms, H is similar to Maya. rz or ty are local (in parent space) z rotation and y translation. Global transform is not exposed all around like in Softimage, you have to compute it somehow, probably by CHOPs.

Simple way to link parameters (without remapping) is RMB over parameter name, ‘copy parameter’, RMB over another and ‘paste relative references’. Later, you can edit the created expression.
User Avatar
Member
375 posts
Joined: May 2014
Offline
Hi Amm, thanks for the informative answer.

Indeed I'm trying to access global transform and for that I started another thread here : https://www.sidefx.com/forum/topic/57351/?page=1#post-256847 [www.sidefx.com]

Back to the dollar sign question :

I tried to edit my “link with” expression on my test scene's sphere.
- The original one was : fit(ch(“../box_object1/ry”), 0, 180, 0, 5)
- Replaced ry by $ry : fit(ch(“../box_object1/$ry”), 0, 180, 0, 5) > the link with wasn't working anymore.
- Replaced $ry by $RY : fit(ch(“../box_object1/$RY”), 0, 180, 0, 5) > the link with still wasn't working.
- Replaced $RY by RY : fit(ch(“../box_object1/RY”), 0, 180, 0, 5) > the link with still wasn't working.

So it works only with ry. The $RY and ry variables are not the same and each of them are case sensitive.
That's why I'm wondering : in which case should I use one or the other? Is there a doc page about this?

Thanks

$gz
Houdini gamboler
User Avatar
Member
98 posts
Joined: Aug. 2014
Offline
Yeah I think it is explained in docs, while it's not short story, perhaps because of historical reasons.
In practice, let's say if you apply Polywire SOP over something polygonal, it will show something like $NSEG in expression for controlling the segment scale. If I'm correct (could be wrong) $NSEG (number of segments) is a ‘child’ of certain attribute, created by Polywire SOP.
Local variable (uppercase thing) has to be created, to allow h expression to be able to access the data. This is the ‘old way’.

'New way' is in Polyextrude SOP - if you want to control the scale of extrusion distance, you create a zscale primitive attribute using Create Attribute SOP (of course this one goes before Polyextrude SOP), and enable ‘zscale’ into ‘local attributes’ tab of Polyextrude SOP, and that's all.

This was all about mesh components like vertices, points, primitives, details.

When it comes to transforms and channel expressions, local (in parent space) transform is as you said, tx or such, lowercase without $. You'll use $ if you want to access something and combine it with tx. There's expression cookbook [www.sidefx.com] in docs.
Edited by amm - Aug. 12, 2018 13:19:02
User Avatar
Member
375 posts
Joined: May 2014
Offline
Thanks again Amm for your explanations that clarify things, and thanks for the link to the Expression Cookbook, in which I learnt more things.

One more clarification :
tx, $TX, $N, @Frame : are they all “attributes”?
Houdini gamboler
User Avatar
Member
98 posts
Joined: Aug. 2014
Offline
Grendizer
One more clarification :
tx, $TX, $N, @Frame : are they all “attributes”?

Strictly speaking, I'd say no one, tx is parameter, others are variables.

By docs, attributes are named values stored on geometry, like point position, normal, weigthmap, or custom attributes. Parameter is option on a node, like transforms, rendering or viewport visibility options. So, naming and functionality is similar to Softimage, where word ‘attribute’ means ICE geometry attribute.
Attributes are ‘physically’ stored on geometry. If you use Attribute Create SOP (or something else) to create let's say my_attr attribute, and you save that piece of geo to hard disk as .bgeo file, using File SOP, my_attr attribute is saved too, you can use my_attr by loading .bgeo in another scene.
Now, variable… usually this means a named storage space in memory that contains a value we can read or write. In Attribute Create SOP, there's ‘local variable’ option. If this is left blank, Houdini will initialize (initialize = store in memory) a local variable called MY_ATTR. Let's say, variable is a virtual child (whatever that means ) of attribute, raised into memory for immediate use by app - while variable could be created by something else than attribute, which probably is case with @Frame.
Edited by amm - Aug. 13, 2018 15:45:33
User Avatar
Staff
3464 posts
Joined: July 2005
Offline
“tx, $TX, $N, @Frame : are they all “attributes”?”

tx - parameter
$TX - local variable - we're asking people not to use these any more, attributes are better.
$N - local variable - we're asking people not to use these any more, attributes are better.
@Frame - attribute.

the attribute used for a points's position is @P, and you can get the components like this: @P.x, @P.y, @P.z
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
375 posts
Joined: May 2014
Offline
Thanks a lot both of you for your extensive informative and patient replies!!!! I think I get it now… well I hope so
Houdini gamboler
  • Quick Links