yes I have to do it with python because I want to render scenes from a lots of different camera positions and each camera position needs a specific camera shift value, depending on the position. You don’t want to do this each time by hand.
But there should be a way to animate properties like the lens or the shifts using python, or not?
Yes, unfortunately I have to do it in python, because I want to render scenes from a lot of different camera positions and each camera position must have a different camera shift value depending on the cam position.
You can insert keyframes dir;ectly from a referenced object.
>>> cam = C.scene.camera.data
>>> cam
bpy.data.cameras['Camera']
>>>
>>> cam.keyframe_insert(
keyframe_insert(data_path, index=-1, frame=bpy.context.scene.frame_current, group="")
.. method:: keyframe_insert(data_path, index=-1, frame=bpy.context.scene.frame_current, group="")
Insert a keyframe on the property given, adding fcurves and animation data when necessary.
:arg data_path: path to the property to key, analogous to the fcurve's data path.
:type data_path: string
:arg index: array index of the property to key. Defaults to -1 which will key all indices or a single channel if the property is not an array.
:type index: int
:arg frame: The frame on which the keyframe is inserted, defaulting to the current frame.
:type frame: float
:arg group: The name of the group the F-Curve should be added to if it doesn't exist yet.
:type group: str
:return: Success of keyframe insertion.
:rtype: boolean
>>> cam.keyframe_insert('shift_x')
True
>>>
import bpy
context = bpy.context
scene = context.scene
camobj = scene.objects.get("Camera")
frame = 29
if camobj is not None and camobj.type == 'CAMERA':
cam = camobj.data
cam.keyframe_insert("shift_x", frame=frame)
Can anyone help with a VSE 2.60 python keyframe insert when I am using both crop and an image composite shift?
Using the GUI I have no problem inserting the keyframes to animate to make the image move but the normally helpful “info” window shows me nothing as I add the keyframes using the GUI. The following python code, without a keyframe insert, works perfectly, shifting the image vertically (with obj.transform.offset_y=300) just as I want:
obj=seq[‘test.png’]
obj.select=True
obj.use_crop=True
obj.crop.max_x=100 # arbitrary example crop
obj.use_translation=True
obj.transform.offset_y=300 # this vertical shift of the image works finr
However, when I add the following python keyframe insert I get
TypeError: bpy_struct.keyframe_insert() property “transform.offset_y” not found
“obj.id_data.keyframe_insert(data_path=”%s.transform.offset_y" % obj.path_from_id(),frame=frameCurrent)" works perfectly!!!
Would appreciate knowing where you got this “%s.transform.offset_y” construct (perhaps a link to the blender doc)? It has a very “c/c++/gcc” like construct look but googling I saw nothing like this.
Also, how do I monetarily recognise you - have you perhaps a donate button somewhere / payPal?