Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
Sounds very interesting! Going to look them over, I can probably learn quite a few Python tricks from your work. Thanks for sharing!
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
My gallery   My freestuff
Definitely going to check this out :-) I've been hand tweaking XML dialog definitions to implement the Mac conversions of face_off's Skin Realism products and it's an imperial sceptre up the backside. I'd be really keen to know if there are freely available graphic XML widget editing tools.
I ran into P6 bugs with sequential calls to some of the AskFloat|Menu|...() methods crashing poser, not to mention the nastiness that is the booby-trapped dU shader node.
There are also some serious deficiencies in the poser python widget manipulation hooks which mean it's impossible to dynamically update text attributes or widget visibility once they're coded in the XML. I ended up with buttons and check boxes that I couldn't make disappear when they were disables. The best I could do was to set the text items to empty strings and ignore the callbacks of the buttons and checkboxes. [Edited to remove inadvertent inline HTML]
Message edited on: 08/17/2005 23:08
Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.
@PoseWorks. This is fantastic! Just browsing through the help html, I can enlighten you on what fadeMax does. At the default zero value, (obviously) nothing happens. At 0.5, widget text (at least, since that's the only thing I tested it on so far) appears half way between its normal colour and the background, i.e. dimmed or faded. At 1.0, the text is invisible. A nice effect, but not one that I'd found a way to dynamically modify (till now, I hope) :-)
Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.
Another question of note. I have frequently made use of poser Dialog SetText method to dynamically change the text of button widgets (e.g. a scroll button which appears blank when at the end of a list but displays a symbol when enabled). Is this precluded by the PzrButton method using the widget name as the text or is the SetText method still relevant once the XML and the Dialog have been created?
Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.
Cool--let me know if you figure out any of the other unknowns in there! All of Poser's dialog methods are still available to use on PzrWidgets, so dialog.SetText(widgetName, "new text") will still work just fine (as will AddButtonCallback and SetValue). If you don't know a PzrWidget's name, it gets stored in the widgetName attribute (myWidget.widgetName). I've been snooping around for a way to close dialog windows via script, and have been unsuccessful so far. You can set a button to close the window use a command the range 7001-7004, but you cannot add a working callback to a button using a protected command number (anything lower than 10001). Anyone have any ideas? (As a side note, I've found that you cannot use command numbers from interface widgets to replicate those commands. I guess the PoseDots are safe from me for now... sigh)
Outstanding work! Well done, and thanks.
Creator of PoserPhysics
Creator
of OctaneRender
for Poser
Blog
Facebook
PoseWorks.... I've had a good look through this now, and have to say - it's a masterpiece - and I'm incorporating it into a package right now. A couple of things... 1) The align function in the PzrText class does some strange things to coordinates when right justifying (align = 3). It's no biggie - just means that a negative X value needs to be used. 2) I couldn't work out how to get the status of a checkbox that was not part of a CheckPane. Maybe get() needs to be implemented for PzrCheckbutton? In fact - could get(), or GetButtonValue, be implemented at the PzrWidget level? 3) I wonder if sliders would respond to GetButtonValue? It looks like there might be sliders int he Dlg_RenderOptions(P6?).xml. 4) The inbuilt xml gui system appears to be based on wxWidgets. I found an old version of wxWidgets on sourceforge that runs on Python22 for Windows and Mac. Did you consider the option of simply using that library? Thanks again for sharing this incredibly useful library.
Creator of PoserPhysics
Creator
of OctaneRender
for Poser
Blog
Facebook
Interesting. I just tried to implement 4) above - no luck. Firstly, PoserPython doesn't declare True and False. Once I sorted that out, I couldn't get PoserPython to load the wxPython library. It seemed to be some tricky versioning code in wxPython that tripped it up.
Creator of PoserPhysics
Creator
of OctaneRender
for Poser
Blog
Facebook
Wow, thanks for the high praise! 1) I think this is true of Poser in general; I'll add it to the list of things to investigate for v2 2) There's currently no way to query a lone checkbox without creating a callback function for it. I'll add this to the to-do list; in the mean time, just use a checkpane with one button. I'm not sure if this is something that could be added to PzrWidget, but I'll look into that. 3) I'm looking to flesh out the widget ranks (need to get multiple text entries in there as well) for the next version. Everything is still a bit cryptic at the moment. 4) Awesomeness. I had not considered looking at wxWindows (spent most of my time just picking through XML and PY files). Even if it's not fully exposed, that certainly opens up some documentation so there'll be less guessing what's going on under the hood. I wonder if we can rig up a hacked (but working) wxPython... Creating windows on the fly is fun and all, but changing their content interactively is king...
Thanks for the response PoseWorks. 2) I worked this add, and manually added the callback to the checkbox and kept track of it's value. I noticed if you check and uncheck the checkbox fast enough, it looses track of the value (ie. gets out of sync). I also queried the poser.Dialog() class, and you are right, there are no Get methods - only Sets. 4) After doing some more work on this - I suspect it is not an easy thing to do. But with enough "hacking" it might be possible to get wxPython working in Poser. One of the issues is that the current version of wxPython is Python 23/24, not 22. So it would either need to be recompiled under 22, or use an earlier version that support Python22 (which is what I tried). I got wxPython working in a Python22 session, but couldn't get the module to load in a PoserPython session.
Creator of PoserPhysics
Creator
of OctaneRender
for Poser
Blog
Facebook
The checkbutton deal isn't too surprising--Tkinter also makes you track a checkbutton or radiobutton's status through an external variable. I expect that we'll see the wxWidgets opened up much more fully with Poser 7 (unless they seriously mess up and pull another P5 on us!) Hopefully we'll get some love with SR2 though. Disappointing about wxPython though (not that it would actually be compatible with the Poser dialogs anyways).
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.
Attached Link: http://www.poseworks.com/files/products/PXML_pzrXml.1.0.zip
I just wrapped work on ShaderSpider Mac (ShaderSpider for the PC is due out this week at DAZ, shameless plug), and I had to develop some elaborate work arounds to create robust and mutable dialog windows using Poser's dialog system.The chief problem is that, while you can use Poser 6's SimpleDialogs to create windows whose content varies somewhat, they're extremely limited in scope and do not offer a full range of options. In response to this issue, I developed new dialog system for Poser 6 that is something like the bastard child of Poser's XML language and Tkinter.
I've fleshed out what I created for ShaderSpider a bit more, and turned it into a fairly robust dynamic-dialog module, pzrXml. While nowhere near as flexible as Tkinter, it does open up much more access to Poser's dialog capabilities.
The pzrXml download is free. It contains the pzrXml module, an example script using pzrXml dialogs, and full documentation. This version is 1.0; I do plan later versions as I get time to work on it.
I invite you all to use pzrXml in your P6 scripts, however I request that you do not distribute the module to others. Instead, please refer them to the above link.