Become a patron of everlaster today: Get access to exclusive content and experiences on the world’s largest membership platform for artists and creators.
VAR LICENSE FILTER
VarLicenseFilter is a session plugin aimed at creators. It can be used to only load those var packages which have suitable license types for use in a project.
The more packages you have installed, the more additional benefit you will get from the plugin. Filtering out all of the packages you can't use in your project anyway will speed up loading times and make it easier to browse all resource types.
- load only packages that have the selected license types
- auto-select license types that are freely distributable
- auto-select license types that allow commercial use
- always enable or always disable individual packages to prevent license filtering from changing their visibility
- packages of user default session plugins are automatically set as always enabled (can be toggled off)
- the plugin automatically treats PC EA packages with their secondary license type when the early access period has expired
1. When creating a scene or look to be released for free on the Hub, you would want to exclude any packages whose license doesn't allow free distribution.
2. When creating a paid scene or look, you would want to exclude any packages that don't allow commercial use.
Refer to official guidelines on license types:
When you're done with a project, it's easy to re-enable all packages by running the filter with all license types enabled.
Since VarLicenseFilter enables and disables packages en masse, it will affect every type of resource. This is good because even things like assetbundle vars and skin texture vars will get toggled on or off, and there's no built in way to easily check the licenses of those resources while browsing them.
⚠ Disclaimer: You are responsible for ensuring that your usage of the packages that you manage with VarLicenseFilter is in accordance with their licenses.
On first run, the plugin will ask you the location of the AddonPackages dir. The plugin scans VaM\Custom\PluginData\ and VaM\Saves\PluginData\ for suitable locations. You might already have a suitable symlinked location if you've installed JayJayWon's BrowserAssist, for example. If so, you can skip step 2 below.
- Put everlaster.VarLicenseFilter.1.var to your AddonPackages dir
- Create a symlink from VaM\Custom\PluginData\AddonPackages to VaM\AddonPackages by running the included batch file
- Open the everlaster.VarLicenseFilter.1.var
- Copy the CreateAddonPackagesSymlink.bat file to VaM\Custom\PluginData
- Run the batch file as administrator (right click -> Run as administrator)
- Start VaM, add the plugin to Session Plugins and open the UI
- Select and save the AddonPackages location
Warning: In theory, setting up the symlink can allow some malicious VaM plugin to delete the contents of the AddonPackages dir. Feel free to take any backups you think are necessary, and ensure that you only install plugins from reliable and trusted sources and creators.
"Undo run filters" resets the enabled state of all packages to what it was on initialization, except if the status changed due to being set always enabled or always disabled (see below).
When you install new add-on packages and want to filter them by license, you need to reload the plugin and run the filters again. The plugin doesn't keep track of what new packages are being added/removed, it just loads the packages once on initialization.
Managing individual packages
You might want to keep specific resources always available regardless of license type, even when those aren't plugins in your default session plugins preset.
In the below example, I added the TestPlugin (which was disabled in the above screenshot) to the "Always enabled packages" list, thus it will not be disabled despite having the PC EA license.
A note on disabling packages via Package Manager
If you disable a package via Package Manager and the plugin has never been initialized while that package has been present in your VaM installation, the plugin doesn't know about its license type. To fix this, just follow the instructions in the plugin UI.
How it works
Due to technical limitations, VarLicenseFilter has to jump through a couple of hoops in order to actually work. The first is having to set up the symlink to allow the plugin to write to the AddonPackages dir, and the second is having to restart VaM to actually filter the packages.
The plugin disables var packages by creating files with the ".disabled" file extension into the VaM\AddonPackages dir. Packages are enabled again by deleting those files. This is how VaM itself manages the enabling and disabling of a package when you toggle the Enabled checkbox in the package manager.
Restarting VaM via the plugin UI is a necessary step for enabling/disabling packages because VaM reads the .disabled files only on startup, and there's no way to programmatically enable or disable multiple packages at once while VAM is running.
The plugin scans all AddonPackages only when initialized. Initialization happens when you navigate to the plugin UI, so it's safe to keep it as a user default session plugin - until you open it, it will do nothing but wait. Once you open it, packages are scanned and the state is locked in terms of which AddonPackages are loaded and enabled. If you add/remove packages after the plugin is initialized, and want to run the license filters during the same session, you should reload the plugin first.
What data does the it store?
VarLicenseFilter writes to the following files in Custom\PluginData\everlaster\VarLicenseFilter:
|preferences.json||Stores the path to your symlink of AddonPackages, and whether packages of default session plugins are always enabled.|
The AddonPackages path can be changed manually in the preferences file. It must be a path under Saves\PluginData or Custom\PluginData. You can also delete the preferences file or just the path to make the plugin scan for suitable paths on startup.
|license_cache.json||Caches the license types of packages that have been enabled when the plugin was initialized.|
|secondary_license_cache.json||Caches the secondary license types and early access end dates of packages that have the PC EA primary license.|
|always_enabled_packages.txt||List of packages that are always enabled when VAM is restarted via the plugin.|
|always_disabled_packages.txt||List of packages that are always disabled when VAM is restarted via the plugin.|
If you change the license type of an existing var file that has been cached the plugin will not know about it. To fix, delete the cache files so they will be regenerated on the next initialization, or manually find and delete the var file's information from the JSON.
If you run into issues:
1. Please report the issue and describe it in detail so that I can investigate it.
2. Try deleting the Custom\PluginData\everlaster\VarLicenseFilter dir and see if that fixes things.
Thanks to @JayJayWon for the BrowserAssist plugin which served as inspiration for this plugin!