import KEnv
import os
import nuke

# KEnv
try:
    project = os.getenv('PROJECT')
except:
    project = "GEN"

env = KEnv.create(PROJECT=project, APP_ID='nuke')
projectID = env.get('PROJECT_ID')
formats = env.get('IMAGEFORMATS')

# 3D FOLDER
WORK_3D_ROOT = env.get('WORK_3D_ROOT')
RENDER_3D_ROOT = env.get('RENDER_3D_ROOT')
PROCESSED_FOOTAGE_ROOT_3D  = env.get('PROCESSED_FOOTAGE_ROOT_3D')

# 2D FOLDER
WORK_2D_ROOT = env.get('WORK_2D_ROOT')
RENDER_2D_ROOT = env.get('RENDER_2D_ROOT')
PROCESSED_FOOTAGE_ROOT_2D  = env.get('PROCESSED_FOOTAGE_ROOT_2D')

# GEN
CAMERAS_ROOT = env.get('CAMERAS_ROOT')
SETDATA_ROOT = env.get('SETDATA_ROOT')


FAVOURITES = (
    ('WORK_3D_ROOT', WORK_3D_ROOT),
    ('RENDER_3D_ROOT', RENDER_3D_ROOT),
    ('PROCESSED_FOOTAGE_ROOT_3D', PROCESSED_FOOTAGE_ROOT_3D),
    ('WORK_2D_ROOT', WORK_2D_ROOT),
    ('RENDER_2D_ROOT', RENDER_2D_ROOT),
    ('PROCESSED_FOOTAGE_ROOT_2D', PROCESSED_FOOTAGE_ROOT_2D),
    ('CAMERAS_ROOT', CAMERAS_ROOT),
    ('SETDATA_ROOT', SETDATA_ROOT),
)

class projectFavorites(KellerNukePlugin):

    def configurePlugin(self):
        for (key, value) in FAVOURITES:
            nuke.addFavoriteDir(key,value)
    
    def unconfigurePlugin(self):
        for (key, value) in FAVOURITES:
            nuke.removeFavoriteDir(key)