destro75 opened this issue on Mar 27, 2006 ยท 9 posts
destro75 posted Mon, 27 March 2006 at 2:33 PM
Phil, you are the best. Thanks a bunch! I wasn't even aware that existed, but it may just come in handy in the future. Best of all, it has documentation on the original Poser Dialogs.
3dtrue, I don't have the code with me right now, as I am at work, but here is an example of what I did this morning:
def GetFigure(scene):
figList = [] # Create an empty list to hold the figures in the scene.
for figs in scene.Figures():
figList.append(figs.Name()) # Load the list with each figure in the scene.
figAName = poser.DialogSimple.AskMenu("Choose your figure:", "Choose the figure:", figList) # Offer the user the choice of figures
return scene.Figure(figAName)
scene = poser.Scene()
figA = GetFigure(scene)
This is just a quick hack together of some code. I honestly don't even know off the top of my head if it is functional, though I am pretty sure it would work. I set up some code like this in the morning, before I left for work, so I will know for sure later on if it is okay. The obvious advantage to this approach is that it should work cross-platform, unlike the problems with tkInter on the Mac.
The script I am working on is to transfer morphs from one figure to another. I originally had the figures hard coded, but then I came across one of the poser dialog references by accident in one of the "built-in" scripts, so I figured I would give that a shot. Once I did that, I started wondering what else the dialogs can be used for.
The PzrDialog is very interesting though. I'll be checking that out later on. My wheels are starting to turn on Python Scripts to be written, so we'll see where these take me.