How Forge Viewer sets the transparency of components

How to achieve transparency and translucency of components in

Autodesk Forge Viewer? How to adjust the built opacity?

Dec.15,2021

refer to the following code:

//nodeIdmodel
    var model = ...
    var nodeId = ...

    var fragList = viewer.model.getFragmentList();    

    var fragIds = []

    model.getData().instanceTree.enumNodeFragments(
      nodeId, (fragId) => {
       fragIds.push(fragId)
    });

        fragIds.forEach((fragId) => {
          //
          var material = fragList.getMaterial(fragId);
          
          if(material) {
            //
            material.opacity = 0.5;
            material.transparent = true;
            //
            material.needsUpdate = true
          }
        })
      })
      //viewer
      viewer.impl.invalidate(true, true, true)
    
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e97fb0-47475.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e97fb0-47475.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?