• Hi Guest!

    We have posted a new VaM2 dev log on Patreon, starting a monthly cadence of written progress updates between Beta releases. Highlights include the new Gizmos System, Selection Carousel, and Modes System with Context-Specific Editing. Beta1.2 is 15 of 21 items complete.

    Read the full post on Patreon, or follow progress on the public Trello roadmap.

VaM 1.x "Hardcoded" file loading

Threads regarding the original VaM 1.x

Aipas

Active member
Joined
Sep 27, 2024
Messages
113
Reactions
147
Say a plugin is "hardcoded" to load a settings file with a specific file name, and creates this file once installed.
If a var contains the settings file with the same name, is it possible to load that file instead, when loading a scene from that var, or is it a necessarily a manual process (replace the settings file)?

Plugin in question is no longer being maintained, but there are no alternatives (that I know of) and I believe the question is generic enough to post here.
 
If you're talking from a coding perspective, you can do obviously pretty much whatever you want. It's just a matter of looking at the file, if it exists, etc.
Or if the plugin allows to choose what setting you wanna use (local or var one).

Now, if you're asking if the plugin CAN already do it... that is hard to say anything without mentionning what plugin it is : ')
 
Upvote 0
It's LFE's keyboard shortcuts.
I've used it in a scene in which I control a person's hip via mouse axis (bit of an experiment).

Scene is meant to be released, but I have no way of making the plugin use the lfe_keyboardshortcuts.json (settings file) packed inside the var. Plugin has no preset loading or something of the sort, so it will always load the default lfe_keyboardshortcuts.json it creates in Vam Root/saves once it's installed.
Basically I want it to load a diferent lfe_keyboardshortcuts.json, but there's probably no way around it...

Thought I'd ask anyway.
 
Upvote 0
Bt the atom the plugin is in can do presets ;)

Update:
Ah, it's a session plugin, not a scene plugin.
What about using a session plugin preset?

Update 2:

Oh, it can work on both places.
 
Last edited:
Upvote 0
Atani gave you a solution. But session plugins are NOT saved with the scene (if I'm not mistaken), I don't think you can rely on that.
If you're planning to explain to people to load the session plugin, you can include a preset in the var to tell them to load it.
 
Upvote 0
That occured to me, but since the plugin doesn't have an option to load a profile (always loads the same file) it won't work right?

I've also looked in the scene's .json and there's nothing there that allows me to use a specific file.
Line 140819: "plugin#0" : "LFE.KeyboardShortcuts.12:/Custom/Scripts/LFE/KeyboardShortcuts/src/KeyboardShortcuts.cslist"
Line 140836: "id" : "plugin#0_LFE.KeyboardShortcuts.Main.Plugin",
 
Upvote 0
Plugin is not session, it's contained within an atom.

I think the only way would be for users to manually replace the settings file, unless I'm missing something.
Going to have a look at atom presets.
 
Upvote 0
That occured to me, but since the plugin doesn't have an option to load a profile (always loads the same file) it won't work right?

I've also looked in the scene's .json and there's nothing there that allows me to use a specific file.
Line 140819: "plugin#0" : "LFE.KeyboardShortcuts.12:/Custom/Scripts/LFE/KeyboardShortcuts/src/KeyboardShortcuts.cslist"
Line 140836: "id" : "plugin#0_LFE.KeyboardShortcuts.Main.Plugin",

It should. Presets are meant to load all the values from it.
If it doesn't. It means the plugin is coded in a way that does not handle proper reload of the JSONStorable of a plugin.
 
Upvote 0
I'm not sure I can post a plugin's code here, so I'll just say that after messing around in its files I found a line where the plugin calls the file lfe_keyboardshortcuts.json to load.
I altered that settings file when making the scene to create the functionality I wanted, but when I create a var with the scene, the end user has no way to use those settings, even if I pack it in the var, because when he downloads the plugin (via my scene's dependencies), it will create a default settings file I have to way to "circumvent".

It's like the plugin was made without sharing settings files in mind, except for manual settings replacement.
Not complaining, mind you, just curious if I could do something about it.

But, again, thanks for trying guys.
 
Upvote 0
Back
Top Bottom