Hello,

I'd like to figure out the absolute path to the currently executed
init.py or menu.py when nuke is loading. I am trying to define the
show by path for these files dynamically at load time rather than hard
code the show name. For example I can have my per show init.py
register the Viewer gizmo based on the path that the init.py is in
versus hard coding it. We also do some databasing for this, but I'm
testing this out to see if I can quickly implement a new show by
simply dropping in another directory with some of these dynamic
components.

I think that "__file__" doesn't work on OSX? and/or it's a different
mentality when Nuke loads the init.py versus running python at the
Terminal.


this file:

/Tools/Settings/nuke/nuke_EEPShows/hrd/init.py

registers the show colorspace gizmo:

nuke.ViewerProcess.register("hrd_cSpace", nuke.Node, ("hrd_cSpace", ""))

but could be something dynamic like?:

path = os.path.abspath(os.path.dirname(__file__))
pathParts = path.split(os.sep)
show_cSpace = pathParts[5] + "_cSpace"
nuke.ViewerProcess.register(show_cSpace, nuke.Node, (show_cSpace, ""))


thx
Dan
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to