FWIW, I find when its an 'error interpreting this plugin' with no more info - 
its usually an indentation or a mixture of tabs and spaces in the file

 
Howard



>________________________________
> From: RP <[email protected]>
>To: [email protected] 
>Sent: Friday, 20 July 2012, 15:52
>Subject: [Nuke-python] Re: Simple string implementation question
> 
>
>Thanks for all your help Chris, I've got it working, it was all down to the 
>indentation
>
>
>RP
>
>
>
>chris wrote:  
>Quote:  
>It still doesn't work, keep getting the 
>/usr/local/Nuke6.3v7/plugins/menu.py : error interpreting this plugin
> 
>are you sure you have the right formatting (indent/whitespace) 
>in the setLabel.py file?
>
>
>Quote:  
>I dont really understand what the def setLabel(): does?
>
>Quote:  
>m.addCommand("Set Read Label", "setLabel.setLabel()")
>  
>well, i'm far from a python expert myself, but my understanding 
>is that you're calling the function setLabel() from the file setLabel.py
>therefore the call to setLabel.setLabel()
>
>you could have a second function called setLabel12() in the same 
>file setting the label to the 12th segment, so the setLabel.py 
>file would like this:
>
>import nuke
>def setLabel():
>for n in nuke.selectedNodes():
>n.knob('label').setValue( n['file'].value().split('/')[13])
>
>def setLabel12():
>for n in nuke.selectedNodes():
>n.knob('label').setValue( n['file'].value().split('/')[12])
>
>
>... then add another entry to menu.py calling that:
>m.addCommand("Set Read Label 12", "setLabel.setLabel12()")
>
>
>Quote:  
>Using it in the script editor makes the script do nothing, no 
>errors, just no function
> that's probably because you're just defining the function, not 
>calling it. this should work from the script editor:
>
>def setLabel():
>for n in nuke.selectedNodes():
>n.knob('label').setValue( n['file'].value().split('/')[13])
>setLabel()
>
>
>i suggest digging around a bit in the manual about the basics of 
>python and watch the tutorials by frank on the foundry site. he 
>explains it much better then me (and more accurate too)
>++ chris
>
>
>
>
>On 7/20/12 at 3:48 PM, [email protected] (RP) wrote:
>
>
>Quote:  
>It still doesn't work,
>keep getting the /usr/local/Nuke6.3v7/plugins/menu.py : error 
>interpreting this plugin
>
>
>
>I dont really understand what the def setLabel(): does?
>
>Using it in the script editor makes the script do nothing, no 
>errors, just no function
>
>
>
>
>chris wrote:
>
>Quote:  
>have you defined is as a function?
>your setLabel.py should look something like this and be in
> your
>
>Quote:  
>nuke plugin path:
>
>
>import nuke
>
>def setLabel():
>for n in nuke.selectedNodes():
>n.knob('label').setValue(
> n['file'].value().split('/')[13])
>
>Quote:  
>
>
>
>On 7/20/12 at 3:03 PM, [email protected]
> (RP) wrote:
>
>Quote:  
>
>
>
>Quote:  
>I found the solution to my own problem
>
>I've changed it to
>for n in nuke.selectedNodes():
>n.knob('label').setValue(
>  n['file'].value().split('/')[13])
>
>Quote:  
>Quote:  
>
>this seems to work, but now I have new problem
>
>I want to have this script has a tool from a drop down
>  menu,
>
>Quote:  
>Quote:  
>I've saved it as setlLabel.py in my plugins folder, and
>  edited
>
>Quote:  
>Quote:  
>my menu.py with
>
>import setLabel
>m.addCommand("Set Read Label", "setLabel.setLabel()")
>
>But now nuke wont start
>
>RP
>
>
>
>
>
>-----
>
>nuke-python
>
>
> 
> 
>
>
>
>
>
>-----
>
>nuke-python
>
>  
>_______________________________________________
>Nuke-python mailing list
>[email protected], http://forums.thefoundry.co.uk/
>http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
>
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to