If statement executes when it's false
<p>I am getting "Knob already attached to a node" when i try to add a knob</p>

<p>i get this when i try to run my code from menu.py button.. if i run the script from the script editor i don't get the error.. why is that?</p>

<pre><code>for i in nuke.allNodes():
    if not i.knob("tempMb"):
        if sum0 == 0:
            nuke.message("first tmp knob created")
            i.addKnob(t)
        elif sum0 != 0:
            nuke.message("second tmp knob created")
    else: 
        nuke.message("no nob created")     
</code></pre>

<p>Even though <strong>i check if there is a knob named tempMb</strong> .. it still executes it as if there was not, when there is..
edit: "t" is earlier defined as Int_Knob...</p>

<p>Thanks!</p>