Hello everybody,
I have followed this example by @lexxik to use theatre.js in playcanvas. ( [PlayCanvas 3D HTML5 Game Engine](https://lexxik example: theatrejs + pc) )
I understand the logic to animate one object but now I would like to programmatically add any entity which has a particular tag to theatrejs studio so I can animate them easily.
for example let’s say I have 4 different models (box/cube) and I give them the tag “anim”
// I get all my 'tagged objects'
const entities =this.app.root.findByTag("anim");
// [...] I skip the basic theatrejs stuff [...] //
// I create a "sheet" containing each objects and theirs props with this function
function addObjtoSheet(obj){
const getPropVec3 = (precision) => {
return {
x: t.number(0, { nudgeMultiplier: precision }),
y: t.number(0, { nudgeMultiplier: precision }),
z: t.number(0, { nudgeMultiplier: precision }),
};
};
return sheet.object(
obj.name,
{
position: getPropVec3(0.01),
rotation: getPropVec3(0.01),
scale: getPropVec3(0.01),
visible: true
}
);
var objects=[];
for (var i=0; i<entities.length;i++){
objects.push(addObjtoSheet(objets[i]));
}
// their I (should) have my "theatre js sheet" with all my objects
console.log(objects)
}
But then I don’t know how to animate them and assign each object in the sheet to a “reel” entity in my scene ? If someone knows how I would love some help. Thanks