How to show or hide PMI data in 'Animation'

I have list of node Ids, if I pass that in an array and apply show hide as we do for component, there is no change in PMIs

I believe you are referring to the Animation example available as part of the quickstart
module.

A couple of comments:

  • Are you able to toggle visibility through a selection of the PMI in the viewer? So instead of passing an array of PMI node ids, if you select via the mouse a single PMI node, does that work?
  • When you are passing an array of node ids to change the visibility, are there any errors in the browser developer console?

async addOpacityAnimation(nodes, startTime, duration, opacity) {

    for (const nodeId of nodes) {
        const channelName = `Opacity-${nodeId}`;
        // if (undefined == this._nodeOpacities[nodeId]) {
        const opacity = await this.viewer.model.getNodesOpacity([nodeId]);
        this._nodeOpacities[nodeId] = (opacity[0] == null) ? 1 : opacity[0]
        // }

        const buffer = new Communicator.Animation.KeyframeBuffer(Communicator.Animation.KeyType.Scalar);
        const sampler = new Communicator.Animation.Sampler(buffer, Communicator.Animation.InterpolationType.Linear);
        const channel = this.animation.createNodeChannel(channelName, nodeId, Communicator.Animation.NodeProperty.Opacity, sampler);

        channel.sampler.buffer.insertScalarKeyframe(startTime, this._nodeOpacities[nodeId]);
        console.log(`Opacity for node ${nodeId} at start time ${startTime}: ${this._nodeOpacities[nodeId]}`);
        channel.sampler.buffer.insertScalarKeyframe(startTime + duration, 0);
        console.log(`Opacity for node ${nodeId} at end time ${startTime + duration}: ${0}`);

        // this._nodeOpacities[nodeId] = opacity;
    }
}

I am using this function code for animating nodes. With this code component nodes are animating but PMI nodes are not. Also It doesn’t show any error.

addOpacityAnimation([12],1,1,1) or addOpacityAnimation([12],1,1,0)