Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
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 :(
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.
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.
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"...