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!
Constrain to a point???
21214 6 4- etudenc
- Member
- 15 posts
- Joined: July 2010
- Offline
- etudenc
- Member
- 15 posts
- Joined: July 2010
- Offline
- old_school
- 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).
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!
- etudenc
- 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!
Again, thank you for such a detailed answer!
- old_school
- 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.
See the attached example file.
There's at least one school like the old school!
- circusmonkey
- Member
- 2624 posts
- Joined: Aug. 2006
- Offline
- circusmonkey
- Member
- 2624 posts
- Joined: Aug. 2006
- Offline
-
- Quick Links