Sat, Nov 30, 3:50 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: All null string group names and inability to programmatically add new groups?


rrkknight3 ( ) posted Fri, 04 July 2008 at 7:43 PM · edited Sun, 17 November 2024 at 3:12 AM

I've been trying various things with groups in Poser Python (both Poser 7 and Poser Pro) and I'm puzzled.  I'd appreciate hearing any observations that the forum members might have.

Let's say that the current actor is the head of the mannequin figure.  Then this code

actor = poser.Scene().CurrentActor()
geom = actor.Geometry()
print geom.Groups()

produces

['', '']

while launching the Grouping Tools shows that there are two groups named "head" and "neck".

Shouldn't that call to Groups produce the same thing?

On the other side, I don't see a way to produce new groups on the fly, either.  The Polygon method IncludeInGroup appears to require that the group already exist.  Or at least, I get

poser.error: No group bit for specified group name. No such group for this actor?

when I try.


PhilC ( ) posted Fri, 04 July 2008 at 8:17 PM

If you import the figure's OBJ file and run the script you'll see the groups listed.

If you use the grouping tool to add groups to the mannequin's head then run the script you'll see the new groups listed.

If you use the IncludeInGroup method be sure to first use the RemoveFromGroup method first.

You are correct there is no current Python method to add new groups.


rrkknight3 ( ) posted Sat, 05 July 2008 at 7:50 AM

Thanks for responding so quickly.

I believe that I've understood everything you said except the directions to do a RemoveFromGroup first. 

Is this a programmer's suggestion, for tidiness sake, pointing out that I need to go through and clean up the old group's polygon assignments before adding the new ones or is this a Poser Python expert's statement because of something in the operation of Poser Python?

Almost all of my experiments with this have worked without doing the RemoveFromGroup.  I'm still chasing a weirdness with reloading a pz3 file.


PhilC ( ) posted Sat, 05 July 2008 at 7:37 PM

When I was writing OBJ2CR2 I found that I needed to remove from group before adding to another group. I forget exactly what the problem was if I didn't, just that the solution was to remove first :)


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.