Sun, Nov 17, 3:31 PM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: Attaching light to a target


OberonRex ( ) posted Mon, 01 January 2024 at 11:12 AM · edited Sun, 17 November 2024 at 1:32 PM

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.

b0prWn0dQ64LoPkKxpBgsL3iScqeFWijwVX2s2UE.png

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: OCMVgtf6hYZ0nRchzEM66CZiPj7qsnTx8sLz5uzm.png. 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?


FVerbaas ( ) posted Mon, 01 January 2024 at 2:31 PM
Forum Coordinator

The origin of the ball mesh geometry may not be in the center of the ball.

In fact, the two are totally unrelated.


OberonRex ( ) posted Mon, 01 January 2024 at 2:50 PM

<a bulb goes on>
Thank you. That was probably exactly the insight I needed. I shall go futz with that and see where I get.


OberonRex ( ) posted Mon, 01 January 2024 at 2:55 PM

That's it!!! When I look at the parameters for the target, I see zyqcuMmIOz8NTIKueJpZldPBr2ZbWBY8Fvf3TK9i.png and there's my ,004. Now for some code adjustments. Thank you again!


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.