Forum: Poser Python Scripting


Subject: Poser 6 Dialogs

PoseWorks opened this issue on Mar 22, 2005 ยท 11 posts


an0malaus posted Wed, 23 March 2005 at 9:58 PM

@PoseWorks, as stewer says, you need the dialog's Show() method called. Here's an example (hopefully not too OT) which works in P5 on Mac (expect to be waiting weeks to get my boxed P6 in OZ) and pops up an OS X styled file chooser dialog, rather than an XML styled one: initDir = poser.AppLocation() fileIndex = string.rfind(initDir, separator) initDir = initDir[:fileIndex] + ":Runtime:libraries:Pose" figure = scene.CurrentFigure() initFile = figure.Name() + "_FBM" + pz2ext getSaveFile = poser.DialogFileChooser(type=poser.kDialogFileChooserSave, message="Save Full Body Morph Pose File as:", fileName=initFile, startDir=initDir) if (getSaveFile.Show()): pz2File = getSaveFile.Path() pz2File = pz2File[:string.rfind(pz2File,pz2ext)] + pz2ext # Append extension if missing scene.SaveLibraryPose(pz2File) # Create Icon ... The code above doesn't involve any button callbacks as there is no XML parent dialog displayed prior to the File Save. I discovered the poser.DialogFileChooser (as opposed to DialogDirChooser) by searching the P5 binary for strings and looking at the XML files. Parameters were determined by guesswork and trial & error.



My ShareCG Stuff

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