Forum: Poser Python Scripting


Subject: Attaching light to a target

OberonRex opened this issue on Jan 01, 2024 ยท 4 posts


OberonRex posted Mon, 01 January 2024 at 11:12 AM

I have code which creates a point source of light and attaches it to a prop named "target" which, in turn, is parented to another prop. It basically works fine except that the yTran for the new light is off by a bit.  yTran on the target is modified by a Master Parameter called BeamWidth, which seems related.

Here's where I get when I run my script, and you can see that the point light source is *not* centered on the dense ball ("target"). The light is created, parented to target, and then has all its coordinates set to zero. Everything is property aligned except for yTran.

I think that the problem is related to the use of a Master Parameter which is used to move target within a limited range. For this image, the parameters of target look like this: . The yTran of the light is zero and needs to be .004 (!!) in order to be properly centered. No matter where I position the target and no matter how I scale target, the yTran of the light needs to be .004. I'm guessing that somehow I need to factor in the Master Parameter, but I have no clue how, nor do I understand why .004 is the magic number.

Any suggestions?