当前位置:网站首页>A wave of operation to solve the error problem of Laya scene editor
A wave of operation to solve the error problem of Laya scene editor
2022-07-28 15:44:00 【I'm not a code God】
After the system is reinstalled , open Laya IDE, When I switch to the scene editor , Popping up error boxes made me suffer .
I scold my mother in my heart again and again Laya Community BBS Post for help , No one answered . What do I do , You can't reinstall the system again , It's not my style , Then we have to bite the bullet to solve this problem .
From the pop-up window, you can roughly see the source code location , Open the source folder and search globally webGL! I found the pop-up window !
In the file LayaAirIDE\resources\app\out\vs\layaEditor\h5\renders\uiviewer\editor.max.js
Of 88880 That's ok
if (!WebGL.enable()){
alert("Laya3D init error,must support webGL!");
return;
}Um. , Because IDE Need to use WebGL function , Open developer tools , Create a canvas, And then call getContext('webgl') return null, It does not support . strange , Why not support it ? So it's good .
after 1 Thinking of heaven , No idea , Search the Internet , Finally found an important clue :
electron webgl initialization failed
So that's it , You can try this operation , The question is where to put this code ? The article does not say . I put the code in a page , Failure , Obviously, this seems to be electron Code for , So I'm based on package.json Entry in js find resources/app/out/main.js, Insert the code
init() {
let idepath = this.path.join(this.app.getPath("appData"), "LayaAirIDE");
this.fs.exists(idepath, function (exists) {
if (!exists) {
require("fs").mkdir(idepath);
}
});
this.app.commandLine.appendSwitch('ignore-gpu-blacklist');
this.app.once("ready", () => {
this.start();
});
this.ipcMain.on("openFile", () => {
console.log("---------------------------- Received a message ")
console.log(process.argv, "-------------------------")
})
}restart Laya, No pop-up , success !
be based on Electron The software developed will have unexpected pitfalls , Also because the software code can be modified to solve ,js It's easy to use !
边栏推荐
- Differences between two ways of QT creating folders
- [delete specified number leetcode]
- Sharing of award-winning activities: you can get up to iphone13 after using WordPress to build your own blog
- Samba Server Setup Guide
- 800V高压系统
- VS使用技巧
- Baidu proposes a dynamic self distillation method to realize dense paragraph retrieval by combining interactive model and double tower model
- Framework定制系列(十)-----SystemUI定制状态栏statusbar和导航栏navigationbar教程
- 取组合数问题
- 20. Channel allocation task implementation
猜你喜欢

程序员的自我修养

How many tips do you know about using mock technology to help improve test efficiency?

Minimum heap improves the efficiency of each sort

Easyexcel complex header export (one to many)

关于Simulink如何生成模型覆盖率报告

Flowable workflow all business concepts

Heap operation

最小堆提升每次排序的效率

一篇文章了解RSocket协议

Rongyun real-time community solution
随机推荐
leetcode-括号有效性问题
Summarize the knowledge points of the ten JVM modules. If you don't believe it, you still don't understand it
字符数组和字符串的区别
How to configure Samba server
如何获取及嵌入Go二进制执行包信息
全国985院校考研信息汇总整理
Monkey stress test
爬虫入门(1)——requests(1)
Canoe tutorial
21. Definition of message processing task
Flutter中是使用RxDart代替Stateful
2、开源GPS项目HD-GR GNSS的自叙
基于RSocket协议实现客户端与服务端通信
Write a standard character device driver with your hands
正则表达式(4)
如何通过adb打开和关闭飞行模式
Try... Except exception handling statement (6)
迟来的2021年终总结
Framework customization series (10) -- systemui customization status bar statusbar and navigation bar tutorial
H265 streaming on OBS