Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

jme3-plugins fails to load UnicodeTest

未关闭
#2,124 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
java

调研方向

从 GltfLoader.loadFromStream() 开始,然后检查堆栈跟踪位置上的 getBytes()、readData() 和 readBuffer()。在 Windows 上使用 TestGltfLoading 重现 UnicodeTest 失败,并将其与 DesktopAssetManager 加载同一个 .bin 资源的情况进行比较。当 UnicodeTest 的 glTF 及其二进制资源能够在 Windows 上成功加载且路径未损坏时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

defect

I noticed a defect in GltfLoader while developing the MonkeyWrench library.

The test data is UnicodeTest from Khronos's glTF sample models.

The test passed on my desktop computer running Mint Linux.
On my laptop computer running Microsoft Windows 11, it failed with the following diagnostic:

com.jme3.asset.AssetLoadException: An error occurred loading Unicode??Test/glTF/Unicode??Test.gltf

I reproduced this behavior using the TestGltfLoading app with the following modifications:

        assetManager.registerLocator("..\\..\\ext\\glTF-Sample-Models\\2.0", FileLocator.class);
//...
        loadModel("Unicode\u2764\u267bTest/glTF/Unicode\u2764\u267bTest.gltf", new Vector3f(0, 1, 0), 1);

I then added e.printStackTrace(); in GltfLoader.loadFromStream() and got the following stack trace:

Caused by: com.jme3.asset.AssetNotFoundException: Unicode??Test/glTF/Unicode�?�♻Binary.bin
	at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:387)
	at com.jme3.scene.plugins.gltf.GltfLoader.getBytes(GltfLoader.java:607)
	at com.jme3.scene.plugins.gltf.GltfLoader.readData(GltfLoader.java:584)
	at com.jme3.scene.plugins.gltf.GltfLoader.readBuffer(GltfLoader.java:557)
	at com.jme3.scene.plugins.gltf.GltfLoader$VertexBufferPopulator.populate(GltfLoader.java:1341)
	at com.jme3.scene.plugins.gltf.GltfLoader$VertexBufferPopulator.populate(GltfLoader.java:1309)
	at com.jme3.scene.plugins.gltf.GltfLoader.readAccessorData(GltfLoader.java:537)
	at com.jme3.scene.plugins.gltf.GltfLoader.readMeshPrimitives(GltfLoader.java:384)
	at com.jme3.scene.plugins.gltf.GltfLoader.readNode(GltfLoader.java:253)
	at com.jme3.scene.plugins.gltf.GltfLoader.readChild(GltfLoader.java:302)
	at com.jme3.scene.plugins.gltf.GltfLoader.readScenes(GltfLoader.java:219)
	at com.jme3.scene.plugins.gltf.GltfLoader.loadFromStream(GltfLoader.java:155)

The issue isn't intrinsic to jme3-core since MonkeyWrench is able to open the same .bin asset using DesktopAssetManager on Windows 11.

I'm unsure where the root cause lies. Perhaps GltfLoader.getBytes() is decoding a URI that wasn't properly encoded to begin with?

主要语言
Java
星标
4.3k
派生
1.2k
平均合并
4 天 7 小时
30 天内合并 PR
14

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

jMonkeyEngine/jmonkeyengine 的其他 Issue

查看 jMonkeyEngine/jmonkeyengine 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。