Mon, Feb 10, 10:59 AM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2025 Feb 05 6:41 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: Figure Number in PoserPython?


Cage ( ) posted Fri, 28 October 2005 at 1:34 AM · edited Sun, 09 February 2025 at 9:34 PM

I'm trying to develop a method to correctly apply JCM pointer poses using Python. This requires that I be able to determine the internal figure number for the parent/target figure. But PoserPython doesn't seem to have any tool to query the figure numbers. I thought I could work around it by assigning a new figure name, but I can't seem to locate anything that will do that, either.... Does anyone know any secret methods or tricky workarounds that might help me with this? I need to find the internal figure number, by which I mean the numbering applied internally to figures in the order in which they load in Poser. example: Figure 1 BODY:1

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.  He apologizes for this.  He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.  His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


mkrueger ( ) posted Fri, 28 October 2005 at 12:11 PM

Hi!

Try this:

  • get the actors list for the current figure:

actors = poser.Scene().CurrentFigure().Actors()

  • loop through the actors and get the first one which is a body part with the "IsBodyPart" method

  • the internal name of the actor should be PartName:FigureNumber

so you should be able to extract the figure number after the colon

hope that helps

martin


Cage ( ) posted Fri, 28 October 2005 at 2:36 PM

That's a great idea! I was not aware that the number was addended to the internal body part names like that. I'll try it. Thank you!

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.  He apologizes for this.  He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.  His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


Cage ( ) posted Fri, 28 October 2005 at 2:54 PM · edited Fri, 28 October 2005 at 2:56 PM

There's a complication with the suggested approach. I can't make any comparative statements to determine what number is addended to a body part, because PoserPython returns values in computerese. :) It's internal way or thining about things doesn't seem to resemble any of the ways it annotates those thoughts. (Kind of reminds me of myself, that way....)

So, fool that I am, I'm stuck. Now I need to ask if there is a way to convert this list of Actor objects to a list of body parts that can be read. I assume that's some kind of value to string conversion, but I'm not sure these listed parts count as integer values, so I have no idea how to approach the matter....

Am I missing an obvious approach?

Code:

#Find internal figure number----(Thanks, mkrueger!)---------------------------
actors = poser.Scene().CurrentFigure().Actors()
print actors

Result:

[, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ] Well, the list doesn't show up in the post, so I'm addending a text file to the next response....

Message edited on: 10/28/2005 14:56

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.  He apologizes for this.  He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.  His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


Cage ( ) posted Fri, 28 October 2005 at 2:57 PM

file_300030.jpg

Here's the resulting list of actors.

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.  He apologizes for this.  He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.  His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


mkrueger ( ) posted Fri, 28 October 2005 at 5:18 PM

file_300031.jpg

Hi! What you get is a list of Actor objects. So you have to call the method "InternalName()" for each of this object to retrieve the actual string. I appended a short code fragment that extracts the number. martin


Cage ( ) posted Sat, 29 October 2005 at 1:37 AM

D'Oh! I just spent all afternoon creating a "counter" method which would keep track of the figure numbers for me. It looks like this will be much simpler. Life's kind of a bummer when you're always just smart enough to keep doing things the hard way.... :) Thank you! Hopefully I'll fare better with this example than I did with the last one. Underestimating me is overestimating me, it seems. :)

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.  He apologizes for this.  He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.  His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


Cage ( ) posted Sun, 30 October 2005 at 1:12 AM

"Addend" is not a verb. Thank you to an anonymous guardian of the whaddaycall vocabu-mo-lary. Note to others: Don't be like me!

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.  He apologizes for this.  He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.  His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


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.