Sat, Jan 11, 2:08 PM 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 Dec 02 3:16 pm)

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: Poseworks's poser XML - how do you make a list box?


Ajax ( ) posted Thu, 08 June 2006 at 7:19 PM · edited Sat, 11 January 2025 at 2:00 PM

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


nruddock ( ) posted Fri, 09 June 2006 at 3:42 AM

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.


Ajax ( ) posted Fri, 09 June 2006 at 3:58 AM

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


svdl ( ) posted Fri, 09 June 2006 at 12:44 PM

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

My gallery   My freestuff


nruddock ( ) posted Fri, 09 June 2006 at 3:31 PM

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.


an0malaus ( ) posted Sun, 11 June 2006 at 9:03 AM

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----



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


Ajax ( ) posted Sun, 18 June 2006 at 8:12 PM

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


PhilC ( ) posted Wed, 21 June 2006 at 6:49 AM · edited Wed, 21 June 2006 at 6:52 AM

file_345918.gif

Hi Folks,

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


semidieu ( ) posted Mon, 08 January 2007 at 3:09 PM

file_364879.jpg

Ok... here is my little contribution... Thanks to PhilC and Poseworks, I manage to create a "complex" GUI.

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 !


PhilC ( ) posted Mon, 08 January 2007 at 3:22 PM

Coolness :)


semidieu ( ) posted Tue, 20 February 2007 at 2:10 PM

Just to inform, as it was the first topic discussion, I managed to create a scrollable list...

I'm still working on it to automate nearly everything... as soon as it's finished, I will post a new topic with this script...


Nebula ( ) posted Mon, 05 March 2007 at 9:35 AM

  I would be interested in your finished work semidieu.  I am new to python but have been  programming for years.  I have been wanting to create some scripts to help me with my animations.  Your fancy interface here would be a great asset to me.  I look forward to its availablity!
Nebula


PhilC ( ) posted Wed, 25 July 2007 at 6:25 AM

file_383833.jpg

OK I can not hold my breath any longer :)

Best I get is static but working check buttons using the XML as shown but if I place the checkboxes and text widgets within the Scrollfield widget tags they fail to show and the Python script can not access them.

And that my friends sums up my weekend :)


semidieu ( ) posted Wed, 25 July 2007 at 6:42 AM

PhilC... I sent you an IM.


PhilC ( ) posted Wed, 25 July 2007 at 7:27 AM

OK thanks.
Replied by email :)


semidieu ( ) posted Wed, 25 July 2007 at 7:31 AM

I know... Replied too :-D


PhilC ( ) posted Wed, 25 July 2007 at 10:21 AM

file_383843.jpg

OK got them thanks.

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 :)


svdl ( ) posted Wed, 25 July 2007 at 12:06 PM

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

My gallery   My freestuff


semidieu ( ) posted Thu, 26 July 2007 at 8:04 AM

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.


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.