Get keyframe from animation


Above is an animation curve, how can I get the keyframe value from BJS? The following code will print all keys but not the key frame.

const POIs = scene.getNodeByName("POIs")
  // var cameraPOIs = POIs.getChildren()[0]
  let POIsAnimation = POIs.animations[0];
  var POIsKeyList = POIsAnimation.getKeys();
  console.log(POIsKeyList[5])

  for (let i=0;i<POIsKeyList.length;i++){
    console.log(POIsKeyList[i])
  }

getKeys will return a list of IAnimationKey items, which is this interface -

What information do you need that is not there?

2 Likes

In c4d, In the beginning, I create ten keys and values;
In c4d, Using animation curve tool to make it easing function;
In BJS, there are 100+ key-value pairs as It calculates all key-value after adopting easing function;

In the sandbox, I can see the initial key-value is marked at the black point; is it possible to get the black point value;

The points will recalculate only unders specific circumstances. If you run an animation it will not increase the number of keys:

PGDemo | Babylon.js Playground (babylonjs.com)

Are they exported like that? or are you loading low number of keys and babylon re-calculates it? Can you show a playground hwere that happens

2 Likes

I believe the issue is coming from c4d exporter. It will export all keys after the easing function as there is no easing function concept in c4d.

Thank you so much for supporting me.

1 Like