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
5132 2 2-
- Mark Wallman
- Member
- 736 posts
- Joined: Aug. 2013
- Online
-
- jason_iversen
- Member
- 12986 posts
- Joined: July 2005
- Offline
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 - June 2, 2020 23:33:48
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
also, http://www.odforce.net [www.odforce.net]
-
- jsmack
- Member
- 8173 posts
- Joined: Sept. 2011
- Offline
-
- Quick Links