Thanks Ean!

That works, once. The problem being that after 'my_light_node' has been renamed, the toNode('my_light_node') is no longer valid, and fails if you try to rename the node a second time.

Mark



Ean Carr wrote:
...or even better, use the setName method which I believe helps you avoid naming conflicts:

nuke.toNode('my_light_node').setName(new)

Hope all's well with you, btw!

Ean

On Sat, Aug 11, 2012 at 8:16 AM, Ean Carr <[email protected] <mailto:[email protected]>> wrote:

    Hey Mark,

    If the light node's named 'my_light_node', you would do something
    like:

    nuke.toNode('my_light_node')['name'].setValue(new)

    Not in front of Nuke at the moment, but that should work (once you
    change focus away from the lightName knob, probably).

    Cheers,
    Ean


    On Sat, Aug 11, 2012 at 7:25 AM, Mark Nettleton
    <[email protected] <mailto:[email protected]>> wrote:

        Hi,

        I have a Group which contains some Light nodes. The Group has
        a text entry knob.
        When the user enters text into that knob, I want the Light
        node inside the group to be renamed using the entered text.

        How do I do that?

        Thanks!


        set cut_paste_input [stack 0]
        version 6.3 v8
        push $cut_paste_input
        Group {
        name Group
        knobChanged "
        n = nuke.thisNode()
        k = nuke.thisKnob()
        if k.name <http://k.name>() == \"lightName\":
           if n\['lightName'].value() != \"\":
               new = (n\['lightName'].getValue())
               #insert clever bit of code here to change name of Light
        node inside Group.
               n.setName(\"Group_Updated\")
        "
        selected true
        xpos 191
        ypos 76
        addUserKnob {20 User}
        addUserKnob {1 lightName l "Light name"}
        lightName "New light name"
        }
        Input {
         inputs 0
         name Input1
         xpos 210
         ypos 17
        }
        Light2 {
         name Light1
         xpos 220
         ypos 66
        }
        Output {
         name Output1
         xpos 210
         ypos 158
        }
        end_group

        _______________________________________________
        Nuke-users mailing list
        [email protected]
        <mailto:[email protected]>,
        http://forums.thefoundry.co.uk/
        http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users



------------------------------------------------------------------------

_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to