sketchpunklabs / ossos

Webbased Character Animation System
MIT License
423 stars 46 forks source link

I can't see the examples working from site #1

Closed delmohf closed 2 years ago

delmohf commented 2 years ago

Hi:

I tried to see the examples so I clone the repo and follow the installation steps: npm install, npm run dev, I found nothing on localhost:3000, then I tried npm run build:site and npm run preview-site but I found nothing on localhost:5000 then I navigated to http://localhost:5000/examples/threejs/000_gltf2_mesh.html but I got an error on Starter.js at line 51 from console:

Uncaught TypeError: Cannot read properties of undefined (reading 'substring') at Starter.cd2d3b33.js:51

Am I missing some obvious step? How can I see the examples in the browser?

Thanks!

sketchpunk commented 2 years ago

Hopefully that error is in response to the _res folder being empty. Look at /examples/_res/_setup.txt You'll need to download the animations + models separately. They can get pretty big so I didn't want them to be included in the ossos repo. All you'll really need from the res repo is the anim folder, models/nabba & models/tina. The rest of the models aren't being used in the ossos examples but you can download them if you want other things to play with.

If res is the issue there should be some sort of 404 or not found error, so not sure if this will fix the specific error your getting, but I've only tested thing with chrome on windows, so if your using a different browser + OS, the error messages will be different then what I'm used to.

delmohf commented 2 years ago

Thanks! Ok, I cloned the res repository and put its content in examples_res then run:

npm run dev

but only these examples worked:

http://localhost:3000/examples/threejs/000_gltf2_mesh.html (just the load of nabba.gltf) http://localhost:3000/examples/threejs/007_ik_solvers.html

with all other examples I got a JavaScript error in devtools console, e.g.:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0') at Object.multiply8 (quat2.js:596)

Are they errors to be fixed or should I do something else to see the examples in the browser????

PS: I am using Chrome and Windows Subsystem for Linux (WSL) so vite webserver is running on Ubuntu.

sketchpunk commented 2 years ago

Only 001_skin_dq.html & 001_skin_dqt.html are using quat2.js which is from the gl-matrix math library. The other examples shouldn't have that error since the rest of the examples are using Matrix Skinning, not dual quaternions.

At this point I'm not sure what the problem might be, maybe vite or the whole dev setup doesn't work well under ubuntu.

sketchpunk commented 2 years ago

I just noticed that examples on my end don't work either. There was a bug that went by unnoticed from my last commit. Its all fixed up in the latest commit. Hopefully this will fix the issues you where experiencing.

It was related to me changing bone.pidx into a non-nullable type, some places where still testing for nulls which resulted in certain conditions running when they shouldn't which lead to weird errors coming from gl-matrix.

delmohf commented 2 years ago

Thanks!!!, now all examples work fine. ;)

arpu commented 2 years ago

this is still a problem on latest master?

i get

index.ts:512          GET http://localhost:3000/examples/_res/models/nabba/nabba.gltf net::ERR_ABORTED 404 (Not Found)
fetch @ index.ts:512
(anonymous) @ 000_gltf2_mesh.html?html-proxy&index=0.js:14
load (async)
(anonymous) @ 000_gltf2_mesh.html?html-proxy&index=0.js:10
UtilGltf2.js:25 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'getMesh')
    at Function.loadMesh (UtilGltf2.js:25:24)
    at 000_gltf2_mesh.html?html-proxy&index=0.js:15:29
arpu commented 2 years ago

wups found the _setup.txt file in _res

sketchpunk commented 2 years ago

Yea, the res folder is kinda big with lots of binary which makes me not want to include it into the repo. Think i'm going to make an Index page for examples that links to everything, plus leave a note that people will need to download the res repo separately for meshes, animations & textures.