Thu, Sep 19, 6:37 PM CDT

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: How to select all figures in a group


maur_2005 ( ) posted Mon, 24 February 2020 at 11:22 AM · edited Thu, 01 August 2024 at 7:46 PM

Hi folks, I'm trying to select all figures in a Grouping and I need your help with this code

scene = poser.Scene()
group1 = scene.SelectActor(scene.Actor("Grouping 1"))

It doesn't work, what's wrong?


structure ( ) posted Mon, 24 February 2020 at 7:42 PM
Forum Coordinator

"grouping 1" is not an actor, (you can check this by looking in the props dropdown) it cannot be selected using SelectActor,

what you can do ( there may be a better way ) is parent all the figures to one figure or prop and move the parent.

Locked Out


maur_2005 ( ) posted Mon, 24 February 2020 at 10:23 PM

thanks for your reply, I have a lot of scenes where the figures are already grouped.. Is there any way to select the figures from the group? or what is the right way to select a group in python?


structure ( ) posted Tue, 25 February 2020 at 12:44 AM
Forum Coordinator

it depends on what you are doing, grouping (if memory serves ) allows you to group actors for rigging

Locked Out


ironsoul ( ) posted Tue, 25 February 2020 at 2:55 AM

Hello @maur_2005, can you provide a screen shot of the group?



adp001 ( ) posted Tue, 25 February 2020 at 7:35 AM · edited Tue, 25 February 2020 at 7:35 AM

structure posted at 2:29PM Tue, 25 February 2020 - #4381745

"grouping 1" is not an actor, (you can check this by looking in the props dropdown) it cannot be selected using SelectActor,

???

Into a fresh loaded Poser scene I added 2 Groups. And parented a prop to the second Group.


print [ac.Name() for ac in sc.Actors()]


gives me:

[u'UNIVERSE', u'FocusDistanceControl', u'GROUND', u'Grouping 1', u'Arch_1', u'Light 1', u'backlight', u'aera', u'x 1', u'Main Camera', u'Aux Camera', u'Posing Camera', u'Dolly Camera', u'Left Camera', u'Right Camera', u'Top Camera', u'Bottom Camera', u'Front Camera', u'Back Camera', u'Face Camera', u'LHand Camera', u'RHand Camera', u'Shadow Cam Lite 1', u'Shadow Cam Lite 4', u'Shadow Cam Lite 2', u'Shadow Cam Lite 1', u'Grouping 2']

sc.Actor("Grouping 2")

returns an actor and I can select this actor.




adp001 ( ) posted Tue, 25 February 2020 at 9:33 AM

To find out what is contained in a group (or parented to a prop), use

print [ac.Name() for ac in poser.Scene().Actor("Grouping 1").Children()]





structure ( ) posted Tue, 25 February 2020 at 11:03 AM · edited Tue, 25 February 2020 at 11:03 AM
Forum Coordinator

Thanks adp, I could not figure that part out.

Locked Out


maur_2005 ( ) posted Tue, 25 February 2020 at 3:03 PM

Thanks Adp that code works pretty well, but the only problem is that it returns a list of actors instead of a list of figures. For example, returns:

Room, Studio_A, Body, Body, Body, Body


adp001 ( ) posted Wed, 26 February 2020 at 12:19 AM

Body actor stands for the figure. The body actor has no other task (also no geometry). Probably the programmers have included the body actor as a child in the chain, so that only actors are included and all objects can be edited with the same interface methods.

As you can learn from the manual, every actor has a method "ItsFigure", which helps you to find out to which figure it belongs.




maur_2005 ( ) posted Wed, 26 February 2020 at 12:37 PM

Thanks adp001, that was useful


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.