Constrain to a point???

   21214   6   4
User Avatar
Member
15 posts
Joined: July 2010
Offline
Hello, all,

This is probably dead simple, but for some reason I can't make it work.

I just want to constrain an object to the specific point position of another object in the same SOP. To clarify, I've created two poly spheres in a geo node. I want to get the world position values of a point on sphere A and pass those values to the XForm node of sphere B so that sphere B moves to that point position.

I see the Px Py and Pz values in the spreadsheet for , but if I enter

ch(“../group1/tx”)

or

ch(“../group1/Px”)

or a number of other variants in the XForm translate channels, I just get errors.



Any hints? Thanks in advance!
User Avatar
Member
15 posts
Joined: July 2010
Offline
Ah, one way is to use an expression in the translate channels.

point(“../sphere1”,4,“P”,0)
point(“../sphere1”,4,“P”,1)
point(“../sphere1”,4,“P”,2)
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Rivet Object.

If you tab-type rivet in the viewport, it even allows you to select the point(s) to constrain your object to.

If it is one point you select, you get a single point constraint. You can choose the option to orient to N normal and UP if present on the geometry.

Selecting two points constrains your object to the vector built by the two points.

Selecting three or more points will constrain your object wrt Translation and Rotation.

With two and three point selections, you can use the u and v parameters or use the viewport handle to position where you want your object to constrain to.

If you do choose to use the point() expression approach, this is generally not enough. If you are constraining objects to geometry, invariably the target object is going to be in a transform hierarchy. You need to add the point() expression to a vtorigin() expression to pick up the object transforms.

point(“/obj/sphere_object/sphere1”,4,“P”,0) + vtorigin(“”, “/obj/sphere_object”)
point(“/obj/sphere_object/sphere1”,4,“P”,1) + vtorigin(“”, “/obj/sphere_object”)
point(“/obj/sphere_object/sphere1”,4,“P”,2) + vtorigin(“”, “/obj/sphere_object”)

and the same for the rotates.

As with all things Houdini, there are many ways to create geometry constraints. Creative use of the Object Transform in a net new object to bake out the transforms and build your geometry constraints in there will eliminate the need for the vtorigin() expressions above is one that comes to mind.

Rivet Object does it 99% of the time for object to geometry constraints plus it is very efficient (fast).
There's at least one school like the old school!
User Avatar
Member
15 posts
Joined: July 2010
Offline
Thank you so much for the guidance, Jeff. I had no idea about the vtorigin information - very good to know! I had tried to use the Rivet but I wasn't crazy about the fact that it appeared to create the Rivet at the scene level… I felt it should happen at the object level, inside the SOP.

Again, thank you for such a detailed answer!
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Ahhh if you are wishing to constrain geometry to a point inside SOPs, then I'd argue that the Object Merge set up with the Transform Space set to “This Object” and using a point group in the original object, fetching just that point would be more efficient than using point() and v?origin() expressions.

See the attached example file.

Attachments:
point_constraint_with_object_merge_sop.hip (95.1 KB)

There's at least one school like the old school!
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Had to bring back this interesting thread. vtorigin and vrorigin rock the house ! Hell I even made a demo file

r

Attachments:
extracttransforms.hip (73.5 KB)

Gone fishing
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Here is another scene file showing the same thing using chops . From Rangi

rob

Attachments:
extracttransforms_rs.hip (102.3 KB)

Gone fishing
  • Quick Links