Forum: The MarketPlace Wishing Well


Subject: Python Script to uncompress single files in Poser

Acadia opened this issue on Jun 03, 2005 ยท 10 posts


Acadia posted Fri, 03 June 2005 at 7:48 AM

Hi, the other day I found out I could compress my runtime folders (I use multiple ones) using Poser 5, in order to save hard drive space. A problem I've encountered that I don't like is that you have to target an entire runtime to compress or uncompress, even when you only want to uncompress ONE single .cr2 file. I wanted to run Dial Cleaner on my V3 .cr2 file, but because it was now a .crz file, Dial Cleaner can't read it. I was been told that Winzip could be used to unzip the files as needed, but I have Winzip and when I right click the file to unzip, there is NO unzip option... just various ones to zip it. I did a tedious work around by creating a separate runtime and placed the single file I wanted to uncompress in it and ran the Poser 5 uncompress file script, and then placed the uncompressed .cr2 file back in the original location. It would be extremely handy to be able to do all this compress and uncompress within Poser instead of having to rely on outside utilities for everything. Would it be possible for someone to write a script that addresses this issue and allows for single file compression/uncompression from within Poser itself?

"It is good to see ourselves as others see us. Try as we may, we are never
able to know ourselves fully as we are, especially the evil side of us.
This we can do only if we are not angry with our critics but will take in good
heart whatever they might have to say." - Ghandi



nruddock posted Fri, 03 June 2005 at 12:51 PM

Save attachment and rename to "uncompFile.py"

Run from the File menu or the Script palette.
If the file you pick doesn't have a recognised extension ".unc" will be added.

If you no longer want the original file, you'll need to delete it by hand.


nruddock posted Fri, 03 June 2005 at 12:52 PM

Save attachment and rename to "compFile.py"

Run from the File menu or the Script palette.
If the file you pick doesn't have a recognised extension ".gz" will be added.

If you no longer want the original file, you'll need to delete it by hand.


nruddock posted Fri, 03 June 2005 at 12:59 PM

Add extra entries to the suffixTable variable as required.

The uncompress script will probably only work sensibly on compressed files with one file in them (as produced by the compress script or created by Poser) and no directories (not tested but highly likely).


nruddock posted Fri, 03 June 2005 at 1:35 PM

Seems like the file didn't attach to the Compress post so here it is.

Note to Mods : Didn't notice this was in the WishList forum, can it be moved to the Python Scripting forum ?


Acadia posted Fri, 03 June 2005 at 5:49 PM

I posted here because it's my "wish" to have a script to uncompress one single file instead of having to do the whole runtime. I'll check out those other links. Thank you.

"It is good to see ourselves as others see us. Try as we may, we are never
able to know ourselves fully as we are, especially the evil side of us.
This we can do only if we are not angry with our critics but will take in good
heart whatever they might have to say." - Ghandi



markschum posted Sat, 04 June 2005 at 10:03 AM

I just load the figure to poser and save uncompressed. I have not found a way in python to implement a 'file picker' dialog so I waste more time getting the name correct. The other way is to move the file into c:temp and run the existing script.


PoseWorks posted Thu, 16 June 2005 at 2:39 PM

Attached Link: http://www.pythonware.com/library/tkinter/introduction/x1164-data-entry.htm

Tkinter's file picker isn't a part of the normal Tkinter module. You'll have to import tkFileDialog in addition to Tkinter. Usage: import tkFileDialog texturePath = tkFileDialog.askopenfilename(initialdir="Runtime/Textures/", filetypes=[("PhotoShop","*.psd"),("Targa","*.tga"),("TIFF","*.tif"),("All Files","*.*")])

Message edited on: 06/16/2005 14:41


dorkati posted Tue, 21 June 2005 at 5:20 PM

Check Renderosity free stuff. If I remember well, there is a little program for this. It released some days ago. Especially for single files.


Acadia posted Tue, 21 June 2005 at 6:07 PM

Someone in Poser forum finally explained the use of Winzip in a manner that I understood. Currently the Winzip extension is .zip, but if you change that extension to .gz Winzip will unzip it. I'm really dense when it comes to learning new computer related stuff, and I still don't get how you access the above script to uncompress a single file within Poser. Changing a file extension and using Winzip is do-able for me and within my comfort zone too. I'm not at all comfortable with "scripts", frankly they scare me. Especially ones that are named after giant snakes :P

"It is good to see ourselves as others see us. Try as we may, we are never
able to know ourselves fully as we are, especially the evil side of us.
This we can do only if we are not angry with our critics but will take in good
heart whatever they might have to say." - Ghandi