-
Notifications
You must be signed in to change notification settings - Fork 1
/
wireframe_full.js
31 lines (28 loc) · 931 Bytes
/
wireframe_full.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
javascript:
if (typeof material_storage === 'undefined') {
var material_storage = {};
};
if (!('type' in material_storage) || material_storage['type'] == 'WIREFRAME_FULL') {
material_storage['type'] = 'WIREFRAME_FULL';
AFRAME.scenes[0].object3D.traverse(o => {
if (o.isMesh) {
if (!(o.uuid in material_storage)) {
material_storage[o.uuid] = {
'map': o.material.map,
'wireframe': o.material.wireframe,
'transparent': o.material.transparent,
};
}
}
});
AFRAME.scenes[0].object3D.traverse(o => {
if (o.isMesh) {
if (o.uuid in material_storage) {
o.material.map = null;
o.material.wireframe = true;
o.material.transparent = false;
o.material.needsUpdate = true;
}
}
});
}