Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)
I don't think there is a way.
What you can do with the XML is limited compared to tkInter.
I can't remember seeing a multi-select list box anywhere is the Poser GUI, so there aren't any examples to even look at.
We can only hope that EF expose more of their internal GUI API or wxWindows in future versions.
I guess the closest thing I can think of to a multi-select listbox is the dialogue for choosing which props in a scene you want to export, or the pose saving dialogue "select subset" for choosing body parts and dials that should go in the pose. It has a hierarchical tree inside a scrollbox
View Ajax's Gallery - View
Ajax's Freestuff - View
Ajax's Store -
Send Ajax a message
There is a P6 interface list box (not a hierarchical Tix tree) when saving a material collection. Basically a scrollbar and a collection of checkboxes. I haven't figured out (yet?) how it works.
If someone DOES find out, I'd be really happy to know about it. Several of my scripts could take advantage from a scrollable client area!
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
Apologies are in order.
Having taken a look at "Dlg_SelectMaterials.xml" and doing a search for widgetProcID="31", the other places that a scrollfield turns up are "walkDesign.xml" (another with a vertical scroll bar) and "scenePalette.xml" (a horizontal scroll bar).
The way the walk designer uses it suggests that it acts like a generic container, i.e. all the widget elements enclosed by the scrollfield widget element are the contents that appear when the dialog is shown.
In the case of the walk designer, it's a fixed list of other widgets, so generating something on the fly should be possible by using some PzrXMLTag objects to generate the 3 slider grove widgets and the scrollfield.
Will have to investigate if it's possible (and useful) to set a callback on them.
Ajax, without distributing copyrighted code, the Mac version of faceoff's Occlusion master (which I wrote the Mac UI for) displays a scrolling list of materials (and associated editable numeric fields and checkboxes) in a dialog. It does this "the hard way" with essentially manual list processing, i.e. generic widgetProc based. As far as I could find, the P6 interface list box mentioned by svdl does not return the requisite interaction widgetProc callbacks in its current incarnation, so I gave up using it. I resorted to manually implementing a fixed length table (text and check box widgets) and implementing scroll and page buttons to index the material list and update the visible portion of the list as required (including all the tedious beginning/end/empty condition testing). As nruddock suggests, it is eminently possible to simulate the "look and feel" of the SelectMaterials dialog, but its operation, at the moment, would not easily include the incremental pixel scrolling of a true list widget. Maybe some arm twisting eF's way would see P7 with fully fledged "winged?" Python widgets. [Please, Oh! Please update to a recent wxWidgets library) ;-) Cheers, ----GeoffIX----
Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.
Thanks Geoff.
I've finally implemented your suggestion for getting the true (visible) setting on dials so I can accurately save poses with ERC - it works beautifully!!
The script supports animated poses now too.
The only thing holding me up is the UI for the script. I plan to make this a redistrubutable script like the last one, so I'm starting to think that pzrXML is a bad idea because I can't redistribute Poseworks's module that it requires, let alone pass on redistribution rights to others. I'm reluctant to go back to Tk because I know some Mac uses have trouble with it and I'm keen to make the script cross platform. I'm not very experience with Python UI building (i.e. working on PoseSave is all the experience I have). I know nothing about XML.
The way I'm reading what you guys have been saying, I don't actually need Poseworks's stuff to build a cross platform XML interface with the same look and feel as Poser, as long as I'm willing to put in the effort and accept some workarounds on things like scrolling lists. Is that right?
View Ajax's Gallery - View
Ajax's Freestuff - View
Ajax's Store -
Send Ajax a message
I would also echo a request that e-frontier expose a full GUI function to us. When I developed Poser Tool Box I did a lot of experimenting to see what was possible. The results I made into an example script for my future reference. This will probably benefits us all if we each share what we know. I'd rather not put a link to the file in this thread but if anyone would like to email me I'll be happy to reply with the script attached.
My hope is that we can together expand it into a definitive and freely available Poser GUI "how to".
pcooke@philc.net
Actually, I can't make it available (I need to clean the code and remove personal code). But as soon as my main app is finished, I will clean it to make it available to everyone.
PhilC: For the radio buttons... here is the trick (if you didn't find it already). Everythin is coded in the xml file.
1° set the radio buttons in one unique groupID.
2° set the behaviorProcID value to 2.
And... it's finished ! The "behaviorProcID" says: only me is selected, all radiobuttons in the same group must be unselected !
Hope it helps... Also, there are some other "xml tags" that might be useful. But still need to test it !
Looked through and with the exception that I've got the list of buttons hard coded and you have the script to generate the list and write the temp XML we are pretty much the same. The widget list does go where I thought it should within the widgetProcID 31 Scroll field.
Looked at mine, looked at yours, looked and looked .....then .... removed the comment line from mine ... AND IT WORKED.
It was the comment line that was screwing it up. Go figure.
Now if y'all excuse me a moment whilst I reflect over the past two days and scream into a brown paper bag.... AGGGGGGGGGGGGH!
OK much better.
Many, many thanks :)
I told semidieu, so I'll tell the rest of you "old stalwarts", I'm in the process of writing what I hope will be a comprehensive Python for Poser manual. The manual I would have killed for when I started scripting.
It will not boast to be the most sophisticated Python book out there but hopefully the easiest to understand.
"Written by an ex-plumber in such a way that a carpenter can understand it".
Lots of pictures, lots of example scripts. If any one of you above would like to take a preview please email me and I'll be happy to email back a link. I anticipate the final work will be sold from my store but I know I can count on your disgression.
Again thanks ... I can now regain my sanity and progress :)
A comprehensive Poser Python manual? Now THAT would be handy indeed!
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
Attached Link: http://www.runtimedna.com/mod/forum/messages.php?forum_id=95&ShowMessage=324364
And for those that are still interested, I post a new thread on RuntimeDNA with the script attached.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.
I'm updating my old PoseSave script (animation support is the main goal in version 2) and I want to use Poseworks's xml interface instead of TKinter.
I need to create a list of all body parts in the currently selected figure, so that users can choose which body parts they want in the pose. On first glance, I can't see how to do that. I know I can create a checkbox list, but how can I put it inside a scrolling window? The body part list could potentially be too long to display on the user's screen.
View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message