Forum: Poser - OFFICIAL


Subject: Point-at questions

moogal opened this issue on Mar 26, 2013 · 12 posts


ockham posted Wed, 27 March 2013 at 7:18 AM

Here's a script that does the job in a basic way.  Turns the tree (Yrot only) to face the currently selected camera.

It doesn't require any EndPoint setting; just requires a typical billboard tree.   Be sure the tree does NOT have PointAt turned on.

import poser
import math
scene=poser.Scene()
tree=scene.CurrentActor()
cam=scene.CurrentCamera()
scene.DrawAll()
tX,tY,tZ=tree.WorldDisplacement()
cX,cY,cZ=cam.WorldDisplacement()
rads=math.atan2( (cX-tX), (cZ-tZ) )
degs=rads * 180/math.pi
yr=tree.ParameterByCode(poser.kParmCodeYROT)
yr.SetValue(degs)
scene.DrawAll()

My python page
My ShareCG freebies