Hi guys,

probably a simple one for you: I'm trying to put the fixPaths-Script into a 
Menu in Nuke.

This is my fixPaths.py (http://www.jessieamadio.com/scripts/fixPaths.py - 
thanks a lot):

import os, nuke

inputPath = nuke.getFilename("input")
inputDir = os.path.dirname(inputPath)

projFolder = os.path.basename(inputDir)

for n in nuke.allNodes():
    if n.Class() == "Read" or n.Class() == "ReadGeo":
        
        oldPath = nuke.filename(n)
        if not os.path.exists(oldPath):
        
            pathTuple = oldPath.partition(projFolder)
        
            fileKnob = n.knob("file")
            fileKnob.setValue(inputDir + pathTuple[2])

So I indented it one step and put a

def pixPath():

in the beginning.

in my menu.py is the following:

stMenuE.addCommand('fix paths', 'fixPaths()')

But I get the error

Traceback (most recent call last):
        File "<string>", line 1, in
<module>
TypeError: 'module' object is not callable

The script loaded into the script editor works. But I cannot call it from a 
menu.
Any ideas?
And another question: Should this work on any OS?

The idea is to easily fix all Read nodes when a project is moved from one place 
to another.

Thanks,

Anselm



_______________________________________________
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