• Hello Guest!

    We have recently updated our Site Policies regarding the use of Non Commercial content within Paid Content posts. Please read the new policy here.

    An offical announcement about this new policy can be read on our Discord.

    ~The VaMHub Moderation Team
  • Hello Guest!

    We posted an announcment regarding upcoming changes to Paid Content submissions.

    Please see this thread for more information.

Resource icon

Other Appearance Preset Extractor 2.1

This tool automatically export presets from existing scenes and collects them in an "extracted" folder under presets. The presets will use the thumbnail for the source scene.

This is for turning "Looks" that people package as a junk scene, instead of properly distributing appearance presets, into something usable, so you can safely hide all that garbage in your scene browser.

The behavior is comparable to ZFHX's "Var Looks Scanner plugin", although the implementation is entirely different.

This is a standalone python script, not an in-program plugin. This requires python3 to be installed and working already, and optionally uses the tqdm package if installed.

Usage Instructions:

  1. - Save the file to your root directory -- the same folder as AddonPackages -- as a .py python script
  2. - Run python3 extract_appearance.py {files}..., where {files}is a list of scene .json files or .var archives, or globs to those files.
    1. For instance
      python3 extract_appearance.py AddonPackages/Anon.SceneName.1.var to extract appearance presets from one scene,
      python3 extract_appearance.py "AddonPackages/Anon*.var" to extract all scenes by Anon, or
      python3 extract_appearance.py "Saves/scene/*.json" "AddonPackages/*.var" to extract absolutely everything.

If this script finds an obviously broken file, it will rename it with the .invalid extension to prevent further errors.

Future todos:
- Options to extract other presets (clothing) from scenes
- Enhancements to argparse, logging, output options, etc
- A better system for ignoring ephemeral morphs like expressions and impacts. Currently this uses a very short blacklist in order to avoid spamming the folder with obvious duplicates, but it's not very sophisticated.
Author
cartitolaire
Downloads
2,895
Views
8,925
First release
Last update
Rating
5.00 star(s) 11 ratings

Latest updates

  1. 2.1

    Disable ensure_ascii
  2. 2.0 - New outfit extractor

    Refactors the code and adds an optional outfit extractor. Use with --outfit to enable.
  3. 1.3.2 Hotfix

    Improved duplicate detection and appearance simplification logic Internal "noclobber" behaviour...

Latest reviews

After extracting about 1000 presets from the scenes, it seems that this script handles only around 40% of them. In 40% of cases it does not transfer character morphs from json to vap file. It does not matter if there are 1 or 3 characters in the scene. I wish it would be corrected.
EDIT: I found out that if I delete 4 lines - 195 to 199, all morphs are transfered successfully to the VAP file. strange. Could the author look what happens?
cartitolaire
cartitolaire
Can you send an example of a problematic scene? Those lines are meant to filter out properties that are irrelevant to the pose, which helps with filesizes and deduplication, but it could somehow be catching something significant.
Upvote 0
Question: If you run it twice will it skip ones already created?
Upvote 1
Extra points for properly shaming look creators who don't package appearance presets in their .vars
Upvote 1
I have no basic python knowledge, but I did it using your explanation and chatgpt

It works well and has been very successful

thank you so much bro!
Upvote 0
It did a good job, just kept crashing with any version of ascorad's Heads Will Roll scene. Suggest to look into why it did that.
cartitolaire
cartitolaire
Crashing? Hanging, or crashing with a stacktrace?
Upvote 0
Thank you so much, i hate all those "scenes" that only shows the look and nothing more.
cartitolaire
cartitolaire
I hate that pattern so much.
Upvote 1
Amazing
Upvote 0
Ok, call me impressed. This script plowed through 1300 vars in a few minutes. It's sooo much faster than "Var Looks Scanner plugin". Thank you for this incredible timesaver. You might consider compiling this with cx_freeze and releasing it as an executable. Kudos!
Upvote 0
Very handy utility
Upvote 0
I was getting some errors, so I had to put "encoding='utf8'" in some places in the code, but now it is working fine. Although I still work on legacy 'appearances' and I will have to manually convert all files to that format, your script is going to save a lot of my time.

I still get "json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes" errors on some scenes, but I think those are just corrupted JSON files and it has nothing to do with your code.
cartitolaire
cartitolaire
Interesting. I didn’t encounter that with any of my scenes but I’ll add the explicit encoding, that’s probably best practice anyway.
Upvote 0
Back
Top Bottom