Jump to content
jackassol

Pivot at the bottom of an object

Recommended Posts

Hej guys- I am looking for a way, to move the pivot of a "transform node" to the bottom of the of an animated! geometry.

 

What i tried:

 

image.thumb.png.270c24df497ed81f44e3c053268422c1.png

 

It's working, but only in the first frame - since my object is moving the left - the pivot don't move with the sphere. 

 

image.thumb.png.86c72147a2d5c9cfae72e4d0f11423c9.png

 

Any ideas?

 

Best jack

 

 

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites
Posted (edited)

Write this into your pivot translate to get the minimum y position of the input geo:

bbox(opinputpath(".", 0), D_YMIN)

opinputpath(".", 0) gets the path of the first input of the current node. https://www.sidefx.com/docs/houdini/expressions/opinputpath.html

bbox() returns the bounding box info of a node, in this case we want to use "D_YMIN" to get the minimum y position. https://www.sidefx.com/docs/houdini/expressions/bbox.html

 

edit: forgot to add the centroid expressions for the x and z values, see Tomas' reply below

Edited by markingleukc

Share this post


Link to post
Share on other sites

what you are doing with your bbox(0, 1) in Y is just making sure that your pivot's Y coordinate has the same value as the bottom of the geo

however since your animation seems to be in XZ plane, Y doesn't change therefore pivot will not move

you can put following expressions to px | py | pz: centroid(0, 0) | bbox(0, 1) | centroid(0, 2)

to center pivot in XZ and move to bottom in Y 

Edited by anim

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

×