question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SkinnedMesh.clone doesn't work properly, results in undefined skeleton property

See original GitHub issue

When cloning SkinnedMesh, the resulting SkinnedMesh instance doesn’t have skeleton property defined.

I’m not sure if this is also a bug, but having a SkinnedMesh with undefined skeleton crashes the renderer with:

 Uncaught TypeError: Cannot read property 'frame' of undefined

at

https://github.com/mrdoob/three.js/blob/f177bce88ea3ff48818a30ff09d871133fcd245b/src/renderers/WebGLRenderer.js#L1343

Example

https://jsfiddle.net/pwonz6gd/

Three.js version
  • dev
  • r115
Browser
  • All of them
OS
  • All of them

Solution?

EDIT: (removed my horrible solution)

As mentioned, one is supposed to use SkeletonUtils.clone. I’d still expect some kind of warning about this, instead of the whole renderer crashing.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
Mugen87commented, Dec 23, 2021

That’s a good point! Let me update the docs.

2reactions
Mugen87commented, May 21, 2020

You have to use SkeletonUtils.clone() when cloning skinned meshes. Can you please give it a try?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cloning a skinned mesh - Questions - three.js forum
It doesn't work currently, but I found this function which worked well ... tried it but seems to be throwing Skeleton is not...
Read more >
Three.js export SkinnedMesh with position - Stack Overflow
and I can see all the meshes in the exported file, but the SkinnedMeshes are in the origin with wrong position and orientation....
Read more >
Cloned skinned mesh picking gets broken on original mesh ...
Cloned dude on the other hand is not selected properly after that. I'm aware of how GPU skinning works so I added the...
Read more >
Unreal Engine 5.1 Release Notes
The framework works in the editor and at runtime, as well as provides scripting support using Blueprint and Python. Interchange framework options. This...
Read more >
three.js - Apple Open Source
'undefined' ? factory(exports) : typeof define === 'function' ... the result is fully empty, not slightly empty with non-inf/+inf values that will cause ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found