I am still learning python, so bear with me. I get the last keyframe of an animation between keyframe 1000 and 2000.
shotLength = cmds.keyframe(time=(1000,2000) ,query=True)
del shotLength[:-1]
print shotLength
Result:
[1090.0]
At this point only the desired keyframe remains in the list as a value. I convert this value to an integer like so:
shotLengthInt = list(map(int, shotLength))
print shotLengthInt
Result:
[1090]
Now i want to add +1 to this value so it would look like this:
[1091]
I just cant figure out how.
You can edit the following:
shotLengthInt = list(map(int, shotLength))
print shotLengthInt
We can pass a lambda function to map, to achieve it:
shotLengthInt = map(lambda x: int(x) + 1, shotLength)
print shotLengthInt