Tue, Nov 19, 7:40 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: 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: ActorByInternalName


Dizzi ( ) posted Tue, 24 November 2009 at 4:36 PM · edited Tue, 19 November 2024 at 5:29 AM

Is it just me or is scene.ActorByInternalName() completely useless as it just gets the first actor matching the name rather than the internalname?
E.g. internal name is "BODY:9" but ActorByInternalName("BODY:9") returns "BODY:1"... 



markschum ( ) posted Tue, 24 November 2009 at 5:26 PM

You seem to be correct :)
I put together this script in Poser 7

import poser
scn = poser.Scene()
figs = scn.Figures()
for fig in figs:
    act = fig.Actor("Body")
    print fig.Name(),"  ",act.Name(),"  ",act.InternalName()
print "checking"
act3 = scn.ActorByInternalName("BODY:3")
act2 = scn.ActorByInternalName("BODY:2")
act1 = scn.ActorByInternalName("BODY:1")
fig1 = act1.ItsFigure()
fig2 = act2.ItsFigure()
fig3 = act3.ItsFigure()
print fig1.Name()
print fig2.Name()
print fig3.Name()
print "done"

I got the correct print for the first part but using the act =scn.ActorByInternalName("BODY:3")
failed since it showed Figure1 for all three.

I generally use fig.ActorByInternalName(etc) so I know I am in the rightplace.

Unless I screwed up the python :(


nruddock ( ) posted Tue, 24 November 2009 at 6:06 PM · edited Tue, 24 November 2009 at 6:08 PM

Whether it's intentional or not, that method finds the named actor in the current figure.
The code must be setup to recognise and strip the colon and number.

My guess would be that the scene method is implemented to start with  a call to the ActorByInternalName method of the current figure.
Whether it would check the other figures/props I don't know as I haven't tried to setup a test for that.


Dizzi ( ) posted Tue, 24 November 2009 at 6:29 PM

Well, so it doesn't really do what it should (and not only for me! ;-))

Thanks guys :-) 



semidieu ( ) posted Wed, 25 November 2009 at 6:49 AM

Nice to know this! Thanks for the info!


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.