Hello,

from the NDK docs:

void Op::script_unlock( ) [static]

Allow the memory for
script_result()<file:///C:/Program%20Files/Nuke7.0v2/Documentation/NDK/Plugins/classDD_1_1Image_1_1Op.html#df4e21f64f6c0baadf262531f269294f>
to
the most recent
script_command()<file:///C:/Program%20Files/Nuke7.0v2/Documentation/NDK/Plugins/classDD_1_1Image_1_1Op.html#a01955aa08bcdfb41a9721c8cb427f3f>
 or 
script_expand()<file:///C:/Program%20Files/Nuke7.0v2/Documentation/NDK/Plugins/classDD_1_1Image_1_1Op.html#697e2a3194de8f4444d09971db44ed0f>
to
be reused. You *must* call this exactly once for every call to
script_command()<file:///C:/Program%20Files/Nuke7.0v2/Documentation/NDK/Plugins/classDD_1_1Image_1_1Op.html#a01955aa08bcdfb41a9721c8cb427f3f>
 or 
script_expand()<file:///C:/Program%20Files/Nuke7.0v2/Documentation/NDK/Plugins/classDD_1_1Image_1_1Op.html#697e2a3194de8f4444d09971db44ed0f>
!
so you're correct that script_result() will return Viewer1. You just need
to call script_unlock() when you're done with your script_result().

Hope that helps,

Dan.



On Tue, Mar 5, 2013 at 11:33 PM, sh4dow <nuke-dev-re...@thefoundry.co.uk>wrote:

> **
> This piece of code here:
>
> *Code:*
> strPython = "print 'asdf'";
> script_command(strPython.c_str(), true, false);
> //script_unlock();
> cout << "script_result: " << script_result() << endl;
>
>
> Prints "Viewer1" in the console. In Script Editor, "script_command" does
> what it should do.
> Based on the fact that this is my first plugin, I have no idea in what
> cases one is supposed to call "script_unlock()" but it doesn't matter.
> Calling it or not doesn't change anything. Neither does setting the python
> flag to true for "script_result()".
>
> Does anybody have a solution for this? (I hope to be able to avoid adding
> a hidden knob to my plugin and retrieving the result of the python script
> that way...)
>
> _______________________________________________
> Nuke-dev mailing list
> Nuke-dev@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>
>


-- 
Dan Ring, Ph.D.
Research Engineer
The Foundry
6th Floor, The Communications Building,
48 Leicester Square,
London, WC2H 7LT, UK
Tel: +44 (0)20 7968 6828 - Fax: +44 (0)20 7930 8906
Web: www.thefoundry.co.uk
Email: dan.r...@thefoundry.co.uk

The Foundry Visionmongers Ltd.
Registered in England and Wales No: 4642027
_______________________________________________
Nuke-dev mailing list
Nuke-dev@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

Reply via email to