# keyframe_insert from data.layers

actualy I know how to insert the keyframe to custom properties; that was solved in previous post

with the same idea I want to insert the keyframe to object.data.layers

I can access and modify the data layers values:

context = bpy.context
obj= context.active_object
obj.data.layers[0]


I test some ideas in order to insert the keyframe with any result:

obj.data.keyframe_insert(data_path = 'layers[\"1"\]')
obj.data.keyframe_insert(data_path = layers[str(1)]))
obj.data.keyframe_insert(data_path = '"layers[1]"')
obj.data.keyframe_insert(data_path = 'layers[1]')
obj.data.keyframe_insert(data_path = layers[1])


at this point I think in the wrong place

• Yeah sorry about that C.object.data.keyframe_insert('layers', frame=20, index=2) Really the same as key-framing a single location axis. – batFINGER Sep 3 '20 at 16:03