aframevr / aframe-inspector

:mag: Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
https://aframe.io/aframe-inspector/examples/
MIT License
655 stars 203 forks source link

motion capture tools #498

Closed ngokevin closed 7 years ago

ngokevin commented 7 years ago

http://aframe.io/blog/motion-capture https://github.com/dmarcos/aframe-motion-capture-components/pull/32

Changes Proposed

Motion Capture Features

screen shot 2017-07-22 at 5 05 52 am
ngokevin commented 7 years ago

Available to test https://ngokevin.github.io/aframe-inspector/example/controllers.html

screen shot 2017-07-18 at 4 53 00 am
dmarcos commented 7 years ago

I did a quick first run. Problems:

  1. When the recording starts the inspector closes, what makes everything a bit confusing. I know that the scene is paused and might be difficult to resume / pause with the inspector opened. We could maybe at least to add any recording feedback while recording is happening with the inspector closed. A blinking red dot, a timer? It would be interesting to have a button to stop recording and then the inspector opens back up again when pressed. I would probably hide the Inspect Scene button as well.
  2. When a recording is playing I can't start recording. Replaying should stop and recording start
ngokevin commented 7 years ago
  1. The Inspector should close because the Inspector adds helpers and extras. We want to be sure we are recording with the pure scene. The Inspector closing adds a level of feedback that the recording has started (versus nothing on the screen changing). -- I will make the Recording button do a countdown for now, and we can add more feedback later. -- What I intend is to have the Inspect Scene button act as the Stop Recording button. I need to make the Inspector overlay a button on top.

  2. OK.

ngokevin commented 7 years ago

I also added a few more tasks for myself in the PR description via the checkboxes after doing a run because sometimes I'd rather not have to open the Inspector on each refresh. People can import the components, take recordings with the Inspector, but be able to auto-replay them on refresh via like query param or component configuration.

ngokevin commented 7 years ago

Ready for another try-out. https://ngokevin.github.io/aframe-inspector/example/controllers.html

Camera switching may be weird sometimes because the Inspector examples immediately boot into the Inspector, and vrdisplayactivate will kick you into VR while in the Inspector. Sometimes recording will work fine, but best to exit VR and re-enter the Inspector and record. In normal use case, it is not a big problem because entering the Inspector will exit VR.

ngokevin commented 7 years ago

mocadev2

ngokevin commented 7 years ago

Also finding it useful being able to change the speed of the recording. I wrote a script to double the speed by dividing the timestamps in half, speeds up each test iteration for me (e.g., watching a 20 second recording). Maybe later will add a UI tool for that.

ngokevin commented 7 years ago

@fernandojsg r?

fernandojsg commented 7 years ago

@ngokevin I've just fetched it, npm install and npm start but I get:

ERROR in ./~/react-file-reader-input/lib/index.js                                                                                
Module not found: Error: Cannot resolve module 'prop-types' in C:\code\aframeinspector\node_modules\react-file-reader-input\lib 
 @ ./~/react-file-reader-input/lib/index.js 29:17-38                                                                             
webpack: Failed to compile.                                                                                                      

Did you forget to add some dependency in package.json? Or am I doing something wrong? :\

ngokevin commented 7 years ago

OK, can you try again? I think I needed to move a devDep to a dep in react-file-reader-input

fernandojsg commented 7 years ago

@ngokevin I've tried again and that error is gone, but as long as I click on the motion capture button and the inspector injects the aframe-motion-capture component I get the following error on the console:

[inspector] Injecting <script src="https://rawgit.com/ngokevin/aframe-motion-capture/mocapinspector/dist/aframe-motion-capture-components.min.js"></script> for motion capture.
SceneGraph.js:107 Uncaught TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at SceneGraph.js:107
    at treeIterate (SceneGraph.js:105)
    at treeIterate (SceneGraph.js:130)
    at EventEmitter.SceneGraph._this.rebuildOptions (SceneGraph.js:134)
    at EventEmitter.emit (events.js:96)
    at Events.emit (Events.js:16)
    at MutationObserver.<anonymous> (Main.js:61)

