Dizzi opened this issue on Nov 24, 2009 · 5 posts
Dizzi posted Tue, 24 November 2009 at 4:36 PM
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
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!