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

dev2 three.json SkinnedMesh loading w.i.p. #79

Open
wants to merge 2 commits into
base: dev2
Choose a base branch
from

Conversation

antont
Copy link
Member

@antont antont commented Sep 11, 2015

WIP for implementing #78 - see motivation and info about the test for this etc. there.

Not ready to merge but am opening for discussion.

Had to disable material setting in EC_Mesh_ThreeJs as it overrode the material from the three.json

I think overall with the current EC_Mesh_ThreeJs implementation, the skeleton & material ref handling codes there, there's a bit of a conflict with the three json (and gltf and others) mesh format where the same file includes skels and animations.

dev2 EC_Mesh_ThreeJs is written for Ogre assets where those are separate. Thus much of the EC impl is dealing with loading those other files and applying them etc.

If we recommend use of Three assets, and don't even have the Ogre asset loading available, one way would be indeed to just remove those parts that overwrite the loaded material now. But that may make things difficult for where Ogre assets are used so perhaps what's needed is to make EC_Mesh_ThreeJs somehow work for both cases: not overwrite with default white when the mesh already has the correct material.

I'll check if can do that next but am open for other ideas too. If this one EC impl becomes too complex while handling both cases, perhaps the Ogre things could be moved to some EC_Mesh_ThreeJsFromOgreAssets class or so. But perhaps a simple check for existing material does it simply enough.

Also, the animation data seemed to be lost somewhere -- am not sure if that's due to the ancient three.js in dev2 still (r62 vs 72dev with which have tested the deer export now otherwise) or if something in the loading & ec mechanism still overrides that.

…tting

in EC_Mesh_ThreeJs as it overrode the material from the three.json
@antont
Copy link
Member Author

antont commented Sep 11, 2015

The loss of animation data seems to be due to three.js r62.

I tested by using three.js directly using the lib from dev2 and got the same error, animation data is undefined, in: http://playsign.github.io/webtundra-deer/threejs-deer.html

@cvetan5 said that is already working on the update to r71 -- that should fix it.

In the meantime I'll check if can make EC_Mesh_ThreeJs not override the material while keeping the currenct functionality (for ogre assets) intact.

@antont
Copy link
Member Author

antont commented Sep 11, 2015

now only sets materialWhite if no material is set from before.

I think is good otherwise but probably breaks using the EC editor to remove material ref to default to white.

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

Successfully merging this pull request may close these issues.

1 participant