Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

【严重】重载任意骨骼时失败 #6

Closed
Aloento opened this issue Jan 12, 2021 · 4 comments
Closed

【严重】重载任意骨骼时失败 #6

Aloento opened this issue Jan 12, 2021 · 4 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Aloento
Copy link
Owner

Aloento commented Jan 12, 2021

重载骨骼失败,可能的错误为 (旧版本时)

Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: Region not found in atlas: cloak_back1 (weighted mesh attachment: cloak_back1)
at com.esotericsoftware.spine32.attachments.AtlasAttachmentLoader.newWeightedMeshAttachment(AtlasAttachmentLoader.java:36)
at com.esotericsoftware.spine32.SkeletonBinary.readAttachment(SkeletonBinary.java:368)
at com.esotericsoftware.spine32.SkeletonBinary.readSkin(SkeletonBinary.java:233)
at com.esotericsoftware.spine32.SkeletonBinary.readSkeletonData(SkeletonBinary.java:167)
at com.QYun.Spine.Spine32.loadSkel(Spine32.java:38)
at com.QYun.Spine.Spine32.lambda$listeners$8(Spine32.java:150)
at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:181)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
at javafx.beans.property.BooleanPropertyBase.fireValueChangedEvent(BooleanPropertyBase.java:104)
at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:111)
at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
at com.QYun.Spine.SuperSpine.setIsReload(SuperSpine.java:36)
at com.QYun.SuperSpineViewer.RuntimesLoader.init(RuntimesLoader.java:169)
at com.QYun.SuperSpineViewer.GUI.ExporterController.B_Open(ExporterController.java:77)
......

可能的报错(新版本),主要问题

Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: No OpenGL context found in the current thread.
at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124)
at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1403)
at com.badlogic.gdx.backends.lwjgl.LwjglGL20.glGenTexture(LwjglGL20.java:348)
at com.badlogic.gdx.graphics.Texture.(Texture.java:142)
at com.badlogic.gdx.graphics.Texture.(Texture.java:122)
at com.badlogic.gdx.graphics.g2d.TextureAtlas.load(TextureAtlas.java:253)
at com.badlogic.gdx.graphics.g2d.TextureAtlas.(TextureAtlas.java:245)
at com.QYun.Spine.Standard$1.(Standard.java:42)
at com.QYun.Spine.Standard.loadSkel(Standard.java:42)
at com.QYun.Spine.Standard.lambda$listeners$8(Standard.java:181)
at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:181)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
at javafx.beans.property.BooleanPropertyBase.fireValueChangedEvent(BooleanPropertyBase.java:104)
at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:111)
at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
at com.QYun.Spine.SuperSpine.setIsReload(SuperSpine.java:36)
at com.QYun.SuperSpineViewer.RuntimesLoader.init(RuntimesLoader.java:147)
at com.QYun.SuperSpineViewer.GUI.ExporterController.B_Open(ExporterController.java:77)
......

@Aloento Aloento added the bug Something isn't working label Jan 12, 2021
@Aloento Aloento assigned Aloento and HarryG55 and unassigned Aloento Jan 12, 2021
@Aloento Aloento added the help wanted Extra attention is needed label Jan 12, 2021
@Aloento Aloento self-assigned this Jan 18, 2021
@Aloento
Copy link
Owner Author

Aloento commented Jan 18, 2021

当任意函数二次调用new TextureAtlas();时出现

问题由
com.badlogic.gdx.graphics.g2d/TextureAtlas第253行
texture = new Texture(page.textureFile, page.format, page.useMipMaps);
开始产生

接下来到org.lwjgl.opengl/GL11的第1403行
ContextCapabilities caps = GLContext.getCapabilities();

最后到org.lwjgl.opengl/GLContext的第132行
在第二次加载贴图的时候不再满足
recent_cache_entry.owner == Thread.currentThread()
遂返回caps == null
并抛出No OpenGL context found in the current thread.

以上是表面流程

@Aloento Aloento changed the title 3.2同版本重载失败 【严重】重载任意骨骼时失败 Jan 18, 2021
@Aloento Aloento pinned this issue Jan 18, 2021
@Aloento
Copy link
Owner Author

Aloento commented Jan 19, 2021

以下是Debug的详细记录

情况:第一次加载成功
now = Thread[LWJGL Application,5,main]$1@4774
recent = Thread[LWJGL Application,5,main]$1@4774

情况:进行第二次加载
now =Thread[JavaFX Application Thread,5,main]$1@1233
recent = Thread[LWJGL Application,5,main]$1@4774

@Aloento
Copy link
Owner Author

Aloento commented Jan 19, 2021

问题比较明显,调用方法的线程发生了改变
可能的解决的方案是让调用动作由LWJGL或者LibGDX发起

@Aloento Aloento unpinned this issue Jan 19, 2021
@Aloento
Copy link
Owner Author

Aloento commented Jan 19, 2021

问题解决,通过GDX调用即可

@Aloento Aloento closed this as completed Jan 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants