I’m experienced in Python, but not as it applies to Blender.
Basically I’m just looking for a quick example of how to create keyframes via script. For example, take the default scene, with the default cube. I would like to write a script that sticks a single keyframe on the timeline that makes that cube twice as tall, at frame number 125.
Also, can the same thing be accomplished by specifying an elapsed seconds value rather than a frame number value?
For doing it with elapsed seconds, I dont know how to grab the framerate, but you can do get(curtime) and get(curframe) to calculate it. From there you can easily work out when the frame for any time should lie.
I get the concept, but it’s choking on my syntax:
sx.addBezier( (200,3),(199,3),(201,3) )
gets me:
[IpoCurve “SizeX”]
Traceback (most recent call last):
File “Text”, line 16, in ?
TypeError: expected tuple argument
Adding more parentheses alowed it to run but with bizarre results
sx.addBezier( ((200,3),(199,3),(201,3)) )
Sorry, you lost me. addBezier was exactly the function I already gave in my example, and google gives me no hits on either of the two functions you mention.
Sorry, you lost me. addBezier was exactly the function I already gave in my example, and google gives me no hits on either of the two functions you mention.[/quote]
addBezier((x,y))
or addBezier((x,y),(x1,y2),(x3,y3),…(xn,yn))
addBezier only adds the coordinates of the bezier point not the handles.
Found the problem. I was adding the points correctly but not doing a Recalc(). Without the Recalc, the tangent handles were really bonkers. With Recalc, they look fine.