Home Page › forums › fx Art and Technique › Expressions for VFX › Changing Existing Node Parameters, using Python in Nuke
- This topic has 2 replies, 3 voices, and was last updated 10 years, 6 months ago by Anonymous.
-
AuthorPosts
-
April 15, 2010 at 8:28 am #203487AnonymousGuest
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 integersI’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!
April 15, 2010 at 9:15 pm #218935christopher FustonParticipanttry 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
April 16, 2010 at 12:38 am #218936AnonymousInactiveif 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) -
AuthorPosts
- You must be logged in to reply to this topic.
