I'm trying to control the text values of a .json file, exported using bodymovin.
At this moment, i succeeded in creating a flat 'template' exported from bodymovin, and changing the values in the bodymovin .json file using the function updateDocumentData.
But the only elements i can change are the elements that are in the main composition of After Effects. Now i would like to try and make a more difficult template where i work with pre-compositions in After Effects. How can i use updateDocumentData (or another function?) to change text values in deeper compositions.
function functionUpdate() {
anim.playSegments([450, 460], true);
const animElement = anim.renderer.elements[1];
console.log(anim.renderer.elements[1])
animElement.updateDocumentData({t: 'Test Text'});
}
const animData = 'js/data_test.json';
const animContainer = document.getElementById('lottie-container');
const anim = lottie.loadAnimation({
container: animContainer, // The dom element that will contain the animation
renderer: 'svg',
loop: false,
autoplay: false,
path: animData // Path to the animation json
});