ShadowEditor下载编译方法

2026-05-04 超腾开源 3 次阅读 0 次点赞
ShadowEditor是一款基于Three.js、Go语言和MongoDB的免费开源三维场景编辑器。开发需MongoDB v3.6.8+及Chrome或Firefox浏览器,从源码编译还需安装Golang 1.14.2+、NodeJS 14.1+、gcc 9.3.0+和git。可通过GitHub或Gitee下载源码,编译分为Web版和桌面版,Web版需执行npm命令配置代理、安装依赖并构建,桌面版需先编译Web版并下载MongoDB。支持将编辑器安装为Windows或Ubuntu服务,提供install、start、stop等命令行管理功能,默认访问地址为http://localhost:2020。

ShadowEditor是基于Three.js、Go语言和MongoDB的免费开源的三维场景编辑器,本文将介绍该项目的开发部署需求、编译方法及命令行使用。

开发需求

1、MongoDB v3.6.8+
2、Chrome 81.0+ 或者 ​​Firefox 75.0+

下面的软件仅在从源码编译时才需要。

1、Golang 1.14.2+
2、NodeJS 14.1+
3、gcc 9.3.0+ (Windows上需要安装tdm-gcc、MinGW-w64或MinGW。请保证gcc可以通过命令行访问)
4、git 2.25.1+

注意 版本号仅供参考。

源码下载

你可以使用git下载源码。

git clone https://github.com/tengge1/ShadowEditor.git

在国内,由于github比较慢,可以使用gitee。

git clone https://gitee.com/tengge1/ShadowEditor.git

源码编译

Web版编译

1、如果你在国内, 执行npm run set-proxy设置go语言和nodejs代理。
2、执行npm install安装nodejs依赖。
3、执行npm run build构建服务端和Web端。
4、编辑build/config.toml,修改MongoDB的host和port设置。
5、执行npm run start启动服务端。现在你可以访问:http://localhost:2020

桌面版编译

1、请先编译Web版。
2、下载MongoDB,解压到utils/mongodb文件夹中。
3、构建Web版。
4、执行npm run build-desktop可以在文件夹build/desktop中创建一个桌面版应用。

安装服务

安装为Windows服务

1、以管理员身份在build文件夹中打开PowerShell或cmd。
2、运行.\ShadowEditor install,将ShadowEditor安装为服务。
3、运行.\ShadowEditor start,启动ShadowEditor服务。
4、现在你可以访问:http:~/~/localhost:2020。
5、你也可以在Windows服务管理器中管理这个服务。

安装为Ubuntu服务

1、编辑./scripts/service_linux/shadoweditor.service,设置正确的路径。
2、执行sudo cp ./scripts/service_linux/shadoweditor.service /etc/systemd/system/。
3、执行sudo systemctl daemon-reload重新加载服务守护程序。
4、执行sudo systemctl start shadoweditor启动服务。
5、执行sudo systemctl enable shadoweditor设置开机自启动。

= 命令行使用 =

PS E:\github\ShadowEditor\build\> .\ShadowEditor
ShadowEditor is a 3D scene editor based on three.js, golang and mongodb.
This application uses mongodb to store data.

Usage:
  ShadowEditor [command]

Available Commands:
  debug       Debug service on Windows  
  help        Help about any command    
  install     Install service on Windows
  serve       Start server
  start       Start service on Windows
  stop        Stop service on Windows
  version     Print the version number

Flags:
      --config string   config file (default "./config.toml")
  -h, --help            help for ShadowEditor

Use "ShadowEditor [command] --help" for more information about a command.
本文由人工编写,AI优化,转载请注明原文地址: ShadowEditor下载编译方法

评论 (0)

登录 后发表评论

暂无评论,快来发表第一条评论吧!