/cc @dmarcos

ngokevin commented 7 years ago

Is this A-Frame master? Will try again later.

dmarcos commented 7 years ago

When testing this:

  1. I click on the play button for the Sample Recording and I get the following errors on on console on Chrome.: errors

  2. In Firefox. I see an Indexed DB error and the Sample Recording does not show up in the list. erros

dmarcos commented 7 years ago

When trying to record:

ngokevin commented 7 years ago

OK will patch it up soon. I think it was due to an A-Frame regression (constructor is null in buildData), was working flawless for me otherwise.

ngokevin commented 7 years ago

OK fixed the A-Frame error, try again.

ngokevin commented 7 years ago

nvm need to fix things...code has rotted since rebase

ngokevin commented 7 years ago

OK, all fixed up again. Had to fix several bugs with the motion capture components (changes to A-Frame tracked-controls system which motion capture replayer wraps), and since A-Frame no longer cloned data on getAttribute, motion-capture-recorder had to clone so it wasn't save the same object for all of its poses.

fernandojsg commented 7 years ago

IMHO too much verbose info on the component. I would get rid of the long explanation on the toggle recording checkbox and on the controllers sample info, maybe adding then to a tooltip next to the button if needed, because right now is taking more than half of my screen's height. image

I would change the color of the Record and Replay instead of using underline as the first reaction would be to try to click it thinking it's a link.

I'll be out without access to a Vive so I can't test the functionality with it, @dmarcos could you try it?

In the meanwhile I've been trying with the laptop without any headset and it's confusing when you click the record button as it just go fullscreen without any other action. Should we just remove the record button if not controls or headset detected? And just let the user to replay recordings?

ngokevin commented 7 years ago

I wouldn't remove the text, they are critical instructions and it's a checkbox that changes behavior. It'd be confusing to remove the instructions and just have a bunch of shape icons. The tools are collapsible if you don't want to see.

The tools are primarily for headset but still works for 2D. Unticking the checkbox will start recording without controller trigger. I can change color of headings but I use this heavily so it works, put maybe a month into it, and it'd help everyone who is still putting the headset on and off every code change.

fernandojsg commented 7 years ago

Ok to the comments text. I still don't undestand the behaviour in 2D as I don't see any feedback that I'm recording or so, it just go fullscreen and after exiting I can't find the recorded session. Am I doing something wrong?

fernandojsg commented 7 years ago

I mean, if it's not still supported the 2D mode for recording, we could just merge it and then we could fix/disable the 2d mode recording in another PR, and then improve the support for it just not to delay this PR as it's already being delayed a lot (Sorry for that :)

fernandojsg commented 7 years ago

@ngokevin any thoughts on my previous comments?

ngokevin commented 7 years ago

@fernandojsg Sorry, I'm back! I added some text display to the camera Press any controller or keyboard button to record, and support pressing keyboard button to start. This gives an indicator for both 2D and VR mode. Should be good now!

fernandojsg commented 7 years ago

@ngokevin welcome back! :+1: I've tried it and it works great in 2D! I've just found a small bug that make it throws an error when using the keyboards to move around the scene.

image

ngokevin commented 7 years ago

ok fixed

fernandojsg commented 7 years ago

Supercool!!! πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰

ngokevin commented 7 years ago

horray, i'm gonna cut a release of inspector and later on do a blog post

fernandojsg commented 7 years ago

@ngokevin cool! :+1:

Utopiah commented 7 years ago

Bit confusing to get a fixed point of view when the recording is finished, might we less disorienting to leave the camera moving with the HMD but display a message like "remove the HMD and go edit in the inspector" after.

Anyway that's great, can't wait to read the blog post!

nikgraf commented 7 years ago

Really amazing!