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

View Animation gtlf #111

Open
lajune1 opened this issue Jun 28, 2018 · 1 comment
Open

View Animation gtlf #111

lajune1 opened this issue Jun 28, 2018 · 1 comment

Comments

@lajune1
Copy link

lajune1 commented Jun 28, 2018

Hi there! I am trying to see an animation that I uploaded to the AR hit test test. I uploaded the gltf with an animation attached, however it does not play when I open the scene. It is a static object. Do I have to add something or delete something to/from the code to get it working?

@ghost
Copy link

ghost commented May 2, 2019

I also am struggling with this but probably because I stink at coding in JavaScript.

In the code base I use - there is a class just before a function that I'm not sure about. But within what appears to be an initialization function using a GLTF loader doing something with a '=>' thing that enables us to set parameters about the gltf model.

` loadGLTF('https://cdn.glitch.com/f485dc5e-a1b5-4091-8408-6411aea91377%2Ftext_1%20(1).glb?1555527607936').then(gltf => {
gltf.scene.scale.set(.03, .03, .03)
gltf.scene.rotation.set(90, 0, 180)
gltf.scene.position.set(4, 0, -9)
gltf.scene.quaternion.setFromAxisAngle(new THREE.Vector3(0, 0, 0), Math.PI)

					gltf.scene.traverse(node => {
						if (node.material && (node.material.isMeshStandardMaterial || (node.material.isShaderMaterial && node.material.envMap !== undefined))){
							node.material.envMap = this.envMap
							node.material.needsUpdate = true
						}
					})

					this.floorGroup.add(gltf.scene)
        this.floorGroup.add( axesHelper );
				}).catch((...params) =>{
					console.error('could not load gltf', ...params)
				})
      
      `

I took three approaches here:

  1. Just copy paste the system from https://threejs.org/docs/index.html#manual/en/introduction/Animation-system
  2. refactor the bottom portion to play nice
    // Play all animations
    clips.forEach( function ( clip ) {
    mixer.clipAction( clip ).play();
    } );

so...
gltf.scene.animationClip.mixer.clipAction.set( play();

  1. Just use A-frame and hope to the heavens it is that simple.....

None of this worked, obviously. So...if anyone has any spare time to give me a clue it would be much appreciated.

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

1 participant