Darkworld opened this issue on Oct 25, 2012 · 18 posts
Darkworld posted Thu, 25 October 2012 at 10:29 AM
What program do you need to edit .py or .pyc files? I tried a text editor but a lot of times it comes out gibberish.
is there a utility associated with editing and writing python?
bagginsbill posted Thu, 25 October 2012 at 10:37 AM
You don't edit pyc files. They are binary - they are the result of compiling a py file.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
PhilC posted Thu, 25 October 2012 at 11:16 AM
PY files:-
The simplest would be Notepad on a PC or TextEdit on a Mac. Whatever you use be sure that it does not save the file with any unwanted formatting such as font or paragraph tags.
Python comes with its own editor called IDLE. This is the one that I use. In my stand alone Python installation it is located at C:Python26Libidlelibidle.pyw
Poser 9 and Poser Pro 2012 both include a version of Python with IDLE in it. Try starting it by double clicking the file "idle.bat"
Other than that a Google search for script editors will bring up a substantial number of links.
Hope that helps.
LaurieA posted Thu, 25 October 2012 at 11:47 AM
Notepad++ works great and it lays it out nice :).
Laurie
Darkworld posted Thu, 25 October 2012 at 12:08 PM
Actually I use notepad++ and the pyc is still full of special characters. Ill try Idle.
Thanks !
LaurieA posted Thu, 25 October 2012 at 12:13 PM
Well, as stated above, you CAN'T edit a .pyc. Only a .py
Laurie
Darkworld posted Thu, 25 October 2012 at 12:59 PM
is there a way to turn a .pyc back into a .py?
Quote - PY files:-
The simplest would be Notepad on a PC or TextEdit on a Mac. Whatever you use be sure that it does not save the file with any unwanted formatting such as font or paragraph tags.
Python comes with its own editor called IDLE. This is the one that I use. In my stand alone Python installation it is located at C:Python26Libidlelibidle.pyw
Poser 9 and Poser Pro 2012 both include a version of Python with IDLE in it. Try starting it by double clicking the file "idle.bat"
Other than that a Google search for script editors will bring up a substantial number of links.
Hope that helps.
idle.bat just asks me to find a suitable program to open it. i've been trying to figure out how to turn an overlay file into a python script, and can't find anything on it anywhere. so now i'm trying to reverse engineer a script that applies an overlay so i can figure out how it works.
bagginsbill posted Thu, 25 October 2012 at 2:37 PM
Scripts are often distributed as pyc specifically because the author doesn't want you to see how it works.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Darkworld posted Thu, 25 October 2012 at 2:47 PM
Applying an overlay with a script isn't magic lol... I don't mind writing it, just need some pointers.
RobynsVeil posted Thu, 25 October 2012 at 3:13 PM
Turning a compiled version (.pyc) into an uncompiled one (.py) is called reverse-engineering, which is generally frowned upon. Compiling python scripts - as I understanding it - is more about copyright protection than anything else.
Out of respect to the developer, I'd be leaving them alone. If finding out how they work isn't sufficiently explained in the documentation, you might want to contact the developer for more details.
Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2
Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand]
Darkworld posted Thu, 25 October 2012 at 3:31 PM
Well I really don't need to reverse engineer it literally- there are lots of people making overlays, and I would assume there are tutorials and text about it somewhere. I just need to figure out how it works.
This would be akin to asking how to spawn random instances of a movie clip on my flash boards after seeing a game with that feature. Nobody has a copyright on how that is done, and I'm not going to be using someone else's work.
Would you guys recommend picking THIS up? Specifically i'm interested in overlays, but i wouldn't turn my nose up to learning some other stuff as well. My only concern would be it says Poser 8 and I'm using 2012.
Thanks again for the tips!
LaurieA posted Thu, 25 October 2012 at 4:15 PM
PhilC definitely knows his way around python scripts. LOL.
Laurie
PhilC posted Thu, 25 October 2012 at 5:39 PM
Poser 9/Poser Pro 2012 added a couple of extra Python methods, I believe I outlined them in a forum post, other than that all Poser 8 methods are still relevant to the latest version.
Poser 9/Poser 2012 uses a later version of Python but the same thing applies. The manual is over 400 pages long, navigation is very clear thanks to the tree format of the index, a large number of examples (in .py format) are included. It is written in English not geek-speak :)
Darkworld posted Thu, 25 October 2012 at 6:00 PM
Thanks Phil! Sounds like i should pick it up- if i do the homework will it teach me to run an overlay script from the library (pz2)?
markschum posted Thu, 25 October 2012 at 6:17 PM
I have posted a script that applies an overlay to a selected material.
You have the poser python methods manual as a pdf file that comes with Poser.
You need Phils guide or the python documentation for the coding like if-then, for a in b, and so on.
Thats at www.python.org. I think you want version 2.7.
The detail of how to run a script from a pose file was answered recently by Philc as a reply to me .
http://www.renderosity.com/mod/forumpro/showthread.php?thread_id=2856324
Darkworld posted Thu, 25 October 2012 at 6:33 PM
I can already launch a script from a pose file, what I'm still working to get is a script that overlays the materials once executed, for the current figure.
RobynsVeil posted Thu, 25 October 2012 at 10:14 PM
For materials, there IS another option. No, it's not an end-user solution (i.e., .py file) but Matmatic has taught me an enormous amount about how materials behave in Poser. Well, actually, the credit belongs to Bagginsbill, the author / developer of Matmatic.
Matmatic is a scripting utility written for Poser, using Python code to create sophisticated materials for the material room. Easily.
Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2
Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand]
Darkworld posted Fri, 26 October 2012 at 9:53 AM
Well, creating and executing overlays isn't what I'm struggling with here- I can do that all day. I just can't do it in a way that double-clicks from a pose file =/
I've looked at a ton of scripts now and almost have something that works, but it creates this weird bleed effect...