EventCallback - BeforeSave

   1909   4   3
User Avatar
Member
1 posts
Joined: 8月 2018
Offline
hey all!

Python question:
With hou.hipFile.addEventCallback, Im using the hou.hipFileEventType.BeforeSave callback and I want to Cancel the actual Save Action under certain conditions.
How can I cancel the actual Save Action inside my callback function?
Even if Im raising an Error, it still saves the hipFile after that!

Ideally I dont want to use the beforescenesave.py.
User Avatar
Member
1 posts
Joined: 1月 2019
Offline
Hi!

Have you managed to do this?
My idea was to modify the save path in BeforeSave with setName to save it to a temp location, so the actual file is unchanged and then restore it in AfterSave, but it fails with “Save failed for PATH. Invalid Argument”.
User Avatar
Member
6 posts
Joined: 11月 2019
Offline
Hey! Did you manage to find the answer?
User Avatar
Member
191 posts
Joined: 10月 2018
Offline
Just thinking out loud, maybe it's easier to remove the default Save and Save As and replace them with your own functions that you can control completely. For Save As you can just bring up the hou.ui.selectFile() dialog.
User Avatar
Member
380 posts
Joined: 6月 2018
Offline
Just bringing this up again. Did anyone managed to find a way?
Jonas Sorgenfrei
FX/PIPELINE TD | RISE Visual Effects Studios
  • Quick Links