Very basic python help needed

hey there

i’m really beginner at python and need some help for a project.

I have a timer chop and a switch top with two movie files in it. I want the switch index to switch from 0 - 1 when the timer ends [the 0 movie is locked to timeline and the project has default set at 0]

on the python editor under the onDone i’ve written

def onDone(timerOp, segment, interrupt):

	op('switch1').par.index[1]

	return

Its giving me a subscript error and I suspect its due to the way im calling the index. any help is really appreciated, thank you so much!

.par.index returns a Parameter Object. You can read about what you can do with a Par-Object here:

In your case, you want to set the value of the parameter. This is done by assigning a value to the val member like this:

op("switch1").par.index.val = 1
1 Like

youre amazing!! I appreciate the help. and thanks for listing the wiki also