Forum: Poser Python Scripting


Subject: Logic for an illogicail scripter display order of figures in a scene

grichter opened this issue on Jun 19, 2012 · 4 posts


grichter posted Tue, 19 June 2012 at 7:08 PM

Dah, I guess I need to pay attention that PhilC updated his poser python tut to included wxPython...now I am really going to screw things up :)

 

Question:

If you load say V4 and then M4 and then put some clothes on V4 in that order of operation, in the in the figures list drop down in PP2012 and all other versions of Poser I have going back to P6 (all Mac) the list is shown as...(in the order they were added to the scene)

V4

M4

Clothes conformed to V4

via Python using for fig in scene.Figures(): you end up with the list in the same order.

Is it possible to use Python and reorder-sort the list to show the 1st figure in the scene and the conformers attached to it so the list could end up looking like this:

ie the items confromed to a figure are listed with that figure not in the order in which you loaded them into the scene.

V4

V4 Dress

V4 Shoes

M4

M4 Pants

M4 Shirt

 

write to a file and sort the file is the first thing that comes to mind, but that is getting ahead of my current python skill set,,,but if possible I can figure it out I think. But not sure if it is possible or if there might be a simpiler method a more experienced scripter has up their sleeve.

Just looking for ideas or hints for what directions to consider

TIA for any replies.

Gary

Gary

"Those who lose themselves in a passion lose less than those who lose their passion"


semidieu posted Wed, 20 June 2012 at 8:14 AM

for f in poser.Scene().Figures():

   if f.ConformTarget()==None:

      print f.Name()

      for conform in poser.Scene().Figures():

         if conform.ConformTarget()!=None:

            if conform.ConformTarget().InternalName()==f.InternalName():

               print conform.Name()

   print


PhilC posted Wed, 20 June 2012 at 1:22 PM

I do not think there is Python access to the Poser generated lists. They will be what they will be. You can however as semidieu demonstrates that you can manipulate that list for inclusion in your own lists.


grichter posted Wed, 20 June 2012 at 5:20 PM

thanks guys

Been looking at the code in the script what actor is this and how it determines what is conforming and what is parented.

Thinking of setting up a couple of loops, Grab the first base figure and then get everything conformed to it and then parented to it and skip everything else, then get the second base figure, etc.

Then finally list the loose figures with nothing conformed to them or not confromed to anything and props not parented to anything

 

we shall see if I am pull it off and not crash my computer :)

Gary

"Those who lose themselves in a passion lose less than those who lose their passion"