Python expression in file save ?

   2564   3   2
User Avatar
Member
767 posts
Joined: April 2014
Offline
Can you use the python expressions within a file saving dialog (File > Save As; etc ?)
【T】【C】【S】
User Avatar
Staff
1296 posts
Joined: July 2005
Offline
Hello,

I'm not sure if I understand the question correctly but if you are looking to run Python code when a file is saved then you should be able to by creating a couple of .py files in your Houdini user prefs directory:
-> $HOME/houdini16.0/scripts/afterscenesave.py
-> $HOME/houdini16.0/scripts/beforescenesave.py

As the file names suggest, one file is executed right before the .hip file is saved and the other is executed right after.

Cheers,
Rob
User Avatar
Member
767 posts
Joined: April 2014
Offline
Are the file names arbitrary; as you've demonstrated ? As long as they are located within the HOME path mentioned ?
Edited by _Christopher_ - Aug. 4, 2017 21:07:41
【T】【C】【S】
User Avatar
Staff
1296 posts
Joined: July 2005
Offline
Yes. The filenames must be afterscenesave.py and beforescenesave.py. And yes, as long as they appear in $HOME/houdini16.0/scripts (or more generally in a ‘scripts’ subdirectory of your HOUDINI_PATH), then Houdini will pick them up.

Cheers,
Rob
  • Quick Links