diff --git a/init.py b/init.py index 5d5e2948dd39ca355ce6dea15c053fc01b74ce1a..a5abac400f5e73caacdfd4933dc428d2b71a442f 100644 --- a/init.py +++ b/init.py @@ -8,4 +8,5 @@ nuke.pluginAddPath('helpers') # add module paths nuke.pluginAddPath('shot_selector') nuke.pluginAddPath('muybridge') -nuke.pluginAddPath('teleport') \ No newline at end of file +nuke.pluginAddPath('teleport') +nuke.pluginAddPath('startup') \ No newline at end of file diff --git a/startup/__init__.py b/startup/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0f4e65ea583dc5d87c2abb49476599203103b396 --- /dev/null +++ b/startup/__init__.py @@ -0,0 +1 @@ +from main import set_default \ No newline at end of file diff --git a/startup/bip_project_settings.py b/startup/bip_project_settings.py new file mode 100644 index 0000000000000000000000000000000000000000..b433a4dc0d3de3c022220a6b62bde22c3f566573 --- /dev/null +++ b/startup/bip_project_settings.py @@ -0,0 +1,19 @@ +""" +This module safely imports bip project data +""" + +from constants import ( + PROJECT_NAME, + PROJECT_WORKING_FORMAT, + PROJECT_DELIVERY_FORMAT, + PROJECT_FPS, +) + + +def get_bip_project_settings(): + project_settings = {"project_name": PROJECT_NAME, + "project_working_format": PROJECT_WORKING_FORMAT, + "project_delivery_format": PROJECT_DELIVERY_FORMAT, + "project_fps": PROJECT_FPS, + } + return project_settings diff --git a/startup/constants.py b/startup/constants.py new file mode 100644 index 0000000000000000000000000000000000000000..b723faa912feff0d2efbabfaf74466845911af17 --- /dev/null +++ b/startup/constants.py @@ -0,0 +1,8 @@ +""" +This are the constant values +""" + +PROJECT_NAME = "Blinkink" +PROJECT_WORKING_FORMAT = "1920 1080 1.0" +PROJECT_DELIVERY_FORMAT = "1920 1080 1.0" +PROJECT_FPS = 25 diff --git a/startup/init.py b/startup/init.py new file mode 100644 index 0000000000000000000000000000000000000000..eb9e273aadfba6c4ef5c94780ae1d92ef2b28928 --- /dev/null +++ b/startup/init.py @@ -0,0 +1,3 @@ +import startup + +startup.set_default() \ No newline at end of file diff --git a/startup/main.py b/startup/main.py new file mode 100644 index 0000000000000000000000000000000000000000..adc89d89be11c833623c99a7901d9c893eebc148 --- /dev/null +++ b/startup/main.py @@ -0,0 +1,20 @@ +""" +This module sets nuke default using project manager settings +""" + +import nuke +from bip_project_settings import get_bip_project_settings + + +def set_default(): + # get project settings from bip + project_settings = get_bip_project_settings() + project_name = project_settings["project_name"] + + # Create working and delivery formats + nuke.addFormat(project_settings["project_working_format"] + project_name + "_WorkingFormat") + nuke.addFormat(project_settings["project_delivery_format"] + project_name + "_DeliveryFormat") + + # Set nuke default to use project settings + nuke.knobDefault("Root.format", project_name + "_WorkingFormat") + nuke.knobDefault("Root.fps", str(project_settings["project_fps"])) \ No newline at end of file diff --git a/startup/menu.py b/startup/menu.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391