How to quickly move pivot to object center in LOP?
5514 14 7- ysysimon
- Member
- 75 posts
- Joined: 12月 2017
- Offline
- ysysimon
- Member
- 75 posts
- Joined: 12月 2017
- Offline
- CV
- Member
- 46 posts
- Joined: 1月 2016
- Offline
Hi, I would love to know more about this too!
I got a component that is part of a product. (please see image attached) I would love to rotate it around a very specific pivot location, preferably without the use of sop_modify.
Isn’t There a way to define a pivot attribute before importing into lops?
Thanks in advance!
Best
Chris
I got a component that is part of a product. (please see image attached) I would love to rotate it around a very specific pivot location, preferably without the use of sop_modify.
Isn’t There a way to define a pivot attribute before importing into lops?
Thanks in advance!
Best
Chris
- ysysimon
- Member
- 75 posts
- Joined: 12月 2017
- Offline
CV
Hi, I would love to know more about this too!
I got a component that is part of a product. (please see image attached) I would love to rotate it around a very specific pivot location, preferably without the use of sop_modify.
Isn’t There a way to define a pivot attribute before importing into lops?
Thanks in advance!
Best
Chris
I have an idea: calculate the position of the center point by querying the bbx of the current prim through USD's python API, but this seems extremely cumbersome and troublesome.
- elovikov
- Member
- 130 posts
- Joined: 6月 2019
- Offline
Yeah, I think the only way is python api (or vex, but you still need to pull somehow values to parameter).
I have a little example for Transform LOP. Something similar to pivot tool in omniverse.
It's just setting pivot relative to bounding box with exposed controls.
(It's just an example, would be better to package it to little hda to avoid complicated expressions)
I have a little example for Transform LOP. Something similar to pivot tool in omniverse.
It's just setting pivot relative to bounding box with exposed controls.
(It's just an example, would be better to package it to little hda to avoid complicated expressions)
Edited by elovikov - 2022年9月27日 05:28:19
- ysysimon
- Member
- 75 posts
- Joined: 12月 2017
- Offline
elovikovThat's why I love community!Talented people communicate with each other.
Yeah, I think the only way is python api (or vex, but you still need to pull somehow values to parameter).
I have a little example for Transform LOP. Something similar to pivot tool in omniverse.
It's just setting pivot relative to bounding box with exposed controls.
(It's just an example, would be better to package it to little hda to avoid complicated expressions)
Thank you so much for sharing, I was diving for the API in the USD documentation, you saved me a lot.
Edited by ysysimon - 2022年9月27日 10:55:07
- Tim Crowson
- Member
- 249 posts
- Joined: 10月 2014
- Offline
- CV
- Member
- 46 posts
- Joined: 1月 2016
- Offline
Thanks a lot from me as well! These informations are very useful!
But how would you center the pivot inside the circular opening of the strap model I posted above?
Neither center pivot or bbox will work in this case :-)
In the image, I positioned the pivot in Sops with the help of selections and the construction plane. But how do I get the pivot into lops?
Or is this a sop_modify thing?
All the best
Christian
But how would you center the pivot inside the circular opening of the strap model I posted above?
Neither center pivot or bbox will work in this case :-)
In the image, I positioned the pivot in Sops with the help of selections and the construction plane. But how do I get the pivot into lops?
Or is this a sop_modify thing?
All the best
Christian
- ysysimon
- Member
- 75 posts
- Joined: 12月 2017
- Offline
CV
Thanks a lot from me as well! These informations are very useful!
But how would you center the pivot inside the circular opening of the strap model I posted above?
Neither center pivot or bbox will work in this case :-)
In the image, I positioned the pivot in Sops with the help of selections and the construction plane. But how do I get the pivot into lops?
Or is this a sop_modify thing?
All the best
Christian
use the ch function reference them from SOP to move the pivot inside the LOP transform.
This is the way I can think of, because USD seems to store 4*4 transformation matrices directly, and does not store pivot information separately, of course you can author a pivot attribute and use USD pyhton API to access them.
Edited by ysysimon - 2022年9月28日 07:23:04
- cushwa
- Member
- 12 posts
- Joined: 11月 2018
- Offline
- colorbleed
- Member
- 19 posts
- Joined: 1月 2024
- Offline
For me - whenever I use a Transform LOP whenever you customize the `primpattern` parm (Primitive Pattern) at the top then it automatically adjusts the pivot point to the center of the selected primitives.
Note that this occurs when you CTRL+CLICK on the right hand side arrow next to the Prim Pattern field and then select objects in there, and click apply.
I've reported that as a bug since it's really annoying that if you've already done transformations and just want to include an extra primitive that suddenly the pivot changes. However, it does mean that for now that's an easy 'hack' to force the pivot point to bounding box center.
In my bug I've basically requested to implement something like the LOP transforms, so that there are explicit buttons in the UI to "Set the Pivot Point to center" (instead of dynamic evals, etc.)
Note that this occurs when you CTRL+CLICK on the right hand side arrow next to the Prim Pattern field and then select objects in there, and click apply.
I've reported that as a bug since it's really annoying that if you've already done transformations and just want to include an extra primitive that suddenly the pivot changes. However, it does mean that for now that's an easy 'hack' to force the pivot point to bounding box center.
In my bug I've basically requested to implement something like the LOP transforms, so that there are explicit buttons in the UI to "Set the Pivot Point to center" (instead of dynamic evals, etc.)
- LIL01
- Member
- 3 posts
- Joined: 6月 2020
- Offline
I'd really like to see a procedural way of addressing this, e.g. "$CEX $CEY $CEZ".
For me, I have a use case where I use PDG to create a collection of USD's that will be referenced into another USD. Within each, the primpath and transforms vary. Requiring manual clicks by the user or hardcoding anything isn't an option.
For me, I have a use case where I use PDG to create a collection of USD's that will be referenced into another USD. Within each, the primpath and transforms vary. Requiring manual clicks by the user or hardcoding anything isn't an option.
Edited by LIL01 - 2024年2月16日 11:01:28
- EJaworenko
- Member
- 54 posts
- Joined: 6月 2017
- Offline
This definitely seems a bit cumbersome, but for the example of a transform node pivot specifically, the following python function placed in the "px" parm will set the pivot to the center of a selected primitive (py and pz too).
Note that I haven't tested it with multiple prims selected, but it at least fits a few use cases.
I may add a variation of it to a right-click menu just for easy setting vs worrying about adding a python script directly to a parm expression.
Note that I haven't tested it with multiple prims selected, but it at least fits a few use cases.
I may add a variation of it to a right-click menu just for easy setting vs worrying about adding a python script directly to a parm expression.
from pxr import UsdGeom node = hou.pwd() # Get the stage of the input node to avoid recursion stage = node.input(0).stage() if stage is not None: # Other nodes might need "primpath", but you could functionally add any prim path you want here focusprim = stage.GetPrimAtPath(node.evalParm("primpattern")) if focusprim is not None: cache = UsdGeom.BBoxCache(1.0, ['default', 'proxy', 'render', 'guide']) bounds = cache.ComputeLocalBound(focusprim).ComputeCentroid() # node.parmTuple("p").set(bounds) crashed Houdini via recursion, but this seems to work. node.parm("py").set(bounds[1]) node.parm("pz").set(bounds[2]) return bounds[0]
Edited by EJaworenko - 2024年4月26日 17:33:02
Houdini TD, I focus on tools for procedural asset creation.
www.jaworenko.design
www.jaworenko.design
- Hamilton Meathouse
- Member
- 199 posts
- Joined: 11月 2013
- Offline
- wanglifu
- Member
- 186 posts
- Joined: 2月 2017
- Offline
-
- Quick Links