Forum: Poser - OFFICIAL


Subject: My Program to Organize Runtimes

232bird opened this issue on Mar 22, 2011 · 18 posts


232bird posted Tue, 22 March 2011 at 2:41 AM

Due to the overwhelming amount of content available, as well as the lack of oversight of how developers organize their content, I have created a small batch file to help me sort my runtimes.  For example, if I want a certain pair of shoes, but all my different shoes are located in Character>developer's name>clothing set name (in the runtime explorer), those shoes can be nearly impossible or at least time consuming to find.

In light of this problem I created a batch file to search through a specified folder tree, grab all files of a specified type, and copy them to another folder while adding the relative file path to the file name.  For example, the program as posted will search recursively down from the folder in which it is located for all PNG files, copy them to cresults, and add the relative file path to the file name.  I then look through the pictures for shoes, copy those pictures to a "Shoes" directory, and then use that information to either organize my physical runtime folders, or just as a guide to find what I am looking for, since the file name includes the path of the original file.

The program is fairly simple to use, but first the ugly parts:

    I posted it as a batch for file for three reasons

        1 - My programming knowledge is limited, so to "real" programmers  please have a good laugh about it, but don't post how I could have done it better with C++ or Python or VB or FORTRAN (LOL) unless you are VERY descriptive and willing to help proceed along that path.

        2 - In very rare cases it may be neccessary to run the file as an administrator, or an antivirus might blow up over it (although I can't imagine a scenario that would cause either).  If that is the case, don't complain to me about it, just look at the text and decide for yourself  if it is harmful or not.

        3 - It would be inexcusably stupid for me to compile something so basic into a proprietary EXE when it is nothing special and I want it to evolve.  With that said, if anybody wants to add to it please do so, I only ask that you do it here so everybody can benefit.

I have some modifications to this script I am working on, to allow for on-the-fly user input for the paths and file types, as well as the ability to save out and read from configuration files.  I also have a handful of other scripts I wrote that I use all the time that I want to incorporate with this into a big master program, but I am only willing to do that if a) anybody actually cares and wants it, and b) people tell me what they want.  This will never be as powerful as D3D's tools, but helps automate some of the time-consuming tasks of dealing with Poser and it's offspring programs.

To use, just download the txt file and rename the .txt to .bat.  Place it in the top of the folder tree to analyze.  For example, to analyze the characters folder and its sub-folders, place the file in the characters folder.  To analyze and entire runtime, just place the file in that runtime folder.

 - Next, open the file in a text editor.  For the line "set results=c:", just change the c: to whatever path you want the results folder to be placed in.  And for the "set file=png" line, change png to whatever file extension you want to search for. Sorry I couldn't figure out how to get a screenshot in, but they are lines 6 and 7.

 

 - Save the file, and run it.  It will give a message in the CMD window when it is complete, as well as write a log file to whatever folder it is in.

Bugs:

 - The script may give the error "The filename, directory name, or volume label syntax is incorrect."  This is because Windows Command Prompt sees "!" in a file or folder name as a special character (devs love to name there runtime folders !something), and will not include it in the folder name, therefore any files in that folder will not be copied.  If anybody knows a solution to this, PLEASE let me know.  For the time being, look through or search the log.txt file for "The system cannot find the path specified." to find the culprit folder.

 - Not really a bug, but the script writes and deletes a file "copy.bat" as needed.  If the script is aborted before that file is deleted, it will obviously remain in the same folder as the script.  it is OK to delete it since it is no longer used, or just run the script again and that file will be overwritten and deleted anyway.

This program should run on any system with Windows XP or later, but since the command prompt has evolved then digressed then evolved again over time  I think anything XP SP3 or newer is guaranteed to work.  I have only used it on Win7 so far.

Again, I have some other programs i wrote, such as copying commonly used paths to the clipboard (for example instead of browsing through folder after folder.... in Morphing Clothes or the like), or doing runtime backups.  I can polish those for public use or include them in this, but only if anybody cares.  For now this can be an ice-breaker.