Multiple meshes with the same skeleton

Started by efaj, January 08, 2012, 06:41:12 PM

Previous topic - Next topic

efaj

Do I just handle them separately, or is there a way that would be more optimized?

raft

no, no need to handle them separately. if you export all of them, each of will be an Animated3D in an AnimatedGroup. just like body and sword of ninja

efaj

But ninja has 1 single file. I need to have them in separate files and merge them only during execution, for example, to make a ninja wield different swords.
I tried for example loading them all, and then merge them with the AnimatedGroup method, but it sent an error:
Number of vertices differ!
So, that's not the way to do it, if any.

raft

as the merge method name (mergeAnimations) suggests, merging is not meant for that. you cannot merge many objects/groups into a group. you can merge animations of many identical objects/groups. the resulting group will have same skeleton and bone weights and a merged SkinClipSequence.

why do you need your objects in different files? put them in a single one and make visible/unvisible them as required

efaj

Because I'm making an online game that will allow character customization. So if I added all clothes and parts in one single file, it would grow in size a lot. And we all know that would make parsing eternal.

I'll just stick to handling them separately... I already got that done, I was just looking if there was a more efficient way.

raft

i see. yes, as you said, handling them separately is the only way I can think of. each object will have its own skeleton and animation data. needless to say, this will increase memory and cpu usage. cpu usage will not increase that much since heavy part of calculations are not animating skeleton but applying that pose to mesh.

i once started implement a method to merge objects but then for some reason I can't remember now, i cancelled the idea.