Join our discord community

Forum breadcrumbs - You are here:ForumPrism: Generalsetting $JOB to local project
Please or Register to create posts and topics.

setting $JOB to local project

This is probably really easy with Prism, but I'm not much of a programmer. Like the title say, I would like Prism to automatically set the $JOB variable in Houdini to the local project path when prism launch. Any tips on how to achieve that?

Prism already sets the $JOB variable to the current global project path. But you want to set it to the local project path?

You could modify the Prism script, but then you would have to do that for every member of your team (unless you use a central installation) and when you update Prism the next time your modifications are gone.

The better option would be to use the Plugin features of the new Prism version. I give you a quick guideline how you could do that, but if that's still unclear I can give you an example.

  • Open the Prism Settings dialog and in the new "Plugins" tab you can create a new plugin of type "custom".
  • That will open the directory where the scripts from the new plugin are located
  • There you will see a file "Prism_<PLUGINNAME>_Functions.py"
  • Open that file in a text editor
  • Search for the function called "onProjectChanged"
  • This function will be called everytime you change the project (that also happens when you startup Houdini)
  • In this function you can add any python code which should be executed in that situation. For your example use this:
	@err_decorator
	def onProjectChanged(self, origin):
		# check if loaded in Houdini
		if not self.core.appPlugin.pluginName == "Houdini":
			return

		# check if the local project is enabled
		if not self.core.useLocalFiles:
			return

		# get the local projectpath
		job = self.core.localProjectPath.replace("\\", "/")
		# make sure it doesn't end with "/"
		if job.endswith("/"):
			job = job[:-1]

		# execute the hscript command, which sets the $JOB variable in Houdini
		import hou
		hou.hscript("set JOB=" + job)
  • Make sure the indentations match with the rest of the file and save the file
  • In the Prism Settings click on "Reload all plugins"
  • Change the Prism project or restart Houdini
  • Any string parameter in Houdini, which contain $JOB will use the local project path now (maybe you have to click on the parameter to make it recognize the changed variable path)