0
$\begingroup$

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

some ideas please

****************************** update 1*********** I have this layers as buttons in a addon UI enter image description here

enter image description here

after insert enter image description here

$\endgroup$
3
  • $\begingroup$ @batFINGER I have this layers as buttons in a addon UI, and I can add that using "i" $\endgroup$
    – yhoyo
    Sep 3 '20 at 15:57
  • 1
    $\begingroup$ Yeah sorry about that C.object.data.keyframe_insert('layers', frame=20, index=2) Really the same as key-framing a single location axis. $\endgroup$
    – batFINGER
    Sep 3 '20 at 16:03
  • $\begingroup$ @batFINGER that is the answer!!! thanks!! $\endgroup$
    – yhoyo
    Sep 3 '20 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.