I tried to go the onCreate() route..
Added the following lines to init.py..
def lf_startup():
newNode = nuke.thisNode()
knob = newNode.knob("inputChange")
knob.setFlag(nuke.KNOB_CHANGED_ALWAYS)
nuke.addOnCreate(lf_startup, nodeClass="MyNode")
But newNode.knob("inputChange") returns NULL.
Isn't there a builtin inputChange knob in python ?
On Wed, Jun 24, 2015 at 10:31 AM, devMannemela <[email protected]> wrote:
> I tried this.. and I didn't work..
>
> if (f.makeKnobs() && knob("inputChange"))
>
> knob("inputChange")->set_flag(DD::Image::Knob::KNOB_CHANGED_ALWAYS);
>
>
>
> thanks
>
> On Tue, Jun 23, 2015 at 11:14 PM, Frank Harrison <[email protected]>
> wrote:
>
>>
>>
>> On Wednesday, June 24, 2015, devMannemela <[email protected]> wrote:
>>
>>> I am trying to do this in C++ (NDK).
>>> Isn't onCreate() python only ?
>>>
>> Yup, but quite a few C++ Nodes use a bit of python, and some setup state
>> on the onChanged callback. Have a look in init.py and/or menu.py
>>
>>
>>> I tried doing something like this in various places (knobs(),
>>> _validate(), _request()..
>>> But doesn't seem to work
>>>
>>> if (knob("inputChange"))
>>>
>>> knob("inputChange")->set_flag(DD::Image::Knob::KNOB_CHANGED_ALWAYS)
>>>
>>
>> I'm not at my machine right now but would doing the following, at the end
>> of your knobs() func not work?
>>
>> if (cb.makeKnobs()) { // or what ever its called
>> // set flag
>> }
>>
>>
>>>
>>> On Mon, Jun 22, 2015 at 4:13 AM, Frank Harrison <[email protected]>
>>> wrote:
>>>
>>>>
>>>> On 20 June 2015 at 01:25, devMannemela <[email protected]> wrote:
>>>>
>>>>> But can this flag be set for "inputChange" knob ?
>>>>> if so, where ?
>>>>
>>>>
>>>> You should always get the changed in python, but you won't in C++
>>>> without the flag.
>>>>
>>>> Once the Node has been created you should be able to get the knob and
>>>> set any arbitrary flag on it. You might *possibly* be able to do this
>>>> in your knobs() function when in knob-creation mode - although it may be
>>>> better to do it in the onCreate callback or some similar place when all
>>>> knobs have been created.
>>>>
>>>> hth
>>>>
>>>> F.
>>>> --
>>>> Frank Harrison
>>>> Senior Nuke Software Engineer
>>>> The Foundry
>>>> Tel: +44 (0)20 7968 6828 - Fax: +44 (0)20 7930 8906
>>>> Web: www.thefoundry.co.uk
>>>> Email: [email protected]
>>>>
>>>> _______________________________________________
>>>> Nuke-dev mailing list
>>>> [email protected], http://forums.thefoundry.co.uk/
>>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>>>>
>>>>
>>>
>>
>> --
>> Frank Harrison
>> Senior Nuke Software Engineer
>> The Foundry
>> Tel: +44 (0)20 7968 6828 - Fax: +44 (0)20 7930 8906
>> Web: www.thefoundry.co.uk
>> Email: [email protected]
>>
>>
>> _______________________________________________
>> Nuke-dev mailing list
>> [email protected], http://forums.thefoundry.co.uk/
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>>
>>
>
_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev