Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
PhilC is dead. Not sure how paying him would work.
===========================================================
OS: Windows 11 64-bit
Poser: Poser 11.3 ...... Units: inches or meters depends on mood
Bryce: Bryce Pro 7.1.074
Image Editing: Corel Paintshop Pro
Renderer: Superfly, Firefly
9/11/2001: Never forget...
Smiles are contagious... Pass it on!
Today is the tomorrow you worried about yesterday
I'm not particulary worried about the version of Python. I grok Python fairly well. What I'm looking for are definitions of the Poser classes, methods, etc., and that's been a real bitch to find. However, for anyone else looking for similar information, I did find this site useful: https://vdocuments.mx/poser-python-methods-manual.html?page=1. Not perfect, but it is possible to dig out the needed information.
You can use the document system that comes within poserPython. It gives the current state. The PoserPython related info in PhilC's docs will by now be quite obsolete. This not because of Poser going to Python3, that did not change the PoserPython function calls, but because of development Poser had over time, API extensions, and more.
The key changes are in Python itself.
Thanks for the tip! I'll definitely look for the document system within poserPython. And, yeah, it sounds like Phil's book wouldn't help. And you put your finger exactly and succinctly on what I am looking for too, current documentation about the poser classes, methods, etc., available in Python scripts.
It's curious though that you say that the key changes are in Python itself. I'm comfortable with either version of Python and not finding writing the Python code to be an issue at all, so the changes in Python don't show up as a problem. Actually, I think maybe I'm not exactly understanding that last sentence. Sorry.
in the shell import pydoc and browse it. Problem is it locks Poser until you quit the browser. The HTML page remains available though.
Most common problem with old scripts available on code (.py) level is that 'print' now requires its arguments between brackets. Most PoserPython scripts available on source code level work if you add the brackets and make a fix here and there. Also I've seen scripts where some 'clever' use of strings is no longer supported.
Compiled scripts suffer from the 'magic number' issue. Sometimes decompiled code just runs, or does so after 'print brackets' was solved.
Last but not least there's often access rights issues with old scripts. Today a PC is no longer a personal computer.
But if there were a 'Poser 13 Python Methods Manual' it would not be very different from same for Poser 11, except for the additions and corrections.
I'm getting nowhere with pydoc. I import it but then I have enormous problems navigating around.
And I don't see how to browse it. I'm just stuck in the python shell window.
Any tips would be appreciated.
My experience with python, I have to admit, is totally outside this universe. Think Visual Studio and AWS.
As you mention Visual Studio Code, ADP's Fake_poser3a.py may be a useful assistant. His site/page appears to have been unavailable for some months, and the Wayback Machine hasn't saved his .ZIP files (though some of the code insets still display). But here is his Fake_poser3a.py (latest version) for use with Visual Studio Code etc. I've added an expanded header.
Learn the Secrets of Poser 11 and Line-art Filters.
Hello!import pydoc
pydoc.browse()
Access to Poser module is via link 'poser' in te reightmost column, about mid-height.
I looked a little deeper and as far as I can see there's two options:
1 - you can start the pydocs as described, leave the browser window open and quit the pydoc.browse. Your Poser and your Python is no longer blocked. All hyperlinks are internal so your browser will work from the cache as long as you keep the browser window open.
2 - To produce a persistent copy, say as a word document:
- open Microsoft Word (That's what I used. Not sure about other similar apps.)
- In Poser start the pydocs browser as described above. Page shows in your browser.
- From the address field of that browser copy the address.
- Tell MS-Word to open that page.
- on that page 'copy all'
- open a new blank page and paste all.
You can then save the info as an independent word document. Hyperlinks refer to the original on 'localhost' sadly.
When you are clever with code hacking you may try to save the .docx as a .rtf and search/replace the link address.
The pydoc.browse() method starts a servrer and tell your webbrowser to load a page that contains all the info, with hyperlinks to locations in that page. The addresses in these hyperlinks however are absolute and lead to the server that pydoc.browse() started. If you save the document and reload it later, that server usually no longer exists.
You would need to change the links into jump links.
FVerbaas posted at 5:34 AM Thu, 28 September 2023 - #4475445
I looked a little deeper and as far as I can see there's two options:
1 - you can start the pydocs as described, leave the browser window open and quit the pydoc.browse. Your Poser and your Python is no longer blocked. All hyperlinks are internal so your browser will work from the cache as long as you keep the browser window open.
2 - To produce a persistent copy, say as a word document:
- open Microsoft Word (That's what I used. Not sure about other similar apps.)
- In Poser start the pydocs browser as described above. Page shows in your browser.
- From the address field of that browser copy the address.
- Tell MS-Word to open that page.
- on that page 'copy all'
- open a new blank page and paste all.
You can then save the info as an independent word document. Hyperlinks refer to the original on 'localhost' sadly.
When you are clever with code hacking you may try to save the .docx as a .rtf and search/replace the link address.
Thank you for the information. Went a similar route, just used the UltraEdit text editor instead of Word. The whole thing slightly revised and saved as a py file. The syntax support then shows me at least a class list. There I can hop then fine back and forth.
johnsta2oo posted at 4:44 PM Fri, 15 September 2023 - #4474634
I'm trying to find into too. That link make all the virus alerts go nuts on my compy.I'm not particulary worried about the version of Python. I grok Python fairly well. What I'm looking for are definitions of the Poser classes, methods, etc., and that's been a real bitch to find. However, for anyone else looking for similar information, I did find this site useful: https://vdocuments.mx/poser-python-methods-manual.html?page=1. Not perfect, but it is possible to dig out the needed information.
_____________________________
My most recent Poser animation:
Previs Dummies 2
I looked a little deeper and as far as I can see there's two options:
1 - you can start the pydocs as described, leave the browser window open and quit the pydoc.browse. Your Poser and your Python is no longer blocked. All hyperlinks are internal so your browser will work from the cache as long as you keep the browser window open.
2 - To produce a persistent copy, say as a word document:
- open Microsoft Word (That's what I used. Not sure about other similar apps.)
- In Poser start the pydocs browser as described above. Page shows in your browser.
- From the address field of that browser copy the address.
- Tell MS-Word to open that page.
- on that page 'copy all'
- open a new blank page and paste all.
You can then save the info as an independent word document. Hyperlinks refer to the original on 'localhost' sadly.
When you are clever with code hacking you may try to save the .docx as a .rtf and search/replace the link address.
Addition: no need to refuge to .rtf. You can change all links in the word document itself as follows:
- press ALT+f9 keys. The linked addresses now become visible on the screen
- use find&replace to remove the 'localhost' strings.
- press ALT+f9 again to restore normal view.
- you can now export to .pdf or whatever format.
The above is for MSWord. Other editors will use other keystrokes.
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.
Does anyone know where I can get a copy of Python For Poser by PhilC?
The Renderosity Marketplace lists it for $29.95, but then shows it as "unavailable". As far as I can tell, PhilC is gone. I wouldn't mind paying him the $29.95, but so far can't find a copy anywhere, period.