Cross-posting to the Python list, just in case it's more appropriate.

How do you create and initialize a BlinkScript node from Python?

The following function is my work in progress.

def createBlinkScriptNode( blinkScriptPath, inputs ):
    blinkNode = nuke.nodes.BlinkScript()
    blinkNode['kernelSourceFile'].setValue( blinkScriptPath )
    nuke.show(blinkNode)
    blinkNode['clearKernelSource'].execute()
    blinkNode['reloadKernelSourceFile'].execute()

    for i in range(len(inputs)):
        blinkNode.setInput(i, inputs[i])

    return blinkNode

This does the job when working interactively but is problematic when
working in batch. Without the 'nuke.show()' call in the middle of the
function, the subsequent clear kernel and reload kernel calls don't have
any affect when running interactively. That probably has something to do
with why we're seeing problems in batch too.

Without the UI update that you get interactively, the batch version of the
node doesn't know how many inputs it should have or understand what kernel
parameters should be exposed for the given 'kernelSourceFile'.

Thanks again for your help,
HP


On Tue, Apr 22, 2014 at 9:12 AM, Haarm-Pieter Duiker <
l...@duikerresearch.com> wrote:

> Hi,
>
> I'm working with Blink and have a couple of basic questions.
> - What environment variables control the directories searched when you use
> an #include statement?
>  - Is there a way to get more verbose output when a kernel fails to
> compile or run?
> --- Sometimes I get 'Error running kernel' in a red bar over the Nuke
> viewer and that's it.
> --- If there's a syntax error in an included header and the compilation
> fails, you only get the warning that the compilation failed. If the error
> is in the main .blink file being loaded, you get proper information about
> which line has the problem and what mistake you've made.
>
> Is there a secret blink.log file somewhere on disk with lots of verbose
> output from the compiler and runtime?
>
> Thanks in advance for your help. I'm having fun playing with Blink thus
> far.
>  HP
>
_______________________________________________
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