dmarcos / aframe-motion-capture-components

Capture entity motions and replay them on other entities
http://swimminglessonsformodernlife.com/aframe-motion-capture-components/
MIT License
132 stars 31 forks source link

Motion-Capture-Components not working with aframe 0.9.0 (Cannot read property 'updateControllerList' of undefined) #43

Open Wavewash opened 5 years ago

Wavewash commented 5 years ago

When running with a-frame 0.9.0 I'm presented with this error:

aframe-motion-capture-components.js:1327 Uncaught TypeError: Cannot read property 'updateControllerList' of undefined at o.init (aframe-motion-capture-components.js:1327) at o.module.exports.System (system.js:42) at new o (system.js:147) at HTMLElement.value (a-scene.js:184) at HTMLElement.value (a-scene.js:173) at HTMLElement.value (a-scene.js:102) at HTMLElement.value (a-register-element.js:160)

in https://unpkg.com/aframe-motion-capture-components/dist/aframe-motion-capture-components.js on line 1327:

 // Wrap `updateControllerList`.
        this.updateControllerListOriginal = trackedControlsSystem.updateControllerList.bind(
          trackedControlsSystem);

It's complaining that this.updateControlelrListOriginal is undefined. Going a little further up to line 1320:

trackedControlsSystem = sceneEl.systems['tracked-controls'];
trackedControlsTick = AFRAME.components['tracked-controls'].Component.prototype.tick;

Inspecting here I found sceneEl.systems['tracked-controls'] doesn't exist but looking at sceneEl.systemNames I could see:

(9) ["camera", "geometry", "gltf-model", "light", "material", "renderer", "shadow", "tracked-controls-webvr", "tracked-controls-webxr"]

we do have "tracked-controls-webvr" and "tracked-controls-webxr"

I've put together a glitch to show the problem: https://glitch.com/edit/#!/past-lasher

Thanks for all your work!

JakeCasey commented 5 years ago

For anyone that this may help, I was able to attain passable head movement from the recording with minor visual glitches by replacing tracked-controls with tracked-controls-webxr, however hand models are not appearing. I'll keep playing with it, but if anyone else wants to take a stab at this that would be awesome. This lib is too useful!!

JakeCasey commented 5 years ago

I got a little further by forcing visibility of replayed elements, as I believe Aframe default hides controllers if they aren't connected. Though I don't know if this is ideal because maybe elements that are being replayed shouldn't always be visible? It should be as close to the replay as possible, obviously.

     log('Setting motion-capture-replayer on ' + key + '.');
            replayingEl.setAttribute('motion-capture-replayer', {
              loop: data.loop,
            });

            // Force element to be visible
            replayingEl.setAttribute('visible', 'true');

            replayingEl.components['motion-capture-replayer'].startReplaying(
              replayData[key],
            );

Hopefully this helps someone who's just trying to get by! Still some major visual glitches I think being caused by two replays starting at the same time? I'll keep testing.

SaulBurgos commented 4 years ago

I have the same error :

Uncaught TypeError: Cannot read property 'updateControllerList' of undefined

and I just have this code super simple:

https://gist.github.com/SaulBurgos/6c33e4dd053f1912318ca8691865f46f

image

Any idea?

han-steve commented 3 years ago

Is this still not resolved? It's basically unusable :(