Hi
So within the stage context how you you go about getting an object to sit on the ground. Adding a transform and typing $YMAX does not work in stage. Im trying to make a lookdev tool, so want any object that comes in to be processed to “sit on the ground” rather than through the ground.
Best
Mark
how to get an object to sit on the ground $YMAX not working
6215 2 2-
- Mark Wallman
- Member
- 824 posts
- Joined: 8月 2013
- オフライン
-
- jason_iversen
- Member
- 13324 posts
- Joined: 7月 2005
- オンライン
Here's a snippet of something I was messing with - if you have extentHints authored. Perhap you can bend it to your will? YMMV…
That said, I think LOPs could use some nice alignment/match-size/etc style tools.
from pxr import UsdGeom, Gf
# resolve your 'prim'
# transform to the centroid of XZ and the floor of Y
xh = prim.GetAttribute("extentsHint").Get()
if xh:
xform = UsdGeom.Xform(prim)
xform.ClearXformOpOrder()
t = xform.AddTranslateOp(opSuffix="center")
dx = (xh[1][0]+xh[0][0])/2
dz = (xh[1][2]+xh[0][2])/2
dy = xh[0][1]
t.Set(Gf.Vec3d(-dx,-dy,-dz))
That said, I think LOPs could use some nice alignment/match-size/etc style tools.
Edited by jason_iversen - 2020年6月2日 23:33:48
Jason Iversen, Technology Supervisor & R&D Lead @ WetaFX
-
- jsmack
- Member
- 8381 posts
- Joined: 9月 2011
- オフライン
-
- Quick Links

