• 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.

VaM 1.x Quickly repack an existing pack with modified json

Threads regarding the original VaM 1.x

pingox

New member
Joined
Mar 18, 2024
Messages
17
Reactions
1
Hi. I need to make a slight change to the json file that is inside var packages, and then I would like to have the package updated again. I've been doing this by “saving the scene” and then using the explorer I open the compressed var file, delete the old json and put in the one I saved.

The VAR opens anyway and serves my purpose, but the downside is that this way the VAR package is no longer recognized by VAM as a package, and it no longer shows the external references, and all the useful information that it usually does.

Is there an alternative?
(I don't want to unpack the VAR and then re-package it using the traditional method because then I'll be filling my folders with audios and images which will be a lot of work to find and delete...)

Thanks!
 
Depending on what you want to do and if you know what you're doing, you can edit the JSON on the VAR directly.
I do this for small changes on scenes or presets that I know are easy to do with low risk of breaking the scene, and on the meta.json file I change pretty much all of them in the VARs I download for my manually curated VAM.
 
Upvote 0
If you unpack a var to a folder and then rename it so it follows the naming convention, creator.package_name.version, then it will act just like a var. You have to move the original var out before you rename the folder. Once you have that folder, swap out the scene file, and zip the folder. Rename the zip file to .var and it should work, if that's the only change. If you have to make changes to the meta.json, then it's like Atani said. 7zip can also edit files inside a zip file, which is nice for deleting unnecessary dependencies.
 
Upvote 0
  1. Modifying VARs and especially JSON by hand is not advised. Its too easy to break things for inexperienced users, as you noticed.
  2. Only use VaM to pack VARs. Do never use an external ZIP application for creating VAR as it may not create the ZIP with the correct parameters (e.g. choice of compression algorithm) which may influence loading performance.
  3. When you want to make a change, use VaM's internal VAR tool to create a new version of the VAR.
 
Upvote 0
@pingox maybe you need to explain more about what you're trying to do. You don't have any packages posted. Are you trying to modify other people's var packages? That's usually not necessary, unless the creator of that package really messed up. Asking them to fix something usually works. If you like some package, but don't want some of the dependencies, you can use Package Manager on that package to tell Vam to ignore and stop warning about missing dependencies. If all you want is to use somebody else's scene with other assets in it, then just save a local copy of the scene and work with that inside Vam. Assets from other vars can be included in the local copy of the scene by reference.
 
Upvote 0
Yes, that's how I do it, I open the var with something like 7zip, and replace the json (which I previously saved with VAM).
But then when I select that var in VAM's package explorer, I can't see any of the things I saw before (the info, the references, etc...) but I'll admit that it has to be this way (as an alternative to doing the whole process through VAM for better result and compatibility).

The modifications I make are very simple, adding embody, mirrors, etc.

Thanks
 
Last edited:
Upvote 0
Yes, that's how I do it, I open the var with something like 7zip, and replace the json (which I previously saved with VAM).
But then when I select that var in VAM's package explorer, I can't see any of the things I saw before (the info, the references, etc...) but I'll admit that it has to be this way (as an alternative to doing the whole process through VAM for better result and compatibility).

The modifications I make are very simple, adding embody, mirrors, etc.

Thanks
You're not supposed to do that. I mod scenes all the time, but I save a local copy in saves/scene and make all my changes to that. I don't change somebody else's var just to add something or swap an appearance.
 
Upvote 0
The warnings were presented already, so let's consider this a learning and experience opportunity. I sure do it on ocasion; it's very easy to make a mistake, but the experience of breaking and fixing is rewarding I think, and in some situations can save time or make things easier to do or maintain.

If you're adding manually a plugin and plugin's settings to a person, taking them from some other scene for example, there's 2 parts you need to include:
  • the plugin to be listed in the person's list of plugins
  • the plugins settings in the area of the other plugins settings
Of course, you need to account for certain things like matching and using a list number for the new plugin, json syntax, etc. This is doable, I suggest trying with a simple example to understand how it all pieces together.
Expect to make mistakes, learn from them, have fun tinkering.
 
Upvote 0
The warnings were presented already, so let's consider this a learning and experience opportunity. I sure do it on ocasion; it's very easy to make a mistake, but the experience of breaking and fixing is rewarding I think, and in some situations can save time or make things easier to do or maintain.

If you're adding manually a plugin and plugin's settings to a person, taking them from some other scene for example, there's 2 parts you need to include:
  • the plugin to be listed in the person's list of plugins
  • the plugins settings in the area of the other plugins settings
Of course, you need to account for certain things like matching and using a list number for the new plugin, json syntax, etc. This is doable, I suggest trying with a simple example to understand how it all pieces together.
Expect to make mistakes, learn from them, have fun tinkering.
I understand this perfectly and don't question it. My years of programming and 3D designing allow me to understand that it's very easy to miscalculate an unknown parameter and cause things to stop working correctly.I've only recently discovered VAM and am exploring the software.

One of the challenges I'm facing is memory space, and my question was along those lines. I don't want JSON files on my PC.

My question was if there was a way to edit the main JSON of a VAR file. I've noticed there isn't, without unpacking and creating the VAR again through VAM. That's fine.

BTW, I never said I was modifying PCs or PC EA Vars. I hope there's no doubt about that.

Thanks!
 
Upvote 0
My question was if there was a way to edit the main JSON of a VAR file. I've noticed there isn't, without unpacking and creating the VAR again through VAM. That's fine.
Sure you can, I do it often for simple enough things.
In File Explorer either extract the JSON from the VAR or live load it in your compressed files application:
 
Upvote 0
You can open a var in 7zip without unzipping the whole thing. 7zip allows you to designate a text editor to be used inside the tool. What you do is open the var in 7zip, right click on the json, and select Edit after choosing your editor. And yes, it is easy to break things. Choose an editor that can check json syntax. I use Vim, but that's only one.

By "memory space" do you mean disk space? Json files usually aren't that big. It's texture files embedded in vars, or in the dependencies that take up disk space. My saves/scene folder is about 9 GB, where AddonPackages is 150 GB.
 
Upvote 0
Back
Top Bottom