Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)
Wow! That's elegant code. You're way ahead of me on TK coding, and I've learned a couple things from your code already. I didn't test all choices, but the basic action works in P4 and P5 on Windows. Incidentally, you've found the key to making a script work in all forms. This part right here: def Quit(self): ~self.master.destroy() ~self.master.quit() I had found a much more clumsy way to make scripts work in both, but your way is simple and clear.
My python page
My ShareCG freebies
Yes, I'd say it's ready. We seem to be working in parallel here; I've just finished, and placed in Freestuff, a similar script that focuses mainly on changing the P5 light attributes. But your basic idea is different.
My python page
My ShareCG freebies
Copying a file: It can be done using "os" commands, like os.rename() and os.dup(). I don't see a simple os.copy() in the help files that I have. Alternately, you can read a file, filter the lines to change certain things, and rewrite it under a different folder. (My latest LightPanel includes an example of this, because it is the only way to modify the P5 attributes which are not available to Python.) There is -no- copyright problem with copying a file. If the user tries to -sell- the result of that copying (which he could have done by ordinary methods as well as by Python) there is a problem at that point. But the violation is not in the copying; if that were the case, every computer would be violating copyrights 100% of the time! Formatting here: The convention is to use the tilde ~ to replace a tab for indentation, because Renderosity removes all leading tabs and spaces.
My python page
My ShareCG freebies
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.
Hi, I have written a small light manipulation script which does the following, may be its usefull for somebody: #Load-loads a special light file from disk - creates new lights and does not distroy old ones #Save-Saves the selected lights from listbox to text file on disk. Does not support pointat at the moment #Rename-Renames selected lights #Dim-Dims the selected light in 0.1 steps #Brighten -Brightens the selected lights #DelInvis -Deletes invisible lights #Reset- Deletes all selected lights Its a dirty hack - I havent tested it neither on P5 nor WIN - so try it out and tell me if it runs. Download the script here....... Enjoy Mungo