Mon, Sep 9, 6:44 AM CDT

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 08 5:10 pm)

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: Script working in Windows but not in OSX


papillon68 ( ) posted Tue, 28 September 2010 at 2:53 PM · edited Sun, 08 September 2024 at 5:34 AM

Attached Link: billboarding.py

Attached here is a simple script for billboarding: it works fine in all Windows Poser versions, while in OSX it works only on Poser 7 and Poser Pro. On Poser8 and Poser Pro 2010 (OSX versions) it crashes as I start to move the camera.

Maybe someone could confirm the above behaviour and maybe understand why that happens ?
Thanks you

visit my blog:  www.alessandromastronardi.com

My Rendo Store


nruddock ( ) posted Tue, 28 September 2010 at 3:30 PM

Getting a "403 Forbidden" when trying to download script.


semidieu ( ) posted Tue, 28 September 2010 at 3:33 PM

I also have often problems with OSX compatibility... I found that Python on OSX is much more sensitive than on PC...

Also 403 forbidden for me :)


papillon68 ( ) posted Tue, 28 September 2010 at 3:36 PM

Sorry guys, now the link is fixed.

visit my blog:  www.alessandromastronardi.com

My Rendo Store


markschum ( ) posted Tue, 28 September 2010 at 3:53 PM

this bit  seems to be in twice - should not do any harm though

import poser
scene = poser.Scene()


bagginsbill ( ) posted Tue, 28 September 2010 at 4:16 PM

Uh - notwithstanding the issue of it not working on OSX, I don't see how this works at all.

To calculate which way the billboard should face, you have to compute the vector from the billboard to the camera.

Consider a camera that is at 0,0,0.

Consider two billboards - one that is north of the camera (-z) and one that is south of the camera (+z). These two billboards must face in opposite directions. The northern one must face south, and the southern one must face north.

Further, consider the dolly camera. When it rotates, it doesn't move - it just points to a different place in the scene. A billboard that is always facing this camera should not rotate just because the camera has rotated. It should rotate when the camera moves.


Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)


PhilC ( ) posted Tue, 28 September 2010 at 4:21 PM

Its not a very big deal, but that is one of the example scripts that is included with my Python for Poser Manual. I'm not suggesting that I have copyright on every code block under the sun, rather the manual and its examples is intended to help you write your own scripts. Duplication of standard routines is inevitable and to be expected. I would however prefer that the scripts not be redistributed cart blanch or as in this case with just my explanatory header removed.

Yes it does appear that I have "typo-ed" and included the import and scene lines twice.

Can not say at this point why its not working on a Mac other than to echo  semidieu's comment that Mac Python can by picky.


papillon68 ( ) posted Tue, 28 September 2010 at 4:31 PM

Sorry about that Phil: I just copied and pasted the billboard section from a longer python script I'm doing in a new file, forgetting to put your author header.
I reuploaded the file with the header included. If you wish the file to be removed, please tell me and I will do it...

visit my blog:  www.alessandromastronardi.com

My Rendo Store


PhilC ( ) posted Tue, 28 September 2010 at 4:38 PM

Its OK, its not a big deal.


papillon68 ( ) posted Tue, 28 September 2010 at 5:46 PM · edited Tue, 28 September 2010 at 5:56 PM

Quote - Uh - notwithstanding the issue of it not working on OSX, I don't see how this works at all.

To calculate which way the billboard should face, you have to compute the vector from the billboard to the camera.

Consider a camera that is at 0,0,0.

Consider two billboards - one that is north of the camera (-z) and one that is south of the camera (+z). These two billboards must face in opposite directions. The northern one must face south, and the southern one must face north.

Further, consider the dolly camera. When it rotates, it doesn't move - it just points to a different place in the scene. A billboard that is always facing this camera should not rotate just because the camera has rotated. It should rotate when the camera moves.

Hi BagginsBill, most examples I found about billboarding techniques in general, they take into account only camera rotations (checked also some opengl tutorials on gamedev.net).
Afterall, if you move away the quad in front of you, say to your right, before it disappear from sight, even if it's not billboarding you won't notice it.

visit my blog:  www.alessandromastronardi.com

My Rendo Store


bagginsbill ( ) posted Tue, 28 September 2010 at 8:00 PM

I'm not at all tracking what you're saying.

All the discussions of the technique on gamedev speak of camera position relative to the billboard quad, not camera orientation.

Example: http://www.gamedev.net/community/forums/topic.asp?topic_id=411132

Specifically, a ring of billboards surrounding the camera would all be facing the camera, each with a different normal. In the algorithm you're using, they'd all be facing in the same direction, with the same normal.


Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)


bagginsbill ( ) posted Tue, 28 September 2010 at 8:04 PM

Here's another one - uses camera position.

http://www.gamedev.net/community/forums/topic.asp?topic_id=452635


Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)


bagginsbill ( ) posted Tue, 28 September 2010 at 8:10 PM

I see some people using the view plane, not the view position. This is equivalent to what you're doing. But they note that it's not the same, and comment that it is "good enough". Maybe it is for some things. If, however, you have a wide angle camera, I doubt it's good enough.

http://www.gamedev.net/community/forums/topic.asp?topic_id=583098

The OP says:

Quote - Thanks for the quick answer. I had to revert the order (first rotate, then translate) but now it works. I assume this method doesn't align the billboards towards the view point, but the view plane instead, though this shouldn't really be a problem for me: It looks good enough.

But then another poster points out the camera position formula.

This article explains the difference quite well, and illustrates what is wrong with ignoring the camera position:

http://www.flipcode.com/archives/Billboarding-Excerpt_From_iReal-Time_Renderingi_2E.shtml

About halfway down it explains the difference between viewplane aligned and view point aligned and why it matters. Perhaps it's OK for the scenario you plan to use, but the anal retentive in me would force me to do it right.


Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)


papillon68 ( ) posted Wed, 29 September 2010 at 3:27 AM

BagginsBill, I totally misunderstood your first point, now I see what you meant. Thanks for those links about billboarding, indeed they show in detail how to achieve that and explain the theory behind it.
I will try to build a billboarding routine following those, expect more disturbing question :-)

visit my blog:  www.alessandromastronardi.com

My Rendo Store


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.