Search - User list
Full Version: how to get an object to sit on the ground $YMAX not working
Root » Solaris and Karma » how to get an object to sit on the ground $YMAX not working
Mark Wallman
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
jason_iversen
Here's a snippet of something I was messing with - if you have extentHints authored. Perhap you can bend it to your will? YMMV…
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.
jsmack
jason_iversen
That said, I think LOPs could use some nice alignment/match-size/etc style tools.

Indeed, that match size sop from the a couple releases back has become quite clutch. It would make a fine addition to LOPPERs.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB