Tool VAM Blafking's .var Merge Tool (BMT)

BlafKing

Member
Apr 17, 2022
160
1,379
2023-07-17 05_19_08.png

Blafking's .var Merge Tool

Hi all! this tool is a custom python program I wrote that merges multiple .var files into a single .var package.

It does this by unpacking and combining all the files into a new .var package and by creating a new meta.json file that refers to all the combined content and dependencies without any duplicates!

How to use:
You don't have permission to view the spoiler content. Log in or register now.

Changelog:
You don't have permission to view the spoiler content. Log in or register now.



Download:
 
Last edited:

Feldyj

New Member
May 8, 2022
11
12
Thanks for the script, BlafKing!
Just a small note: if anyone uses the python script, TQDM needs to be installed. So run

Python:
pip install tqdm
before running the script itself.
 
  • Like
Reactions: BlafKing

BlafKing

Member
Apr 17, 2022
160
1,379
Thanks for the script, BlafKing!
Just a small note: if anyone uses the python script, TQDM needs to be installed. So run

Python:
pip install tqdm
before running the script itself.
Edit: Since update v2.2 you need to install this package instead:
Python:
pip install demjson3
 
Last edited:
  • Like
Reactions: Feldyj

BlafKing

Member
Apr 17, 2022
160
1,379
Just updated the script to v1.1

- Fixed a small issue where the user input file version was not applied to the final file name.
 

BlafKing

Member
Apr 17, 2022
160
1,379
Updated the script to v2.0

- Partially rewrote the entire script to add a GUI, wasn't happy with the previous CMD experience so there's a nice UI now! :)
 
Last edited:

BlafKing

Member
Apr 17, 2022
160
1,379
Updated the script to v2.1

- Added a check at the start of the merging process which verifies if all selected files are accessible.

- Added a function that outputs an error log file at the root of the script if there is an unexpected exception/error during merging.

- Added some text during merging which displays which file is being processed.
 
  • Like
Reactions: Ash_Line and Feldyj

BlafKing

Member
Apr 17, 2022
160
1,379
Updated the script to v2.2


- Made the script able to repair some poorly made/broken meta.json files.

- Added 2 toggleable options to toggle folder opening after completion & program shutdown after completion.

- Most recent used folder locations are now saved.

- Better error detection & handling during merging.
 
  • Like
Reactions: Feldyj

Feldyj

New Member
May 8, 2022
11
12
Man, I can't keep up with you! Every time I download a release, next thing I know there's a new one! LOL.
Thanks!
 
  • Heart
Reactions: BlafKing

BlafKing

Member
Apr 17, 2022
160
1,379
Updated the script to v2.3


- Included a toggle to set all dependency versions of the meta-data to .latest

- Modified the unpacking process to place the temporary folder on the same drive as the final output file.

- Input box now displays the current name, artist name, or package name when opened.
 
  • Like
Reactions: Feldyj

BlafKing

Member
Apr 17, 2022
160
1,379
Wait this seems amazing idk how it's not more well known. Are there some general guidelines to follow when merging?
Thanks for the kind words!
Only thing to really look out for is using the Set dependencies to .latest option, this can break some packages that only work with specific dependency versions.
Other than that you should be able to merge as many .var packages as you'd like!

If you ever experience any issues feel free to shoot me a DM or just post a message here :)
 
May 19, 2022
161
107
have you found that merging affects load speed at all? I know I've seen speculation that raw var count or the separation of assets with the var system are major factors for slow loading. Do you think that's true or would any benefits be moreso from resolving duplicates
 

BlafKing

Member
Apr 17, 2022
160
1,379
have you found that merging affects load speed at all? I know I've seen speculation that raw var count or the separation of assets with the var system are major factors for slow loading. Do you think that's true or would any benefits be moreso from resolving duplicates
It depends a lot on the packages, if the packages are well made and properly reference morphs, then this script will have little to no effect.

But if the packages include many of the morphs instead of referencing them then the merging process can help a lot for load speed, performance, and storage size.

You can read a bit more about it

It's not the perfect solution, since it would be best to properly reference things and only store them once, but this is a lot better than storing them a 100 times :)

I personally use this program on UniversenS scenes and it takes the size from 65,6GB to 2,87GB and helps a lot for load times.
 
Last edited:

blorghor

New Member
Oct 24, 2023
3
6
BlafKing How do I decide what vars to merge? Do I need to find the specific vars for a particular scene and merge those, or can I just merge the entire addonPackages folder?
 

Feldyj

New Member
May 8, 2022
11
12
BlafKing How do I decide what vars to merge? Do I need to find the specific vars for a particular scene and merge those, or can I just merge the entire addonPackages folder?
You can certainly merge the entire folder, but—depending on your library size—it may create such a behemoth of a file that your VAM performance may suffer. If you want to go down that route, I'd suggest merging vars based on the creator's ID (so, for example, merge all UniversenS files together, then all files by another creator, and so on). Another good idea would be to leave script vars (for example, Timeline, etc.) alone because scene files won't be able to find them automatically if their names change—and you'll need to point scenes to those scripts manually.
 
  • Like
Reactions: BlafKing