Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot clone GLTF Model Scenes with DracoLoader extension #161

Open
tugalsan opened this issue Jul 5, 2020 · 7 comments
Open

Cannot clone GLTF Model Scenes with DracoLoader extension #161

tugalsan opened this issue Jul 5, 2020 · 7 comments

Comments

@tugalsan
Copy link

tugalsan commented Jul 5, 2020

Hello @treblereel

I have learned that I have to clone things to add it again to be efficient.
stackoverflow: I found one fast solution (not the most efficient)

I can clone Meshes:

scene.add(boxMesh.clone());

I can clone standard GLTF files:

scene.add(damagedHelmetScene.clone());

But, I cannot clone DracoLoaded GLTF files:

scene.add(LittlestTokyoScene.clone());
console>"(TypeError) : Cannot read property 'update' of undefined"

Ekran Alıntısı

Could you look into it, when you have time?

@treblereel
Copy link
Owner

interesting ... i have to take a look ...

@treblereel
Copy link
Owner

yeap, looks like a bug mrdoob/three.js#19419

the possible workaround is:

@InjectJavaScriptFor(elements = {OrbitControls.class, DRACOLoader.class, GLTFLoader.class, SkeletonUtils.class})
public class WebglAnimationScene extends Attachable {
            Scene model2 = Js.uncheckedCast(SkeletonUtils.clone(model));

ps: i ll as cast on return on next version.

@tugalsan
Copy link
Author

tugalsan commented Jul 9, 2020

I am trying to find where SkeletonUtils is located. It make take a while...
Are you positive that, SkeletonUtils.java/class is in either three4g-0.102.jar or three4g-extensions-0.102.jar in maven?

Ekran

I know it is not compilable but, for newbies like me, wants to come to this point quickly,
can use the below code, with lazy model loaders functions:

threeJS.zip

@tugalsan
Copy link
Author

tugalsan commented Jul 10, 2020

@treblereel I am sorry. I feel I am blind :)

Dependency view:
Dep
Import view:
import

checking pom versions...

@tugalsan
Copy link
Author

tugalsan commented Jul 10, 2020

My bad. It wasnot in three4g-extensions-0.102.jar. It was in three4g-extensions-0.105.jar
I am trying to figure out why I cannot compile, the very same code, with new three4g-0.105.jar three4g-extensions-0.105.jar libraries....

Update:

  1. Updating elemental2-dom to ver 1.1.0 fixed compilation issue.
  2. Using SkeletonUtils is successful.
    image
    threeJS (20200711).zip

@treblereel Thank you for directions...

@treblereel
Copy link
Owner

@tugalsan you should use the same core, processor and extensions version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants