Trying to follow the information in…
Localizing media paths
I’ve not been able to get the method illustrated to work on Mac OS Catalina (10.15).
We have a main office server using Mac Paths as well as a remote clone of the material at a satellite office (also a Mac server). Shotgun database stores the path to the Main Office Server however, for various reasons, we cannot maintain the same file structure in the satellite office. So a user in the satellite office needs to have the path swapped to a different root.
What is the correct way to insure the RV_PATHSWAP_ROOT is set so that it persists when launching RV from our shotgun page?
3 Likes
Hi @Pumplerod,
Thanks for reaching us. What you need to do is to set global environments variable.
You could create ~/Library/LaunchAgents/environment.plist
. And then follow the document to reload environment variables.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>my.startup</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>
launchctl setenv RV_PATHSWAP_ROOT /satellite_office_path;
</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Hope this is helpful.
Loney
3 Likes
Thanks for the response @jing.liu
This is what I’ve done and it does not seem to work (at least not as I expect). Perhaps I’ve done any number of other things incorrectly. Is there a simple way to verify this is working? Is it confirmed to work on OS 10.5.x? For example if this works for all applications, I would expect I could go into a Terminal shell and echo $RV_PATHSWAP_ROOT
to verify, this does work however launching from the browser into RV does not change the path to find the local source.
The help page seems to indicate that I might need to log out/in but then it also suggests a method for loading the plist file. That indicates that I would not need to log out/in. Ideally I would like to be able to swap this for a session and having to do something requiring a full log out/in or restart is hugely problematic.
1 Like
Hi @Pumplerod
I am using 10.15.3 (I see the version in the first post). It works perfect. When you open a terminal, type env
will show effective variables.
Sometimes, reboot will help.
Loney
yes. I can confirm that opening Terminal and typing env
does work. My RV_PATHSWAP_ROOT
variable is there. The issue is that when I select a version from the shotgun within the browser and attempt to Play in RV
, RV will open and play the media but the path does not change. It is still looking for the media on the Primary Server.
1 Like
Hi @Pumplerod, did you set your enviroment variable like described above or another way? When RV launches via a hyperlink on OSX, it uses the launch agent, which is not the same environment as, for instance, your bash environment.
-Kessler
2 Likes
I set the environment as described above using the .plist file. How do I need to set the variable so that it is available to the launch agent? Would that be creating a /etc/launchd.conf
file?
1 Like
Actually it is in /Library/LaunchAgents
(or in your personal ~/Library/LaunchAgents
) Check out this link, as it includes the full details, paths, and commands you need to run to update the launch agent: https://support.shotgunsoftware.com/hc/en-us/articles/219042108-Setting-global-environment-variables-on-OS-X
We have confirmed this method works for 10.5.x
The best way to validate the environment variable is to check Help>Show Environment from within RV.
Thank you @Michael.Kessler being able to show the environment in RV is a huge help.
When I look at the ENV variables from RV after launching from the LaunchAgent I see that the variable for RV_PATHSWAP_ROOT
is, in fact, set correctly. It’s great to be able to verify that.
The issue seems to be that the path is not actually changing for the source media. Are there any other switches or check boxes that need to be selected in order to force RV to use the $RV_PATHSWAP_ROOT
?
Do you have the ${RV_PATHSWAP_ROOT} in your media paths? If not, you might want to consider using the RV_OS_PATH instead, which is a similar methodology, but replaces automatically based on roots.
On the same page as the RV_PATHSWAP, you can find all the info on the RV_OS_PATH variables. You need to have all your OSes defined on all (so Macs need both mac and windows/linux (whichever or both that you use).
For example. If your production paths on Linux are:
/production/show/.../file.0001.exr
and your macs are mounted as:
/Volumes/production/show/.../file.0001.exr
You would set on both linux and macs:
RV_OS_PATH_OSX_ROOT
= /Volumes/production
RV_OS_PATH_LINUX_ROOT
= /production
-Kessler
1 Like
Interesting. Thank you. I didn’t realize that the env variable needed to be embedded in the media path. I thought the RV_PATHSWAP_ROOT operated the same way as the RV_OS_PATH variables did.
In our case, the production is using a Mac and my local storage is also on a Mac, however do to the need to sometimes use VPN, I cannot have the local storage maintain the same directory structure as the production path.
so we have main source media in the shotgun media path as:
/Volumes/Project_Media
and on my local system I have:
/Volumes/Project_Local_Media
is there a way to swap that root location even though both systems are using the same OS?
1 Like
If you aren’t using Linux on your remote location, just call that location Linux and it will swap. It just does a mapping between multiple storage paths.
Its a bit of a hack, but should work for you.
1 Like
Brilliant!!! Thank you @Michael.Kessler . As Always, you’re a rockstar! that hack does seem to work (now if everything else in RV could just work like eve )
4 Likes
I feel like an idiot for having to ask this but, after a few days of your suggested work-around (Which was working great) I restarted my computer and now RV is no longer changing the PATH to point to the RV_OS_PATH_LINUX location. Checking the Variable’s value, as you mention through RV’s SHOW ENVIRONMENT menu option, shows that it is set correctly.
Clearly I must have fumbled over enough switches to have turned off some functionality. Any ideas on where to look to correct this.
2 Likes
hi @Pumplerod, that’s indeed stranage. Does both your linux and osx variable show up?
did your /Volume change? Sometimes depending on how you are mounting your volume, if you restart it can change names.
2 Likes
I’ve tried with both RV_OS_PATH_LINUX and RV_OS_PATH_MAC set and also with only RV_OS_PATH_LINUX. I’ve been trying all sorts of combinations to see what might have caused the change.
The Volumes on the machine remain the same. No change in the /Volumes/NAME. I’m not sure if the mount type is important. I’m using afp for my local drive. Was wondering if it might be some permissions issue that I somehow got around last time it was working but could have been reset after the restart.
1 Like
Hey @Pumplerod, if you’ve still got it not starting up, could you attach the path names to a ticket (I assume you don’t want path names in the forum) and we can take a look?
-Kessler
3 Likes