Skip to content

Instantly share code, notes, and snippets.

@wrr

wrr/body-end.html

Last active Oct 10, 2020
Embed
What would you like to do?
Detect which material was selected by the material picker
<script>
var viewer = WALK.getViewer();
viewer.onSceneReadyToDisplay(function() {
var setMaterialForMeshOriginal = viewer.setMaterialForMesh;
viewer.setMaterialForMesh = function(material, mesh) {
console.log('Material selected ' + material.name);
setMaterialForMeshOriginal.apply(this, [material, mesh]);
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment