Join our discord community

Please or Register to create posts and topics.

Run command before open and save scene

Hi there.

Is there any way to run a python command before opening or saveing a Maya scene file?

I want to do some publishing on my scene

Thanks

Usually you would do that with a custom Prism plugin in this directory: C:\Prism\Plugins\Custom

There is a readme in this directory which briefly explains how to create a new plugin. In your plugin you can put your python command in the "onSaveFile" or in the "onPublish" function. Unfortunately there is no function in the plugin which gets called when you open a scene, but I will add that as soon as possible and let you know. I also plan to simplify the plugin creation in the next update.

Thanks Richard.

In the new v1.2.0 version of Prism it should be a lot easier to do what you need:

  • 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
  • Use the "onSaveFile" and "onSceneOpen" functions to add your custom commands
  • Save the script
  • In the Prism Settings click on "Reload all plugins"