-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhead.js
47 lines (37 loc) · 1.15 KB
/
head.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const watch = require("watchjs").watch;
const project_ext = "vproj";
function CallFunctionFromModules(fun, c){
for (let i = 0; i < editor.modulesUsage.length; i++) {
if(c == editor.modulesUsage[i]){
continue;
}
if(editor.modulesUsage[i][fun] !== null && editor.modulesUsage[i][fun] !== undefined){
editor.modulesUsage[i][fun](editor);
}
}
}
watch(editor, "selected", function(){
CallFunctionFromModules("selectCallback");
});
function findFileType(ext){
let e = String(ext).toLocaleLowerCase();
if(e == ".jpg" || e == ".tiff" || e == ".gif" || e == ".bmp" || e == ".png" || e == ".webp"){
return "image";
}
if(e == ".bvh" || e == ".blend" || e == ".dae" || e == ".fbx" || e == ".gltf" || e == ".obj" || e == ".ply" || e == ".stl"){
return "model";
}
if(e == ".vscene"){
return "scene";
}
if(e == ".vshader" || e == ".shader" || e == ".glsl" || e == ".hlsl"){
return "shader";
}
if(e == ".vmat" || e == ".mat"){
return "material";
}
if(e == ".vmesh"){
return "mesh";
}
return "undefined";
}