-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRender_Path.py
More file actions
31 lines (25 loc) · 895 Bytes
/
Copy pathRender_Path.py
File metadata and controls
31 lines (25 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
import subprocess
import nuke
current_node = nuke.thisNode()
file_path = current_node["file"].getValue()
if file_path:
print("File Path:", file_path)
folder_path = os.path.dirname(file_path)
# Open file browser based on the platform
if folder_path:
script_directory = os.path.normpath(folder_path)
if nuke.env['WIN32']:
# Windows
subprocess.Popen(['explorer', script_directory])
elif nuke.env['MACOS']:
# macOS
subprocess.Popen(['open', script_directory])
else:
# Other platforms (Linux, etc.)
nuke.message("File browser open not supported on this platform.")
else:
nuke.message("Folder path is not available.")
print("Updated Folder Path:", folder_path)
else:
nuke.message("Please render something first.")