• Hi Guest!

    We are extremely excited to announce the release of our first Beta1.1 and the first release of our Public AddonKit!
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. For access to the Public AddonKit you must be a Creator tier member. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.
  • Hi Guest!

    VaM2 Resource Categories have now been added to the Hub! For information on posting VaM2 resources and details about VaM2 related changes to our Community Forums, please see our official announcement here.

Question Is there a script/plugin/app that deletes no-longer-used dependency vars?

Random137

New member
Joined
Dec 5, 2025
Messages
1
Reactions
0
So I browse a couple of cool scenes and decide to check them out, downloading their dependencies (which can get very large with large textures in dependent looks and scenes), then decide the scenes aren't for me and delete them. The dependencies I just downloaded still remain, though, and after many such scenes downloaded and deleted I'm left with a var folder filled with unused dependencies that would be best deleted, but I don't remember which of them are old unused dependencies and which are current ones.

So my question: Is there a plugin/app/script that can identify no-longer-used dependency vars?

Surely there must be? I've tried searching high and low and found apps and scripts that delete old versions of dependent vars, duplicate vars, malformed vars, but nothing that touches vars that were previously dependencies but now they're stranded because their dependent is gone. It seems like a simple script: get a list of vars (let's call it TheList) from AddonPackages, get the dependencies from each var's meta.json, cross off all dependencies from TheList, then remove all the vars from TheList that you independently want to keep, and you end up with a list of vars that you can safely delete without affecting anything. If there's no such thing that can do that, I might take a stab at programming one myself. Of course, there are manual ways to do this, but that seems the work of minutes when a script could do it in seconds.
 
This is a problem in Vam, there's no reverse lookup. There's a Python script to list all dependencies. I updated the original to make it more thorough. You have to install Python from python.org then you can run the script. I keep it in the Vam root folder. I run it in Powershell.

python List_Deps.py -p . -h
usage: DependencyScanner.py [-h] [-p PATH] [-n NAME] [-o [OUTPUT]]

Searches for dependencies inside all vars in a folder and if a name is given, lists whether there a vars that depend
on it. If no name is given, it will instead list all vars in the folder which isn't a dependency of any other var.

options:
-h, --help show this help message and exit
-p PATH, --path PATH Path your VaM folder
-n NAME, --name NAME Name of a var file. Can be a partial name
-o [OUTPUT], --output [OUTPUT]
File to save the results in (default: '.\SearchVarOutput.txt')


If you want it to scan all packages, run it without the -n option, but with the -o option. If you look through the output file, any var that is not used by anything will have nothing listed after it. If you save local presets (appearance, hair, etc), then those will show up too. Any var that has no usage by other vars or any local presets is safe to delete. What I do is drag them to a holding area that is not seen by Vam (like 000oldvars) until it's confirmed they are not needed. I'd be careful deleting vars from creators no longer on the hub. Once you delete them, you might not be able to get them back.
 
Upvote 0
Here are 2 examples. The first var has nothing using it because I just downloaded it thinking I'll need it someday (yeah, right). The second was a dependency of a scene.

PS C:\games\vam> python List_Deps.py -p . -n erotic_tat
The following var was checked for dependency in other vars:
Vamgina.erotic_tattoo.1.var

PS C:\games\vam> python List_Deps.py -p . -n aiyu_hair
The following var was checked for dependency in other vars:
xxxa.Aiyu_Hair.1.var


The following 1 iteration of 'aiyu_hair' has other vars that depend on it:
xxxa.Aiyu_Hair.latest ->
Pikavam113.Vaio.2.var

The following 1 iteration of 'aiyu_hair' has presets that depend on it:
xxxa.Aiyu_Hair.1 ->
Atom/Person/Hair/Preset_Debbie m5 loose.vap
 
Upvote 0
Back
Top Bottom