Thu, Jan 2, 6:04 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 Dec 02 3:16 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: "NameError: name 'False' is not defined" - I'm definitely missing something obvi


3dcheapskate ( ) posted Wed, 29 February 2012 at 7:16 AM · edited Wed, 01 January 2025 at 6:49 AM

I'm a very rusty C programmer, and I've just completed my first ever Python script (cheering and applause all round).

I decided to tidy the script up a bit (hisses of indrawn breath and mumblings of "if it ain't broke don't fix it!"), and I've run into some really basic issues that highlight my very limited grasp of the subtleties of Python...

Luckily we had a power cut while I was originally typing this, and in the meantime I found the answer to one of my stupid questions.

But luckily I still have another stupid question in reserve:

I thought that True and False were built-in? (http://docs.python.org/library/intro.html and then hit 'next', then 'bool()').

So why do I get NameError: name 'False' is not defined when I try to use False?


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



bagginsbill ( ) posted Wed, 29 February 2012 at 7:32 AM · edited Wed, 29 February 2012 at 7:32 AM

The Boolean type was added in Python 2.3. You didn't say which version of Poser you have, but it must be one of the older ones, such as Poser 6, that use old Python interpreters.

I don't know which Poser got Python 2.3 in it, but it was probably Poser 7???

Meanwhile, it's easy to fix. Use the code fragment shown here:

http://tomayko.com/writings/TrueFalseInOldPython

Note: It helps us answer better if, when you post a question, you always say which version of Poser you're dealing with and which OS.


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)


3dcheapskate ( ) posted Wed, 29 February 2012 at 7:53 AM · edited Wed, 29 February 2012 at 7:55 AM

That'd be it - I'm using Poser 6 on Win7, so an early Python. The code you linked to fixes it, thanks.

I'd assumed I was using Python 2.6 since I've got it installed separately (E:/Python26). Hadn't realised that Poser was using a different Python (just spotted it at E:/e frontier/Poser 6/Runtime/Python)

And I originally had "Poser6:" at the start of the subject line, but forgot it when I retyped after the power cut - apologies for the oversight.


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



nruddock ( ) posted Wed, 29 February 2012 at 1:03 PM

Quote - I'd assumed I was using Python 2.6 since I've got it installed separately (E:/Python26). Hadn't realised that Poser was using a different Python (just spotted it at E:/e frontier/Poser 6/Runtime/Python)

Because Poser has native modules embedded in the EXE, it must use it's own version of Python not any other that you might have installed. In fact Poser's Python is completely invisible to and (usually) unaffected by other Python installs.


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.