Forum: Poser Python Scripting


Subject: Creating a wxPython dialog in P9

PickledPapaya opened this issue on Oct 23, 2012 · 7 posts


PickledPapaya posted Tue, 23 October 2012 at 12:45 PM

OK, so I am trying to make a interface in P9 for a script, and since its P9, I was going to try a simple sample.

Here is the sample, I got, and I added "poser" to the import line.

When I run it, the dialog shows, but Poser goes white, and when I close the dialog, Poser crashes. 

Any thoughts here?  I was hoping for a "this is so simple, you can learn from here" type of script, but seems like I picked the wrong one.

SCRIPT I used: http://www.wxpython.org/test7.py.html

PAGE it is linked from (2nd screenshot down): http://www.wxpython.org/screenshots.php


PickledPapaya posted Tue, 23 October 2012 at 1:25 PM

OK, I found a small sample script from PhilC HERE

That should get me started...it works, and should get me started.  1st item, find out why it says "running in poser 8"  ;-)


grichter posted Tue, 23 October 2012 at 4:05 PM

Quote - OK, I found a small sample script from PhilC HERE

That should get me started...it works, and should get me started.  1st item, find out why it says "running in poser 8"  ;-)

 

You sill see it says maybe 10 lines from the top

print "Running in Poser 8"

Print is the command to ahh print data on you screen. Change that line between the quotes to read "Priniting Money" (snicker) or anything you like.

 

Gary

"Those who lose themselves in a passion lose less than those who lose their passion"


grichter posted Tue, 23 October 2012 at 4:08 PM

FYI PhilC has an set of fantastic tutorials with sample scripts for you to edit and so forth to do what you want to do in tinker and wxpython.

 

I have used the examples as a foundation to create a new script in many times. Well worth the cost.

Gary

"Those who lose themselves in a passion lose less than those who lose their passion"


PhilC posted Tue, 23 October 2012 at 5:20 PM

Yes, the point was to make the distinction between running as a stand alone and running as a script within Poser.

You may find these links helpful.

forum

Comprehensive Poser Python manual


PickledPapaya posted Tue, 23 October 2012 at 5:30 PM

Quote - You sill see it says maybe 10 lines from the top

print "Running in Poser 8"

Print is the command to ahh print data on you screen. Change that line between the quotes to read "Priniting Money" (snicker) or anything you like.

Oh, thanks, that makes sense.

Now I need to understand why he is greeting the world at the beginning of the script, and if it is necessary to be so formal, or can I just say, "Wassup!"


PickledPapaya posted Tue, 23 October 2012 at 5:36 PM

Quote - Yes, the point was to make the distinction between running as a stand alone and running as a script within Poser.

Yea, I assume it was the app.Mainloop() that was crashing Poser, as I was doing all my learning from the wxPython forums/sites direct, and not specific to Poser.

Thanks to both of you for the replies, I am progressing, have a dialog, fields,, etc...and am working on tying it into my script.  :)