3
$\begingroup$

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?

(The cube with "manual" material is for reference, how I want to set the colors in manual mode) enter image description here

$\endgroup$

2 Answers 2

4
$\begingroup$

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 color (implied 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.

enter image description here

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.

enter image description here

Result :

enter image description here

$\endgroup$
4
  • 1
    $\begingroup$ This answer works perfect! Thanks! $\endgroup$
    – ChrisM
    May 4, 2021 at 11:02
  • $\begingroup$ @ChrisM Glad it helped :) By the way, if say you just want to bake the red channel of the color, instead of -1 beside the field where you type color, you can set it to 0 (1 for green, 2 for blue, and 3 for alpha) cheers $\endgroup$
    – Gorgious
    May 4, 2021 at 11:05
  • $\begingroup$ Good to know, thanks. By the way, if I select the cubes and check material - viewport display, the color is still white for all cubes, in all keyframes, and the small dot also shows it is not keyframed. Same is the case for materials - surface, if I turn off "use nodes", the base color is still white and not keyframed. I can see the dots in the dopesheet, but not in the graph editor. Where/how can I see to color in these displays? $\endgroup$
    – ChrisM
    May 4, 2021 at 11:19
  • $\begingroup$ @ChrisM You'll have to use a different setup for that, the object viewport color and the material viewport color are 2 different properties, they belong respectively to an object and a material. One material can be shared by multiple objects, and one object can have multiple materials. As you noticed, the material viewport color is used for the diffuse color of the default material when use nodes is unchecked $\endgroup$
    – Gorgious
    May 4, 2021 at 11:35
4
$\begingroup$

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".

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks Chris, that works, too. But I do more stuff in animation nodes and avoid to jump between node systems. $\endgroup$
    – ChrisM
    May 4, 2021 at 10:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .