Theoretically you can just do this:

_>>> import sys;
sys.path.append("/path/to/nuke8.0v1/lib/python2.7/site-packages/")
_>>> import nuke


..but there are plenty of situations where the "import nuke" thing will
not work, mainly if the parent process (e.g Maya) is built with
different compiler version, different Python version/UCS version, or
uses similar but conflicting libraries (like, different version of Qt or
whatever)

These problems will likely result in undefined-symbol errors, crashes or
bizarre bugs

Nuke and Maya are both large/complicated/potentially-messy lumps of
code, and so the two are unlikely to live nicely in the same process
without "problems".. Whereas in a simple, relatively small application
like Python, it's far more likely to work

..thus the release notes say "The Foundry cannot provide customer
support for third-party Python interpreters"


The NukeExternalControl project is probably a better bet - the "Command
Manager Interface" is basically the same as 'import nuke', but runs Nuke
as a separate process (skipping all the messy C symbol problems),

https://github.com/Nvizible/NukeExternalControl

On 12/12/13 22:28, Fredrik Averpil wrote:
> I just tried this really quickly from within Maya, by first appending
> Nuke's site-packages to to sys.path followed by an "import nuke" ...but
> that crashed Maya. So I'm also interested in doing this.
> 
> Regards,
> Fredrik
> 
> 
> 
> On Thu, Dec 12, 2013 at 11:28 AM, Kasper Oerlemans | Filmmore
> <kas...@filmmore.nl <mailto:kas...@filmmore.nl>> wrote:
> 
>     Hi guys,
> 
>     maybe a bit of a noob question, but now with nuke8 we should be able
>     to import the nuke module outside of nuke right? So my guess is that
>     easiest way to check if this works is by goigt to your
>     nuk_install_folder/plugins in the terminal and start python and try
>     "import nuke". Or is this the wrong way?
> 
>     Anyway this doesn't work for me, I get "ImportError: No module named
>     _nuke", Am I overlooking something?
> 
>     thanx!! 
> 
> 
>     Groetjes!
>     --------- 
>     *Kasper Oerlemans*
>     VFX Supervisor
>     Entrepotdok 66
>     1018 AD Amsterdam
>     T: +31 20 530 9696 <tel:%2B31%2020%20530%209696>
>     M: +31 61 805 3019 <tel:%2B31%2061%20805%203019>
>     www.filmmore.eu <http://www.filmmore.eu/>
>     filmmore <http://www.filmmore.eu/>
>     imdb <http://www.imdb.com/company/co0190130/>twitter
>     <http://twitter.com/filmmore>facebook
>     <http://www.facebook.com/FilmmoreINT/>linkedin
>     <http://www.linkedin.com/company/filmmore-amsterdam/>
>     *Unavailable on Thursdays*
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>     _______________________________________________
>     Nuke-python mailing list
>     Nuke-python@support.thefoundry.co.uk
>     <mailto: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
> 

-- 
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

Reply via email to