Skip to content

Commit

Permalink
[SHOT-3305] When opening VRED out of Shotgun VRED ignores the VRED_SC…
Browse files Browse the repository at this point in the history
…RIPT_PLUGINS environment variable (#24)

* be sure to not override the VRED_SCRIPT_PLUGINS environment variable when setting SG plugin path
* move the order of the paths for the VRED_SCRIPT_PLUGINS in order to be sure the user path will be expanded using the script path convention
  • Loading branch information
barbara-darkshot authored Mar 18, 2020
1 parent efbafd8 commit 59e2497
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,16 @@ def prepare_launch(self, exec_path, args, file_to_open=None):
# Register plugins
plugin_dir = os.path.join(self.disk_location, "plugins", "Shotgun")
vred_plugins_dir = os.path.join(os.path.dirname(exec_path), "Scripts")
required_env["VRED_SCRIPT_PLUGINS"] = "{};{}".format(
plugin_dir, vred_plugins_dir
)

# be sure to not override the VRED_SCRIPT_PLUGINS environment variable if it's already declared
if "VRED_SCRIPT_PLUGINS" in os.environ.keys():
required_env["VRED_SCRIPT_PLUGINS"] = "{};{};{}".format(
plugin_dir, vred_plugins_dir, os.environ["VRED_SCRIPT_PLUGINS"]
)
else:
required_env["VRED_SCRIPT_PLUGINS"] = "{};{}".format(
plugin_dir, vred_plugins_dir
)

# SHOTGUN_ENABLE is an extra environment variable required by VRED
required_env["SHOTGUN_ENABLE"] = "1"
Expand Down

0 comments on commit 59e2497

Please sign in to comment.