forked from xianfei/SysMocap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbs.js
94 lines (82 loc) · 2.38 KB
/
bs.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/**
* Run SysMocap in B/S Mode
*
* A part of SysMocap, open sourced under Mozilla Public License 2.0
*
* https://github.com/xianfei/SysMocap
*
* xianfei 2022.4
*/
// output art text to console
var figlet = require("figlet");
console.log(
"\x1b[95m%s\x1b[0m",
figlet.textSync("SysMocap", {
horizontalLayout: "full",
})
);
console.log(
"\x1b[95m%s\x1b[0m",
"\n Video-based Motion Capture & Character Animation System"
);
console.log("\x1b[94m%s\x1b[0m", "\t\t\t\t\t\tby xianfei");
const sections = [
{
header: "SysMocap",
content:
"A real-time video-based motion capture system for virtual character animating and rendering. It's a free and open-sourced software.",
},
{
header: "Options",
optionList: [
{
name: "help",
type: Boolean,
description: "Print this usage guide.",
},
{
name: "bsmode",
type: Boolean,
description: "Run SysMocap on B/S mode.",
},
{
name: "port",
typeLabel: "{underline number}",
description: "The HTTP port when running on B/S mode.",
},
{
name: "reset",
type: Boolean,
description: "Reset preferences and run sysmocap",
},
{
name: "disable-acrylic",
type: Boolean,
description: "(Windows Only) disable acrylic effects",
},
],
},
];
const argv = require("simple-argv");
if (argv.help) {
var commandLineUsage = require("command-line-usage");
console.log(commandLineUsage(sections));
process.exit(0);
}
if (argv.bsmode) {
console.log("\nRunning SysMocap on B/S mode.\nBooting Server...");
const express = require("express");
const app = express();
app.use(express.static(__dirname));
var port = argv.port ? argv.port : 8080;
app.listen(port, "0.0.0.0", function () {
console.log(
"\x1b[92m%s%d\x1b[0m",
"\nHTTP server listening on port ",
port
);
});
app.get("/", (req, res) => {
res.redirect("/mainview/framework.html");
});
}