Changing Existing Node Parameters, using Python in Nuke

Home Page forums fx Art and Technique Expressions for VFX Changing Existing Node Parameters, using Python in Nuke

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #203487
    Anonymous
    Guest

    Hello there,

    I’m attempting to streamline my work flow in nuke by using Python to change existing node parameters globally. In this case I have laid out various “Card3d” nodes and I want to change all the motion blur parameters in one fall swoop.

    So here is what I’m inputting in the script editor:

    c = nuke.allNodes( ‘Card3D’ )
    c[“motionblur”].setValue (2)
    c[“shutteroffset”].setValue (0)

    this is what the script editor outputs:

    c = nuke.allNodes( ‘Card3D’ )
    c[“motionblur”].setValue (2)
    c[“shutteroffset”].setValue (0)
    # Result: Traceback (most recent call last):
    File ““, line 2, in
    TypeError: list indices must be integers

    I’m a noob when it comes to python so I’m in a bit over my head. What I gather from this is that my syntax is wrong and I can’t give allNodes a variable… atleast not the way I’ve written it. Any thoughts or suggestions would be greatly appreciated!

    #218935
    christopher Fuston
    Participant

    try this out in the script editor, it will grab all Card 3D node and change the settings for them all.

    Hope it helps.

    for l in nuke.allNodes(“Card3D”):
    l [“motionblur”].setValue(2)
    l [“shutteroffset”].setValue(0)

    make sure the lines below the first are indented

    russ

    #218936
    Anonymous
    Inactive

    if you set the name as “c” you would use this command. just add other knobs in the same format to apply more changes at once. there needs to be a tab space before everything included after the colon (the forum post gets reformatted and takes it away)

    for c in nuke.allNodes(“Card3D”):
    c.knob(“motionblur”).setValue(2)
    c.knob(“shuttercustomoffset”).setValue(0)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Copy link
Powered by Social Snap