I am creating colors for objects in animation nodes and want to write these colors to keyframes as base colors. In my example the color of the 3 cubes is created by a random color node in animation nodes. Now I want to bake these colors to frames 1-30. Then stop the animation nodes and manually keyframe colors (R, G, B Diffuse Color in the dope sheet) for the rest of the animation for the same cubes. (or use other animation nodes output) How could I achieve that?
You need to use the Set Keyframes node. Link to the docs.
It is designed to keyframe transforms (Loc, Rot, Scale), but you can keyframe other properties by choosing Custom in the first dropdown.
Click on the + icon to add a new field, and type
object.color, that is to say the object viewport color) because that's the property you want to bake the keyframes to.
Check Enable to, well, enable the node's behavior.
Now if you play the animation, it will bake the keyframes to ALL frames.
How to restrict the baking to a certain frame range :
Add a Time Info node and a Compare boolean node.
Nice name! ;)
To change the colors "without" AN you can adapt your shading nodes like this (see picture).
In the value field enter "#frame" and then you can ask which frame it is with the math node (less than). With the mix node Blender decides which color it will take.
The RGB node can be keyframed as you know with hovering with the mouse over it and press "I".