cmd1115

报错信息如下

TypeError: Cannot set properties of null (setting 'renderObject')
AtlasAttachmentLoader.loadSequence
E:/cocos/src/AtlasAttachmentLoader.ts:57
54 | let attachment = new RegionAttachment(name);
55 | if (sequence != null) {
56 | this.loadSequence(name, path, sequence);
> 57 | }
| ^ 58 | else {
59 | let region = this.atlas.findRegion(path);
60 | if (!region)
View compiled
AtlasAttachmentLoader.newRegionAttachment
E:/cocos/src/AtlasAttachmentLoader.ts:65
62 | region.renderObject = region;
63 | attachment.region = region;
64 | }
> 65 | return attachment;
| ^ 66 | }
67 | newMeshAttachment(skin, name, path, sequence) {
68 | let attachment = new MeshAttachment(name);
View compiled
SkeletonBinary.readAttachment
E:/cocos/src/SkeletonBinary.ts:307
304 | box.worldVerticesLength = vertexCount << 1;
305 | box.vertices = vertices.vertices;
306 | box.bones = vertices.bones;
> 307 | if (nonessential)
| ^ 308 | Color.rgba8888ToColor(box.color, color);
309 | return box;
310 | }
View compiled
SkeletonBinary.readSkin
E:/cocos/src/SkeletonBinary.ts:280
277 | let sequence = this.readSequence(input);
278 | if (!path)
279 | path = name;
> 280 | let region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence);
| ^ 281 | if (!region)
282 | return null;
283 | region.path = path;
View compiled
SkeletonBinary.readSkeletonData
E:/cocos/src/SkeletonBinary.ts:204
201 | let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
202 | linkedMesh.mesh.timelineAttahment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh;
203 | linkedMesh.mesh.setParentMesh(parent);
> 204 | if (linkedMesh.mesh.region != null)
| ^ 205 | linkedMesh.mesh.updateRegion();
206 | }
207 | this.linkedMeshes.length = 0;
View compiled
AppSpine.initialize
E:/cocos/ming/src/components/ComboParts/ComboParts.jsx:32
29 | let skeletonBinary = new spine.SkeletonBinary(atlasLoader);
30 | console.log(assetManager.require("long.skel"))
31 | console.log(skeletonBinary.readSkeletonData)
> 32 | this.skeletonData = skeletonBinary.readSkeletonData(assetManager.require("long.skel"));
| ^ 33 | this.skeleton = new spine.Skeleton(this.skeletonData);
34 | let stateData = new spine.AnimationStateData(this.skeletonData);
35 | this.state = new spine.AnimationState(stateData);
View compiled
waitForAssets
E:/cocos/src/SpineCanvas.ts:111
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error. Click the 'X' or hit ESC to dismiss this message.

---

-----
您没有权限查看这个主题的附件。
cmd1115
  • 帖子: 6

Mario

请张贴您的骨架、地图集和 PNG 文件。 看起来 cocos 运行时使用的是spine-ts 4.1 beta 运行时。 您是否从 Spine Editor 4.1-beta 版导出了您的骨架?
Please posy your skeleton, atlas and PNG files. It looks like the cocos runtime is using the spine-ts 4.1 beta runtime. Didmyou export your skeleton from Spine Editor version 4.1-beta?
头像
Mario

Mario
  • 帖子: 2730

cmd1115

我的运行环境是react,js的环境,用的是官方示例的骨架、地图集和 PNG 文件
有的报这个错误,有的spine的大小会变大变小,相同的代码,是什么会影响spine运行呢?

还有个问题是我new spine.SpineCanvas了以后,这个组件怎么能删除?现在正常运行的控件会一直后台render和update
cmd1115
  • 帖子: 6

Mario

如果您不链接或不提供您正在使用的资产,并且不指定您正在使用的 Spine 运行时版本,我将无能为力。
I can not help if you do not link or give me the assets you are using and do not specify which Spine Runtimes version you are using.1
头像
Mario

Mario
  • 帖子: 2730

cmd1115

我用的是4.0版本

new spine.SpineCanvas了以后,这个组件怎么能删除?现在正常运行的控件会一直后台render和update
cmd1115
  • 帖子: 6

Mario

4.0? 堆栈跟踪指的是 Sequence 类,它仅在 4.1-beta 中可用。 再次,请用我可以执行的代码说明您的问题。 否则很难提供帮助。
4.0? The stack trace refers to the Sequence class, which is only available in 4.1-beta. Again, please illustrate your question with code I can execute. It's very hard to give help otherwise.
头像
Mario

Mario
  • 帖子: 2730


回到 中国Spine用户