Forum: Poser Python Scripting


Subject: multiple prop import

jancory opened this issue on Jan 24, 2024 ยท 4 posts


FVerbaas posted Sat, 03 February 2024 at 5:38 AM Forum Coordinator

With many thanks to jancory for testing, instructions are below for those who want to make their own update: 

Open the .py file in an editor (I use Notepad++) and:

- put brackets around the arguments of the print commands.

- in the includes at the top of the script change wx.lib.hyperlink to wx.lib.agw.hyperlink

- dlg.center no longer has a 'direction' keyword. For me it worked to leave that out, just call dlg.Center() without any arguments  (line 382)

- fileDialog styles now have 'FD_' prepended to their names. wx.OPEN has become wx.FD_OPEN, etc. (line 380)

- strings have become different beasts and they are to be handled differently in binary write. I have no idea why Phil resorted to file writing, but the SaveLinesToFile method works after a revision as detailed in the below:



def SaveLinesToFile(lines, filepath):

    fd = open(filepath, 'wb')
    s = "\n".join(lines)       #P13 Was: s=string.join(lines, '\n')
    fd.write(str.encode(s))    #P13 encoded string for binary write
    fd.close()  



And: Some of Phil's scripts tried to write to the folder where the script is, and of course if you put it in the 'old' location under ProgramFiles that will not work because file writing is now protected. 

I ran my version from an arbitrary folder and it worked. Best install under the 'new regime' of python files in library folders to prevent acces right errors.