global, nuke: adding support for first workfile creation

This commit is contained in:
Jakub Jezek 2023-03-06 16:55:05 +01:00
parent 0993fa447d
commit b2eb14914b
No known key found for this signature in database
GPG key ID: 730D7C02726179A7
5 changed files with 39 additions and 21 deletions

View file

@ -13,7 +13,7 @@ def has_unsaved_changes():
def save_file(filepath):
path = filepath.replace("\\", "/")
nuke.scriptSaveAs(path)
nuke.scriptSaveAs(path, overwrite=1)
nuke.Root()["name"].setValue(path)
nuke.Root()["project_directory"].setValue(os.path.dirname(path))
nuke.Root().setModified(False)