Re: [Nuke-users] Importing functions for menu.py

2016-10-23 Thread Frank Rueter|OHUfx

It's a python keyword:
http://www.secnetix.de/olli/Python/lambda_functions.hawk

On 10/24/2016 10:27 AM, Daniel Hartlehnert wrote:

Hey,

that makes perfect sense, thank you.

Is „lambda“ a reserved keyword for that, or was that your example and 
it can be enything?



Am 23.10.2016 um 21:56 schrieb Frank Rueter|OHUfx >:


In python you call (i.e. execute) a function by calling it's name 
followed by arguments in brackets:

e.g.:
myFunction()

"myFunction" without the brackets is the actual function object. You 
can reference it by using it's name without brackets, e.g.:


refToFunction = myFunction

Then later, actually run that function like so (even via the newly 
created reference:

refToFunction()
which is the same as calling myFunction() at this point

In the menu command you don't actually want to execute the function 
at the stage where the menu.py is interpreted (ie. Nuke startup), you 
just want to provide Nuke with the function object that is meant to 
be executed when the user calls the respective menu entry, hence the 
lack of brackets.


If you need to pass arguments as well you can either use a string 
like this (not very pythonic):
nuke.menu("Nodes").addCommand("User/FiletypeConverter", 
*"dh_pycode.fileconverter(arg1, ag2)"*)


Or a so called anonymous function via "lambda" :
nuke.menu("Nodes").addCommand("User/FiletypeConverter", *lambda: 
dh_pycode.fileconverter(arg1, ag2)*)


"lambda" wraps up the function call in an nameless object (function) 
and passes that on to Nuke to be executed later.



Does that make sense?

Cheers,
frank

On 23/10/16 2:48 AM, Daniel Hartlehnert wrote:


I already tried to start Nuke from the terminal mode but didn’t know 
how to make it work. Thanks for the link!
Seeing the detailed error message now, it turns out it was some 
indentation error in dh_pycode.py


There is one follow-up thing i am wondering about though:
When calling the function inside the .py file, there are no empty 
brackets behind it.



nuke.menu("Nodes").addCommand("User/FiletypeConverter",
dh_pycode.fileconverter, ‚‘)


i would have expected dh_pycode.fileconverter() instead.
What i if i want to pass arguments to the function?



Am 22.10.2016 um 14:36 schrieb Justin GD >:


You need to launch Nuke in terminal mode so we can see exactly the 
error.


You can follow the doc for that :
http://help.thefoundry.co.uk/nuke/content/getting_started/installation/launching_nuke_mac.html

Alternatively, you might be able to see it when you click "show 
more", in the pop up error window.


Also, make sure your dh_pycode.py is added to the nuke path, in 
your init.py if it's in a sub folder.


Cheers,
J

2016-10-22 13:12 GMT+01:00 Daniel Hartlehnert >:


Hi Justin,

i am on OS X, i don’t see any terminal when starting Nuke.
I commented out every line in dh_pycode.py, but still i get the
same error.



Am 22.10.2016 um 13:28 schrieb Justin GD
>:

Hi Daniel,

Can you send the full error message ? In your terminal, you
should have the error line / file indicated.
This is most likely an error in your dh_pycode file.

Cheers,
Justin

2016-10-22 12:08 GMT+01:00 Daniel Hartlehnert >:

Hi,

in my .nuke folder i have a text file called dh_pycode.py
It contains several functions i want to call in my menu.py
like this:

import sys
import nuke
import dh_pycode

nuke.menu("Nodes").addCommand("User/FiletypeConverter",
dh_pycode.fileconverter, '‘)

i always get the message „error interpreting this plug-in“
when starting nuke.
There are other menu entries added in the menu.py which
are not calling functions from  the dh_pycode.py. When i
comment out „import dh_pycode“ and its corresponding menu
entry, everything works.
How do you call external python code in menu.py?

Daniel



___
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk
,
http://forums.thefoundry.co.uk/

http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users



___
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk
,
http://forums.thefoundry.co.uk/ 
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users





Re: [Nuke-users] Importing functions for menu.py

2016-10-23 Thread Daniel Hartlehnert
Hey,

that makes perfect sense, thank you.

Is „lambda“ a reserved keyword for that, or was that your example and it can be 
enything?


> Am 23.10.2016 um 21:56 schrieb Frank Rueter|OHUfx :
> 
> In python you call (i.e. execute) a function by calling it's name followed by 
> arguments in brackets:
> e.g.:
> myFunction()
> 
> "myFunction" without the brackets is the actual function object. You can 
> reference it by using it's name without brackets, e.g.:
> 
> refToFunction = myFunction
> 
> Then later, actually run that function like so (even via the newly created 
> reference:
> refToFunction()
> which is the same as calling myFunction() at this point
> 
> In the menu command you don't actually want to execute the function at the 
> stage where the menu.py is interpreted (ie. Nuke startup), you just want to 
> provide Nuke with the function object that is meant to be executed when the 
> user calls the respective menu entry, hence the lack of brackets.
> 
> If you need to pass arguments as well you can either use a string like this 
> (not very pythonic):
> nuke.menu("Nodes").addCommand("User/FiletypeConverter", 
> "dh_pycode.fileconverter(arg1, ag2)")
> 
> Or a so called anonymous function via "lambda" :
> nuke.menu("Nodes").addCommand("User/FiletypeConverter", lambda: 
> dh_pycode.fileconverter(arg1, ag2))
> 
> "lambda" wraps up the function call in an nameless object (function) and 
> passes that on to Nuke to be executed later.
> 
> 
> Does that make sense?
> 
> Cheers,
> frank
> 
> On 23/10/16 2:48 AM, Daniel Hartlehnert wrote:
>> 
>> I already tried to start Nuke from the terminal mode but didn’t know how to 
>> make it work. Thanks for the link!
>> Seeing the detailed error message now, it turns out it was some indentation 
>> error in dh_pycode.py
>> 
>> There is one follow-up thing i am wondering about though:
>> When calling the function inside the .py file, there are no empty brackets 
>> behind it.
 nuke.menu("Nodes").addCommand("User/FiletypeConverter", 
 dh_pycode.fileconverter, ‚‘)
>> i would have expected dh_pycode.fileconverter() instead.
>> What i if i want to pass arguments to the function?
>> 
>> 
>> 
>>> Am 22.10.2016 um 14:36 schrieb Justin GD >> >:
>>> 
>>> You need to launch Nuke in terminal mode so we can see exactly the error. 
>>> 
>>> You can follow the doc for that :
>>> http://help.thefoundry.co.uk/nuke/content/getting_started/installation/launching_nuke_mac.html
>>>  
>>> 
>>> 
>>> Alternatively, you might be able to see it when you click "show more", in 
>>> the pop up error window. 
>>> 
>>> Also, make sure your dh_pycode.py is added to the nuke path, in your 
>>> init.py if it's in a sub folder.
>>> 
>>> Cheers,
>>> J
>>> 
>>> 2016-10-22 13:12 GMT+01:00 Daniel Hartlehnert >> >:
>>> Hi Justin,
>>> 
>>> i am on OS X, i don’t see any terminal when starting Nuke.
>>> I commented out every line in dh_pycode.py, but still i get the same error.
>>> 
>>> 
 Am 22.10.2016 um 13:28 schrieb Justin GD >:
 
 Hi Daniel,
 
 Can you send the full error message ? In your terminal, you should have 
 the error line / file indicated.
 This is most likely an error in your dh_pycode file.
 
 Cheers,
 Justin
 
 2016-10-22 12:08 GMT+01:00 Daniel Hartlehnert >:
 Hi,
 
 in my .nuke folder i have a text file called dh_pycode.py
 It contains several functions i want to call in my menu.py like this:
 
 import sys
 import nuke
 import dh_pycode
 
 nuke.menu("Nodes").addCommand("User/FiletypeConverter", 
 dh_pycode.fileconverter, '‘)
 
 i always get the message „error interpreting this plug-in“ when starting 
 nuke.
 There are other menu entries added in the menu.py which are not calling 
 functions from  the dh_pycode.py. When i comment out „import dh_pycode“ 
 and its corresponding menu   
 entry, everything works.
 How do you call external python code in menu.py?
 
 Daniel
 
 
 
 ___
 Nuke-users mailing list
 Nuke-users@support.thefoundry.co.uk 
 , 
 http://forums.thefoundry.co.uk/ 
 http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users 
 
 
 ___
 Nuke-users mailing list
 Nuke-users@support.thefoundry.co.uk 
 , 
 http://forums.thefoundry.co.uk/ 

Re: [Nuke-users] Importing functions for menu.py

2016-10-23 Thread Frank Rueter|OHUfx
In python you call (i.e. execute) a function by calling it's name 
followed by arguments in brackets:

e.g.:
myFunction()

"myFunction" without the brackets is the actual function object. You can 
reference it by using it's name without brackets, e.g.:


refToFunction = myFunction

Then later, actually run that function like so (even via the newly 
created reference:

refToFunction()
which is the same as calling myFunction() at this point

In the menu command you don't actually want to execute the function at 
the stage where the menu.py is interpreted (ie. Nuke startup), you just 
want to provide Nuke with the function object that is meant to be 
executed when the user calls the respective menu entry, hence the lack 
of brackets.


If you need to pass arguments as well you can either use a string like 
this (not very pythonic):
nuke.menu("Nodes").addCommand("User/FiletypeConverter", 
*"dh_pycode.fileconverter(arg1, ag2)"*)


Or a so called anonymous function via "lambda" :
nuke.menu("Nodes").addCommand("User/FiletypeConverter", *lambda: 
dh_pycode.fileconverter(arg1, ag2)*)


"lambda" wraps up the function call in an nameless object (function) and 
passes that on to Nuke to be executed later.



Does that make sense?

Cheers,
frank

On 23/10/16 2:48 AM, Daniel Hartlehnert wrote:


I already tried to start Nuke from the terminal mode but didn’t know 
how to make it work. Thanks for the link!
Seeing the detailed error message now, it turns out it was some 
indentation error in dh_pycode.py


There is one follow-up thing i am wondering about though:
When calling the function inside the .py file, there are no empty 
brackets behind it.



nuke.menu("Nodes").addCommand("User/FiletypeConverter",
dh_pycode.fileconverter, ‚‘)


i would have expected dh_pycode.fileconverter() instead.
What i if i want to pass arguments to the function?



Am 22.10.2016 um 14:36 schrieb Justin GD >:


You need to launch Nuke in terminal mode so we can see exactly the 
error.


You can follow the doc for that :
http://help.thefoundry.co.uk/nuke/content/getting_started/installation/launching_nuke_mac.html

Alternatively, you might be able to see it when you click "show 
more", in the pop up error window.


Also, make sure your dh_pycode.py is added to the nuke path, in your 
init.py if it's in a sub folder.


Cheers,
J

2016-10-22 13:12 GMT+01:00 Daniel Hartlehnert >:


Hi Justin,

i am on OS X, i don’t see any terminal when starting Nuke.
I commented out every line in dh_pycode.py, but still i get the
same error.



Am 22.10.2016 um 13:28 schrieb Justin GD >:

Hi Daniel,

Can you send the full error message ? In your terminal, you
should have the error line / file indicated.
This is most likely an error in your dh_pycode file.

Cheers,
Justin

2016-10-22 12:08 GMT+01:00 Daniel Hartlehnert >:

Hi,

in my .nuke folder i have a text file called dh_pycode.py
It contains several functions i want to call in my menu.py
like this:

import sys
import nuke
import dh_pycode

nuke.menu("Nodes").addCommand("User/FiletypeConverter",
dh_pycode.fileconverter, '‘)

i always get the message „error interpreting this plug-in“
when starting nuke.
There are other menu entries added in the menu.py which are
not calling functions from the dh_pycode.py. When i comment
out „import dh_pycode“ and its corresponding menu entry,
everything works.
How do you call external python code in menu.py?

Daniel



___
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk
,
http://forums.thefoundry.co.uk/

http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users



___
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk
,
http://forums.thefoundry.co.uk/ 
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users




___
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk
,
http://forums.thefoundry.co.uk/ 
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Re: [Nuke-users] Importing functions for menu.py

2016-10-22 Thread Magno Borgo

Also your quotes on the end of line are not the same  '‘


On Sat, 22 Oct 2016 09:50:15 -0400, Daniel Hartlehnert   
wrote:


Ok, just as i sent the follow-up question, your answer comes in, spooky  
:O



Am 22.10.2016 um 15:27 schrieb Justin GD :

You need to put it as a string when you have arguments in the function;  
So it doesn't execute when Nuke starts, but only when the user click on  
the >>menu.


nuke.menu("Nodes").addCommand("User/FiletypeConverter",  
'dh_pycode.fileconverter(my_args)', '‘)



No need to put it as a string when there is no args I believe.



Cheers,

J

2016-10-22 13:58 GMT+01:00 Bruno-Pierre Jobin :

Don't you have to pass dh_pycode.fileconverter as a string?

nuke.menu("Nodes").addCommand("User/FiletypeConverter",  
'dh_pycode.fileconverter', '‘)


--
Bruno-Pierre Jobin

On Oct 22, 2016, at 7:08 AM, Daniel Hartlehnert   
wrote:


nuke.menu("Nodes").addCommand("User/FiletypeConverter",  
dh_pycode.fileconverter, '‘)

___
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users


___
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users






--
Using Opera's mail client: http://www.opera.com/mail/___
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Re: [Nuke-users] Importing functions for menu.py

2016-10-22 Thread Daniel Hartlehnert
Ok, just as i sent the follow-up question, your answer comes in, spooky :O

> Am 22.10.2016 um 15:27 schrieb Justin GD :
> 
> You need to put it as a string when you have arguments in the function; So it 
> doesn't execute when Nuke starts, but only when the user click on the menu.
> 
> nuke.menu("Nodes").addCommand("User/FiletypeConverter", 
> 'dh_pycode.fileconverter(my_args)', '‘)
> 
> No need to put it as a string when there is no args I believe.
> 
> Cheers,
> J
> 
> 2016-10-22 13:58 GMT+01:00 Bruno-Pierre Jobin  >:
> Don't you have to pass dh_pycode.fileconverter as a string?
> 
> nuke.menu("Nodes").addCommand("User/FiletypeConverter", 
> 'dh_pycode.fileconverter', '‘)
> 
> --
> Bruno-Pierre Jobin
> 
> > On Oct 22, 2016, at 7:08 AM, Daniel Hartlehnert  > > wrote:
> >
> > nuke.menu("Nodes").addCommand("User/FiletypeConverter", 
> > dh_pycode.fileconverter, '‘)
> ___
> Nuke-users mailing list
> Nuke-users@support.thefoundry.co.uk 
> , http://forums.thefoundry.co.uk/ 
> 
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users 
> 
> 
> ___
> Nuke-users mailing list
> Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

___
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Re: [Nuke-users] Importing functions for menu.py

2016-10-22 Thread Daniel Hartlehnert

I already tried to start Nuke from the terminal mode but didn’t know how to 
make it work. Thanks for the link!
Seeing the detailed error message now, it turns out it was some indentation 
error in dh_pycode.py

There is one follow-up thing i am wondering about though:
When calling the function inside the .py file, there are no empty brackets 
behind it.
>> nuke.menu("Nodes").addCommand("User/FiletypeConverter", 
>> dh_pycode.fileconverter, ‚‘)
i would have expected dh_pycode.fileconverter() instead.
What i if i want to pass arguments to the function?



> Am 22.10.2016 um 14:36 schrieb Justin GD :
> 
> You need to launch Nuke in terminal mode so we can see exactly the error. 
> 
> You can follow the doc for that :
> http://help.thefoundry.co.uk/nuke/content/getting_started/installation/launching_nuke_mac.html
>  
> 
> 
> Alternatively, you might be able to see it when you click "show more", in the 
> pop up error window. 
> 
> Also, make sure your dh_pycode.py is added to the nuke path, in your init.py 
> if it's in a sub folder.
> 
> Cheers,
> J
> 
> 2016-10-22 13:12 GMT+01:00 Daniel Hartlehnert  >:
> Hi Justin,
> 
> i am on OS X, i don’t see any terminal when starting Nuke.
> I commented out every line in dh_pycode.py, but still i get the same error.
> 
> 
>> Am 22.10.2016 um 13:28 schrieb Justin GD > >:
>> 
>> Hi Daniel,
>> 
>> Can you send the full error message ? In your terminal, you should have the 
>> error line / file indicated.
>> This is most likely an error in your dh_pycode file.
>> 
>> Cheers,
>> Justin
>> 
>> 2016-10-22 12:08 GMT+01:00 Daniel Hartlehnert > >:
>> Hi,
>> 
>> in my .nuke folder i have a text file called dh_pycode.py
>> It contains several functions i want to call in my menu.py like this:
>> 
>> import sys
>> import nuke
>> import dh_pycode
>> 
>> nuke.menu("Nodes").addCommand("User/FiletypeConverter", 
>> dh_pycode.fileconverter, '‘)
>> 
>> i always get the message „error interpreting this plug-in“ when starting 
>> nuke.
>> There are other menu entries added in the menu.py which are not calling 
>> functions from  the dh_pycode.py. When i comment out „import dh_pycode“ and 
>> its corresponding menu entry, everything works.
>> How do you call external python code in menu.py?
>> 
>> Daniel
>> 
>> 
>> 
>> ___
>> Nuke-users mailing list
>> Nuke-users@support.thefoundry.co.uk 
>> , 
>> http://forums.thefoundry.co.uk/ 
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users 
>> 
>> 
>> ___
>> Nuke-users mailing list
>> Nuke-users@support.thefoundry.co.uk 
>> , 
>> http://forums.thefoundry.co.uk/ 
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users 
>> 
> 
> ___
> Nuke-users mailing list
> Nuke-users@support.thefoundry.co.uk 
> , http://forums.thefoundry.co.uk/ 
> 
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users 
> 
> 
> ___
> Nuke-users mailing list
> Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

___
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Re: [Nuke-users] Importing functions for menu.py

2016-10-22 Thread Justin GD
You need to put it as a string when you have arguments in the function; So
it doesn't execute when Nuke starts, but only when the user click on the
menu.

nuke.menu("Nodes").addCommand("User/FiletypeConverter",
'dh_pycode.fileconverter(my_args)', '‘)

No need to put it as a string when there is no args I believe.

Cheers,
J

2016-10-22 13:58 GMT+01:00 Bruno-Pierre Jobin :

> Don't you have to pass dh_pycode.fileconverter as a string?
>
> nuke.menu("Nodes").addCommand("User/FiletypeConverter",
> 'dh_pycode.fileconverter', '‘)
>
> --
> Bruno-Pierre Jobin
>
> > On Oct 22, 2016, at 7:08 AM, Daniel Hartlehnert  wrote:
> >
> > nuke.menu("Nodes").addCommand("User/FiletypeConverter",
> dh_pycode.fileconverter, '‘)
> ___
> Nuke-users mailing list
> Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>
___
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Re: [Nuke-users] Importing functions for menu.py

2016-10-22 Thread Bruno-Pierre Jobin
Don't you have to pass dh_pycode.fileconverter as a string?

nuke.menu("Nodes").addCommand("User/FiletypeConverter", 
'dh_pycode.fileconverter', '‘)

--
Bruno-Pierre Jobin

> On Oct 22, 2016, at 7:08 AM, Daniel Hartlehnert  wrote:
> 
> nuke.menu("Nodes").addCommand("User/FiletypeConverter", 
> dh_pycode.fileconverter, '‘)
___
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users


Re: [Nuke-users] Importing functions for menu.py

2016-10-22 Thread Justin GD
You need to launch Nuke in terminal mode so we can see exactly the error.

You can follow the doc for that :
http://help.thefoundry.co.uk/nuke/content/getting_started/installation/launching_nuke_mac.html

Alternatively, you might be able to see it when you click "show more", in
the pop up error window.

Also, make sure your dh_pycode.py is added to the nuke path, in your
init.py if it's in a sub folder.

Cheers,
J

2016-10-22 13:12 GMT+01:00 Daniel Hartlehnert :

> Hi Justin,
>
> i am on OS X, i don’t see any terminal when starting Nuke.
> I commented out every line in dh_pycode.py, but still i get the same error.
>
>
> Am 22.10.2016 um 13:28 schrieb Justin GD :
>
> Hi Daniel,
>
> Can you send the full error message ? In your terminal, you should have
> the error line / file indicated.
> This is most likely an error in your dh_pycode file.
>
> Cheers,
> Justin
>
> 2016-10-22 12:08 GMT+01:00 Daniel Hartlehnert :
>
>> Hi,
>>
>> in my .nuke folder i have a text file called dh_pycode.py
>> It contains several functions i want to call in my menu.py like this:
>>
>> import sys
>> import nuke
>> import dh_pycode
>>
>> nuke.menu("Nodes").addCommand("User/FiletypeConverter",
>> dh_pycode.fileconverter, '‘)
>>
>> i always get the message „error interpreting this plug-in“ when starting
>> nuke.
>> There are other menu entries added in the menu.py which are not calling
>> functions from  the dh_pycode.py. When i comment out „import dh_pycode“ and
>> its corresponding menu entry, everything works.
>> How do you call external python code in menu.py?
>>
>> Daniel
>>
>>
>>
>> ___
>> Nuke-users mailing list
>> Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>>
>
> ___
> Nuke-users mailing list
> Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>
>
>
> ___
> Nuke-users mailing list
> Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>
___
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Re: [Nuke-users] Importing functions for menu.py

2016-10-22 Thread Daniel Hartlehnert
Hi Justin,

i am on OS X, i don’t see any terminal when starting Nuke.
I commented out every line in dh_pycode.py, but still i get the same error.


> Am 22.10.2016 um 13:28 schrieb Justin GD :
> 
> Hi Daniel,
> 
> Can you send the full error message ? In your terminal, you should have the 
> error line / file indicated.
> This is most likely an error in your dh_pycode file.
> 
> Cheers,
> Justin
> 
> 2016-10-22 12:08 GMT+01:00 Daniel Hartlehnert  >:
> Hi,
> 
> in my .nuke folder i have a text file called dh_pycode.py
> It contains several functions i want to call in my menu.py like this:
> 
> import sys
> import nuke
> import dh_pycode
> 
> nuke.menu("Nodes").addCommand("User/FiletypeConverter", 
> dh_pycode.fileconverter, '‘)
> 
> i always get the message „error interpreting this plug-in“ when starting nuke.
> There are other menu entries added in the menu.py which are not calling 
> functions from  the dh_pycode.py. When i comment out „import dh_pycode“ and 
> its corresponding menu entry, everything works.
> How do you call external python code in menu.py?
> 
> Daniel
> 
> 
> 
> ___
> Nuke-users mailing list
> Nuke-users@support.thefoundry.co.uk 
> , http://forums.thefoundry.co.uk/ 
> 
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users 
> 
> 
> ___
> Nuke-users mailing list
> Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

___
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Re: [Nuke-users] Importing functions for menu.py

2016-10-22 Thread Justin GD
Hi Daniel,

Can you send the full error message ? In your terminal, you should have the
error line / file indicated.
This is most likely an error in your dh_pycode file.

Cheers,
Justin

2016-10-22 12:08 GMT+01:00 Daniel Hartlehnert :

> Hi,
>
> in my .nuke folder i have a text file called dh_pycode.py
> It contains several functions i want to call in my menu.py like this:
>
> import sys
> import nuke
> import dh_pycode
>
> nuke.menu("Nodes").addCommand("User/FiletypeConverter",
> dh_pycode.fileconverter, '‘)
>
> i always get the message „error interpreting this plug-in“ when starting
> nuke.
> There are other menu entries added in the menu.py which are not calling
> functions from  the dh_pycode.py. When i comment out „import dh_pycode“ and
> its corresponding menu entry, everything works.
> How do you call external python code in menu.py?
>
> Daniel
>
>
>
> ___
> Nuke-users mailing list
> Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>
___
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users