Thanks Ben

Exactly what was needed.


 
Cheers
Howard


________________________________
 From: Ben Dickson <ben.dick...@rsp.com.au>
To: Nuke Python discussion <nuke-python@support.thefoundry.co.uk> 
Sent: Wednesday, 8 May 2013, 9:08
Subject: Re: [Nuke-python] Import nuke scripts
 

The nukescript module is a bit of a mess, if you look at 
nuke_dir/plugins/nukescripts/__init__.py, it contains

if nuke.GUI:
   from panels import *

..meaning the shortcut of nukescripts.PythonPanel doesn't exist in CLI mode.

The PythonPanel code actually lives in nukescripts.panels, so just 
import that directly, e.g:

import nukescripts.panels
class Thing(nukescripts.panels.PythonPanel): pass

On 08/05/13 17:31, Howard Jones wrote:
> Hi
>
> How do you import nukescripts into a module?
>
> I'm using
> import nukescripts
> Which is fine in the GUI. But I get a nukescripts.PythonPanel error when i 
> run nuke in the bg. (Excuse any typos there - it is correct in the python)
>
> It's occurred to me that I may have imported it incorrectly but in the GUI 
> it's already loaded so masking the error. If I am doing it right then there's 
> a bug somewhere.
>
> Thanks.
>
> Howard_______________________________________________
> 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

-- 
ben dickson
2D TD | ben.dick...@rsp.com.au
rising sun pictures | www.rsp.com.au
_______________________________________________
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
_______________________________________________
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