Automatically expanding environment variables on paths on json files

jmeile

New Member
Hi

I was thinking about doing a portable scene collection, which I could, let's say, store on the user's desktop. On Windows you can set the path as follows:
%USERPROFILE%\Desktop\My_OBS_Resources

and on linux/macOS:
$HOME/Desktop/My_OBS_Resources

I'm using OBS under Windows and tried to manually modify the path on a .json export file to:
%USERPROFILE%/Desktop/My_OBS_Resources

Please note the use of slashes instead of backslashes. It seems that OBS wants slashes. Anyway, it didn't work. If I try this on the Windows Command Prompt:
cd /D %USERPROFILE%/Desktop/My_OBS_Resources

It works; even if %USERPROFILE% has backslashes on it. It seems that Windows accepts both.

It would be nice to have environment expansion on OBS. I don't know which programming language does OBS is done, but I know that most modern languages have built-in routines to expand environment variables.

That would be my idea.

Best regards
Josef
 

jmeile

New Member
I can't edit the post anymore, so, here I add what I was writing while the edit time expired :-(

Another way would be to make it OS independent, so, let OBS automatically expand "HOME" to "USERPROFILE" on Windows and viceversa on Linux/macOS.

Interesting variables would be:
  • Windows: APPDATA, COMPUTERNAME, LANG, LOCALAPPDATA, PUBLIC, SystemDrive, TEMP, and USERPROFILE
  • Linux: HOME, HOSTNAME, LANG, and LANGUAGE
As you see, linux has less variables.

Best regards
Josef
 

tech@chalice

New Member
This would be awesome. I have multiple people working on a project each week and we have to change the paths in the scene collection to make things work. It would be great if we could each define an environment variable for the home of the project so that the scene collection would be portable.
 
Top