Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
I can't edit it now, but the title of this thread would more appropriately be "Looking for an actor list selector...". Ideally, it would just be a function call, that returned a list of selected actors.
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.
I think it's a case of making your own dialog using posework's PzrXML library.
The XML generated should be usable in P7, but you'll need to use P6 to create until the library gets recompiled for the new Python version in P7.
Now that tkInter works on Macs, if your script is for P7 only, then it will be easier to do (one or more of ockham's scripts likely has something in).
Thanks - I'm still a python neophyte (been a C programmer for 20+ years though). I assume(d) that something like this was bound to have already been written, so I didn't want to reinvent the wheel if it was already available. Can you even do tree-view gadgets using the PzrXML library? And, where can I find info (docs, etc) on that library?
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.
I have a real nice treeview that I started hacking up for this kind of task.
Attached is a 'proof of concept'. It needs to be rewritten so I can be subclassed for any purpose.
It can support drag and drop.
I settled on this one because it can run under Poser Pro Pack.
I haven't worked on it in some time. I have alot of other projects I working on right now.
I want to release it either GPL or Lessor GPL.
Let me know if you're interested in working on such a project.
Attached Link: http://www.poseworks.com/serendipity/index.php?/categories/4-PzrXml
> Quote - I assume(d) that something like this was bound to have already been written, so I didn't want to reinvent the wheel if it was already available.I'm sure some of ockham's scripts have actor selection.
These will be tk list boxes (with multiselect turned on when appropriate) that are populated at runtime.
Quote - Can you even do tree-view gadgets using the PzrXML library?
Not tree views.
Poser's own dialog stuff is quite limited in scope, posework's library allows dynamic creation, so you can build a list of actors on the fly.
Tree widgets are available (and have been for a long while) for tkInter, but need to find and install them.
Tix has the sort of widgets your wanting (see -> http://tix.sourceforge.net/dist/current/docs/html/TixUser/subsubsection3_3_1_3.html#SECTION00031300000000000000), has Python support and build support for it is part of the Python distribution.
It's not, however part of Poser Python (no DLLs or tcl files), so you have to obtain and install.
Quote - And, where can I find info (docs, etc) on that library?
See attached link.
Thanks, it look like ockhams BVH Mixer might have something I can use.
Tromnek,
That's a spiffy treeview! If I get some time, I'll see if I can dig into it (looks overly complex for what I need it to do, but the interface is certainly there).
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.
Would something like this be what you are looking for? Call SelectActorsFromFigure() and this will give you a selected actor name. Then call GetActorFromFigure() with the same figure object and the name that was returned and you should have a reference to your actor object. Of course you'll want to check that an actor has been selected and the user didn't cancel, but this works for me without having to create any custom dialogs.
def GetActorsForFigure(figure):
actorList = figure.Actors()
return actorList
def GetActorNamesForFigure(figure):
actorList = GetActorsForFigure(figure)
actorNameList = []
for actor in actorList:
actorNameList.append(actor.Name())
return actorNameList
def SelectActorFromFigure(figure):
names = GetActorNamesForFigure(figure)
choice = AskMenu(title="Select Actor", message="Please Select an Actor", options=names)
return choice
def GetActorFromFigure(fig,actorName):
return fig.Actor(actorName)
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.
Howdi,
What I'm looking for is a dialog that will display a list (not drop-down) of all actors of the selected figure, with a select/de-select checkbox (boolean value) for each. I guess something like the tree-view in the Heirarchy window or the .obj Export window might be cleanest - particularly if the top level of each branch would enable/disable the children checkboxes.
This sort of dialog seems like it would be very generally useful for dozens of script applications(performing some acion on the resulting selected actors). I noticed that Cage might have something like that set up in his partial-pose thing, but I'm getting an error trying to run that in P7 (line 48, in findParts - "for i in range(0,len(parts[part])):" - TypeError: len() of unsized object ).
I also note that there's some sort of SimpleDialog.AskActor(), but I assume this is just going to display a drop-down selection list (?).
Anyway, has anyone already come up with such a beast that would work in P7? (bonus if it works in other versions and/or Mac).
Thanks,
Keith
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.