You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we should support skinned skeletal animated meshes out of the box.
In Ogre-Tundra EC_Mesh supports them so that there is a separate skeleton ref attribute which makes sense as Ogre's skel anims are in separate files.
With Three.js however the skeleton and animations are in the same JSON with the geom. But different code is needed to handle them: static meshes with plain Mesh and animated with SkinnedMesh.
We will be porting our skeleton stuff at some point. Dunno if we can get that into the first release though. We also need to make sure the ludocraft avatar stuff will work with this system and the new EC_Avatar and the appearance system.
is that skeleton code somehow relevant when using the builtin three.js skeleton biz?
i think to have it similar to c++ / ogre-tundra it suffices for mesh & ec_mesh to work so that when the mesh uses a skel it's loaded with the anims and skinning is applied. i'm not sure what the API to play back anims should be then though .. in original Tundra there is the EC_AnimationController for that but am not sure if that's needed just to have a way to trigger animations.
agreed about the EC_Avatar but that's a separate topic too (to have the attachments etc) whereas this is just for skinned meshes that can be used for anything (like in original tundra too, just with EC_Mesh).
I think we should support skinned skeletal animated meshes out of the box.
In Ogre-Tundra EC_Mesh supports them so that there is a separate skeleton ref attribute which makes sense as Ogre's skel anims are in separate files.
With Three.js however the skeleton and animations are in the same JSON with the geom. But different code is needed to handle them: static meshes with plain
Mesh
and animated withSkinnedMesh
.In WebTundra 1.0 (master now) the EC_Mesh implementation supports that by detecting whether the geometry has bones or not, and chooses Mesh or SkinnedMesh based on that. That code is in: https://github.com/realXtend/WebTundra/blob/master/src/view/ThreeView.js#L286
I propose the same for 2.x (in dev2 now). I think the place to port that bones check code is: https://github.com/realXtend/WebTundra/blob/dev2/src/view/threejs/asset/ThreeJsonAsset.js#L147
Interestingly the clone() method there already has this kind of check: https://github.com/realXtend/WebTundra/blob/dev2/src/view/threejs/asset/ThreeJsonAsset.js#L110
I wonder when that hits if the loading code never creates SkinnedMesh?
Made a test case for this first using the deer from lvm / chesapeake bay:
source: https://github.com/playsign/webtundra-deer
demo: http://playsign.github.io/webtundra-deer/
The code there is simply:
var deer = this._createMesh("Deer", "webtundra://White_Tailed_Deer_all.json");
Now it shows both without skinning and for some reason also without the correct materials (with col and spec map textures).
The desired result with using Three.js SkinnedMesh directly is:
demo: https://antont.github.io/three.js/examples/webgl_animation_skinning-deer.html
code: https://github.com/antont/three.js/blob/example_skinning_deer/examples/webgl_animation_skinning-deer.html#L91
So unless there are objections I'll give a shot at modifying
ThreeJsonAsset.js
to do the same automatically (apart from starting the anim).The text was updated successfully, but these errors were encountered: