Platform-specific Paths

We have a mixed platform environment here. The fields within a Version entity that get populated by the various publish tools that I’m most interested in are: sg_path_to_frames and sg_path_to_movie. If users publish on Windows, these get a mapped network drive, like V:/path/to/some/movie.mov. If they publish on Mac, they get /Volumes/storage_root/path/to/some/movie.mov. When I try to play these Versions in RV on a platform that these Versions were not published from - as in, user publishes from a Windows workstation, reviewer launches RV on a Mac, we get the following:

INFO: no 'Movie' media, switching to 'Streaming' 

I was able to create a shotgrid_fields_config_custom.mu file, and put it in the path. The only problem is - it looks like the path to the Movie and the path to the frames get set to nil BEFORE this file is even used, so adding logic to the fieldsCompute() function appears to do nothing.

Thoughts?

When I was on support, this was a pretty common thing to do.

https://help.autodesk.com/view/SGSUB/ENU/?guid=SG_RV_rv_manuals_rv_user_manual_rv_user_manual_chapter_a_html

I prefer the newer RV_OS_PATH variables. Note that you need all the OS variables on each system (not just your current OS) for this to work.

For instance:
RV_OS_PATH_OSX would be set to /Volumes/storage_root/
RV_OS_PATH_WINDOWS would be set to V:\

That way, when RV encounters a path starting with V:\ on mac, it would see it matches another platform’s path (by reading the Windows one) and do the proper replacement.

Cheers,
-Kessler

1 Like

@Michael.Kessler thank you so much for getting back to me!

I have an exceptionally hokey way of defining environment variables on OSX - I made a shell script that runs at boot with a .plist file, and inside the shell script I set the environment variables with launchctl setenv.

I will say - I had attempted to do these path rewrites in a shotgrid_fields_config_custom.mu file. Something I was doing must have overwritten the values in these fields, since even with the environment variables defined, they were showing up as nil, and the multi-source widget was not populating correctly.

I deleted the shotgrid_fields_config_custom.mu script that I had made, and magically, this worked with the environment variables defined.

1 Like

Trust me, I believe that; and Apple changes what works every few versions.

I hated walking people through that; combine the default of ‘fixing your quotes’ on mac, it made for some really painful support (sorry for anyone who had to be on a call with me trying to figure out where your bad quote was, nothing against you; just a sucky problem).

Glad you got it working. Also note you can have multiple paths (see that doc) in case you have multiple roots.

Cheers!

PS: Now that RV is open-source, if someone wanted to be extra-awesome, they’d make a pre-pass on the config that finds a section that reimplements environment variables as a config section. If someone were to do that, it would make my day :wink:

1 Like