Package nuke :: Module utils
[hide private]
[frames] | no frames]

Source Code for Module nuke.utils

 1  # Copyright (c) 2009 The Foundry Visionmongers Ltd.  All Rights Reserved. 
 2   
 3  import os.path 
 4  import nuke 
 5   
6 -class FnPySingleton(object):
7 - def __new__(type, *args, **kwargs):
8 if not '_the_instance' in type.__dict__: 9 type._the_instance = object.__new__(type) 10 return type._the_instance
11
12 -def script_directory():
13 scriptFilePath = nuke.root().knob("name").value() 14 if not scriptFilePath: 15 return "" 16 17 return os.path.dirname(scriptFilePath)
18