Skip to content

Instantly share code, notes, and snippets.

@wrr wrr/body-end.html
Created Jun 7, 2019

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 setMaterialForNodeOriginal = viewer.setMaterialForNode;
viewer.setMaterialForNode = function(material, node) {
console.log('Material selected ' + material.name);
setMaterialForNodeOriginal.apply(this, [material, node]);
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.