Mon, Dec 23, 1:29 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: Poser 7: Python manual differs from reality


Anthony Appleyard ( ) posted Fri, 20 November 2009 at 6:48 AM · edited Thu, 25 July 2024 at 3:15 AM

I have Poser 7.0.4.220 . I am writing a Poser script which includes:

scn = poser.Scene()
...
acs=scn.Actors()
for ac in acs:

and my Poser's Python manual saps for screentype.Actors() -:

Get a list of the non-figure actor objects in the scene. Actors are items that populate the scene such as props, cameras, lights, or deformers. They can also be body-parts of a figure, although body-part actors will not be returned in this list. To get a list of actors belonging to a figure, use the Actors() method for a figure object.

but when I ran the script it listed all actors including those that were parts of a character who was on stage. How can a Python script separate actors thart are part of a character from other actors? If I loop over all figures, then in each figure I loop across all actors which are in that figure, I would miss any actors which are not part of a figure.


adp001 ( ) posted Fri, 20 November 2009 at 7:28 AM

acs=[ac for ac in acs if not ac.IsBodyPart()]




bagginsbill ( ) posted Fri, 20 November 2009 at 9:05 AM · edited Fri, 20 November 2009 at 9:08 AM

I just ran into this myself the other day. The Actors() method returns all actors, despite what the doc says.

So to find all actors, there is no need to loop over figures.

To filter out things from figures, you actually have to do more than check IsBodyPart. DAZ Vickie 4.2, for example, causes the list to return a bunch of things that are not body parts, but other things that are parts of figures. Things like bases, zones, deformers, goalcenterofmass, etc.

The things we actually see in Poser UI for choosing the current actor include body parts and what I call "ordinary props". You can test for IsBodyPart pretty easily, but there is no handy IsOrdinaryProp, such as the list you get in Poser when you choose a Prop.

Then, of course, there are cameras and lights, etc.

So I wrote this function to determine if an actor is an ordinary prop. Seems to work.

def isOrdinaryProp(actor):<br></br>
 if actor.IsCamera() or actor.IsLight() or actor.IsBase() or
actor.IsBodyPart() or actor.IsZone() or actor.IsDeformer() or not
itemHasMaterials(actor):<br></br>
  return False<br></br>
 return True<br></br>


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 Fri, 20 November 2009 at 9:06 AM

The itemHasMaterials method is this:

def itemHasMaterials(item):<br></br>
  try:<br></br>
    return item.Materials()<br></br>
  except:<br></br>
    pass<br></br>


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)


markschum ( ) posted Fri, 20 November 2009 at 10:03 AM

There are a number of errors in the Python documentation.


jdredline ( ) posted Fri, 20 November 2009 at 10:59 AM

I just wanted to say how great it is see BB back in the forums!



bagginsbill ( ) posted Fri, 20 November 2009 at 11:31 AM

?    ... When did I leave?


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)


jdredline ( ) posted Fri, 20 November 2009 at 12:17 PM

Okay, it's the first time I ran into you again. 



Anthony Appleyard ( ) posted Fri, 20 November 2009 at 1:28 PM

How can a Poser Python script ask the user to input a text string?


markschum ( ) posted Fri, 20 November 2009 at 3:05 PM

Its in the simple dialog methods. dIALOGTEXTENTRY page 130 of the P7 pdf file.


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.